[libvirt] [PATCH] Install default storage pool

The attached patch adds a default pool definition to install with libvirt. The pool is a directory pool, hardcoded to use /var/lib/libvirt/images, though this is replaced with %{_localstatedir}/lib/libvirt/images if installing via rpm. Since /var/lib/libvirt/images may not exist if installing from tar.gz, the pool is set not to autostart by default via that method. This patch isn't ready to apply though, since there is one issue I don't know how to solve. We don't want every rpm upgrade to install the default pool, since we don't want the default to continually resurrect itself if a user explicitly deletes it. The default network handles this by checking if libvirtd has been installed. Since libvirtd and virtual network support were introduced around the same time, this makes sense. However for storage, I can't think of any simple check we can make. If we used the same as the default network, all f8 or f9 upgrades wouldn't install the default pool. I can't really think of anything to check, besides maybe doing some sort of time comparison on when /usr/share/libvirt/storage/default.xml was accessed. This code is just hardcoded to always add it. Any ideas? Thanks, Cole

On Wed, Aug 06, 2008 at 05:10:23PM -0400, Cole Robinson wrote:
The attached patch adds a default pool definition to install with libvirt. The pool is a directory pool, hardcoded to use /var/lib/libvirt/images, though this is replaced with %{_localstatedir}/lib/libvirt/images if installing via rpm.
Since /var/lib/libvirt/images may not exist if installing from tar.gz, the pool is set not to autostart by default via that method.
We should have the 'make install' rule create that directory
This patch isn't ready to apply though, since there is one issue I don't know how to solve. We don't want every rpm upgrade to install the default pool, since we don't want the default to continually resurrect itself if a user explicitly deletes it.
The default network handles this by checking if libvirtd has been installed. Since libvirtd and virtual network support were introduced around the same time, this makes sense. However for storage, I can't think of any simple check we can make. If we used the same as the default network, all f8 or f9 upgrades wouldn't install the default pool.
I think we should just handle this a little differently. Basically don't do any setup in the RPM of the storage pool config, merely have /var/lib/libvirt/images created - this is already done in fact. Then if virt-install, or virt-manager run and find no configured storage pools at all on a host at time of VM creation, they should simply create the default one pointing at /var/lib/libvirt/images/. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
participants (2)
-
Cole Robinson
-
Daniel P. Berrange