]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Fixed generation of UUIDs to work on upgrades
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 13 Mar 2007 03:18:52 +0000 (03:18 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Tue, 13 Mar 2007 03:18:52 +0000 (03:18 +0000)
ChangeLog
libvirt.spec.in

index bcec9857d77e1f29ed9c8bc2f8ec43844b902c5f..cc30c38e9825516c3bcdf1ff853a6668c4d03825 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Mon Mar 12 23:17:11 EST 2007 Daniel P. Berrange <berrange@redhat.com>
+
+       * libvirt.spec.in: Don't run UUID generation on first install,
+       instead run it if there is no <uuid> in the default network.
+       This ensures RPM upgrades get a UUID inserted
+
 Mon Mar 12 12:32:11 EST 2007 Daniel P. Berrange <berrange@redhat.com>
 
        * libvirt.spec.in: Generate a random UUID for the default network
index 8123e886e482bb9d6ef23fe8af968f733e840830..a9015870a60d19427a1a87865edc2d7993bfb6fc 100644 (file)
@@ -84,7 +84,8 @@ rm -fr %{buildroot}
 %post
 /sbin/ldconfig
 /sbin/chkconfig --add libvirtd
-if [ $1 = 1 ]; then
+grep uuid  %{_sysconfdir}/libvirt/qemu/networks/default.xml 1>/dev/null 2>&1
+if [ $? != 0 ]; then
     UUID=`/usr/bin/uuidgen`
     sed -i -e "s,</name>,</name>\n  <uuid>$UUID</uuid>," %{_sysconfdir}/libvirt/qemu/networks/default.xml
 fi