[virt-manager/f17] Use correct KVM package names on first run (bz #873878) network: fix parsing ip blocks with prefix=

Cole Robinson crobinso at fedoraproject.org
Mon Dec 17 20:02:29 UTC 2012


commit 222f1db44856bdec39bd10869fbb33b0cc3577d1
Author: Cole Robinson <crobinso at redhat.com>
Date:   Mon Dec 17 15:02:27 2012 -0500

    Use correct KVM package names on first run (bz #873878)
    network: fix parsing ip blocks with prefix= (bz #872814)
    Don't recommend all of libvirt, just the kvm bits (bz #872246)

 ...test-first-run-switch-for-testing-Package.patch |   96 ++++++++++++++++++++
 0008-Fix-test-first-run.patch                      |   37 ++++++++
 0009-really-fix-kvm-substitution.patch             |   13 +++
 ...network-Fix-parsing-ip-blocks-with-prefix.patch |   49 ++++++++++
 virt-manager.spec                                  |   19 ++++-
 5 files changed, 212 insertions(+), 2 deletions(-)
---
diff --git a/0007-Add-hidden-test-first-run-switch-for-testing-Package.patch b/0007-Add-hidden-test-first-run-switch-for-testing-Package.patch
new file mode 100644
index 0000000..c32aa14
--- /dev/null
+++ b/0007-Add-hidden-test-first-run-switch-for-testing-Package.patch
@@ -0,0 +1,96 @@
+From 29ffac229ae7036dc238262d5e733a850b233329 Mon Sep 17 00:00:00 2001
+Message-Id: <29ffac229ae7036dc238262d5e733a850b233329.1355706113.git.crobinso at redhat.com>
+In-Reply-To: <30282a17091014ba5a96d20f4260df55779933c4.1355706113.git.crobinso at redhat.com>
+References: <30282a17091014ba5a96d20f4260df55779933c4.1355706113.git.crobinso at redhat.com>
+From: Cole Robinson <crobinso at redhat.com>
+Date: Sun, 28 Oct 2012 18:49:48 -0400
+Subject: [PATCH 7/8] Add hidden --test-first-run switch for testing PackageKit
+ bits
+
+Basically stubs out the gconf URI fetching + listing so we don't
+need to delete anything to trigger it.
+(cherry picked from commit 96ce9ac0b1257b66d0075c12aa572afe21eae0b0)
+
+Conflicts:
+	src/virt-manager.py.in
+---
+ src/virt-manager.py.in    |  8 +++++++-
+ src/virtManager/config.py | 11 ++++++++++-
+ 2 files changed, 17 insertions(+), 2 deletions(-)
+
+diff --git a/src/virt-manager.py.in b/src/virt-manager.py.in
+index 1f93d22..0cac2c2 100755
+--- a/src/virt-manager.py.in
++++ b/src/virt-manager.py.in
+@@ -117,6 +117,11 @@ def parse_commandline():
+     optParser.add_option("--profile", dest="profile",
+         help=optparse.SUPPRESS_HELP, metavar="FILE")
+ 
++    # Don't load any connections on startup to test first run
++    # PackageKit integration
++    optParser.add_option("--test-first-run", dest="testfirstrun",
++        help=optparse.SUPPRESS_HELP, action="store_true")
++
+     optParser.add_option("-c", "--connect", dest="uri",
+         help="Connect to hypervisor at URI", metavar="URI")
+     optParser.add_option("--debug", action="store_true", dest="debug",
+@@ -318,7 +323,8 @@ def main():
+     # display access
+     import virtManager.config
+     import virtManager.util
+-    config = virtManager.config.vmmConfig(appname, appversion, ui_dir)
++    config = virtManager.config.vmmConfig(appname, appversion, ui_dir,
++                                          options.test_first_run)
+     virtManager.util.running_config = config
+     config.default_qemu_user = default_qemu_user
+     config.rhel6_defaults = rhel_enable_unsupported_opts
+diff --git a/src/virtManager/config.py b/src/virtManager/config.py
+index 63cbc15..508fea0 100644
+--- a/src/virtManager/config.py
++++ b/src/virtManager/config.py
+@@ -88,11 +88,12 @@ class vmmConfig(object):
+     DEFAULT_VIRT_IMAGE_DIR = "/var/lib/libvirt/images"
+     DEFAULT_VIRT_SAVE_DIR = "/var/lib/libvirt"
+ 
+-    def __init__(self, appname, appversion, ui_dir):
++    def __init__(self, appname, appversion, ui_dir, test_first_run=False):
+         self.appname = appname
+         self.appversion = appversion
+         self.conf_dir = "/apps/" + appname
+         self.ui_dir = ui_dir
++        self.test_first_run = bool(test_first_run)
+ 
+         self.conf = gconf.client_get_default()
+         self.conf.add_dir(self.conf_dir, gconf.CLIENT_PRELOAD_NONE)
+@@ -590,6 +591,9 @@ class vmmConfig(object):
+ 
+     # Manager view connection list
+     def add_conn(self, uri):
++        if self.test_first_run:
++            return
++
+         uris = self.conf.get_list(self.conf_dir + "/connections/uris",
+                                   gconf.VALUE_STRING)
+         if uris == None:
+@@ -619,6 +623,8 @@ class vmmConfig(object):
+                                gconf.VALUE_STRING, uris)
+ 
+     def get_conn_uris(self):
++        if self.test_first_run:
++            return []
+         return self.conf.get_list(self.conf_dir + "/connections/uris",
+                                   gconf.VALUE_STRING)
+ 
+@@ -638,6 +644,9 @@ class vmmConfig(object):
+         return ((uris is not None) and (uri in uris))
+ 
+     def set_conn_autoconnect(self, uri, val):
++        if self.test_first_run:
++            return
++
+         uris = self.conf.get_list(self.conf_dir + "/connections/autoconnect",
+                                   gconf.VALUE_STRING)
+         if uris is None:
+-- 
+1.8.0.2
+
diff --git a/0008-Fix-test-first-run.patch b/0008-Fix-test-first-run.patch
new file mode 100644
index 0000000..5a88553
--- /dev/null
+++ b/0008-Fix-test-first-run.patch
@@ -0,0 +1,37 @@
+From a00bcce0a0d3a5af85dbf685aefec5495349328f Mon Sep 17 00:00:00 2001
+Message-Id: <a00bcce0a0d3a5af85dbf685aefec5495349328f.1355706113.git.crobinso at redhat.com>
+In-Reply-To: <30282a17091014ba5a96d20f4260df55779933c4.1355706113.git.crobinso at redhat.com>
+References: <30282a17091014ba5a96d20f4260df55779933c4.1355706113.git.crobinso at redhat.com>
+From: Michal Privoznik <mprivozn at redhat.com>
+Date: Tue, 30 Oct 2012 14:22:44 +0100
+Subject: [PATCH 8/8] Fix --test-first-run
+
+One of previous patches (96ce9ac0b125) invented this feature. However,
+in options object it is called testfirstrun not test_first_run.
+This produces a runtime error.
+
+(crobinso: add Michal to AUTHORS)
+(cherry picked from commit d9e8546e8608d0fd0b6af61e9a2236c91b286cdd)
+
+Conflicts:
+	AUTHORS
+---
+ src/virt-manager.py.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/virt-manager.py.in b/src/virt-manager.py.in
+index 0cac2c2..f01c476 100755
+--- a/src/virt-manager.py.in
++++ b/src/virt-manager.py.in
+@@ -324,7 +324,7 @@ def main():
+     import virtManager.config
+     import virtManager.util
+     config = virtManager.config.vmmConfig(appname, appversion, ui_dir,
+-                                          options.test_first_run)
++                                          options.testfirstrun)
+     virtManager.util.running_config = config
+     config.default_qemu_user = default_qemu_user
+     config.rhel6_defaults = rhel_enable_unsupported_opts
+-- 
+1.8.0.2
+
diff --git a/0009-really-fix-kvm-substitution.patch b/0009-really-fix-kvm-substitution.patch
new file mode 100644
index 0000000..34f1996
--- /dev/null
+++ b/0009-really-fix-kvm-substitution.patch
@@ -0,0 +1,13 @@
+diff --git a/src/Makefile.in b/src/Makefile.in
+index f3d53be..92a536e 100644
+--- a/src/Makefile.in
++++ b/src/Makefile.in
+@@ -814,7 +814,7 @@ uninstall-am: uninstall-binSCRIPTS uninstall-dbusDATA \
+ 	  -e "s,::DEFAULT_QEMU_USER::,$(DEFAULT_QEMU_USER)," \
+ 	  -e "s,::ENABLE_UNSUPPORTED_RHEL_OPTS::,$(ENABLE_UNSUPPORTED_RHEL_OPTS)," \
+ 	  -e "s|::PREFERRED_DISTROS::|$(PREFERRED_DISTROS)|" \
+-	  -e "s|::HV_PACKAGES::|$(KVM_PACKAGES)|" \
++	  -e "s|::KVM_PACKAGES::|$(KVM_PACKAGES)|" \
+ 	  -e "s|::ASKPASS_PACKAGE::|$(ASKPASS_PACKAGE)|" \
+ 	  -e "s|::LIBVIRT_PACKAGES::|$(LIBVIRT_PACKAGES)|" \
+ 	  < $< > $@
diff --git a/0010-network-Fix-parsing-ip-blocks-with-prefix.patch b/0010-network-Fix-parsing-ip-blocks-with-prefix.patch
new file mode 100644
index 0000000..ac4a94d
--- /dev/null
+++ b/0010-network-Fix-parsing-ip-blocks-with-prefix.patch
@@ -0,0 +1,49 @@
+From 820f78af13b564600d600a199d6ef30aecde620e Mon Sep 17 00:00:00 2001
+Message-Id: <820f78af13b564600d600a199d6ef30aecde620e.1355773837.git.crobinso at redhat.com>
+In-Reply-To: <8bfad3a2cc1c83e8d0f04f232b0ebe0847fd6bca.1355773837.git.crobinso at redhat.com>
+References: <8bfad3a2cc1c83e8d0f04f232b0ebe0847fd6bca.1355773837.git.crobinso at redhat.com>
+From: Cole Robinson <crobinso at redhat.com>
+Date: Mon, 17 Dec 2012 14:48:42 -0500
+Subject: [PATCH 10/10] network: Fix parsing <ip> blocks with prefix=
+
+https://bugzilla.redhat.com/show_bug.cgi?id=872814
+(cherry picked from commit 32f74219b024ddbd6fac5301c58e27540541d569)
+---
+ src/virtManager/network.py | 20 +++++++++++++++-----
+ 1 file changed, 15 insertions(+), 5 deletions(-)
+
+diff --git a/src/virtManager/network.py b/src/virtManager/network.py
+index ae89955..fa3e6ea 100644
+--- a/src/virtManager/network.py
++++ b/src/virtManager/network.py
+@@ -101,12 +101,22 @@ class vmmNetwork(vmmLibvirtObject):
+             return None
+         addrStr = util.xpath(xml, "/network/ip/@address")
+         netmaskStr = util.xpath(xml, "/network/ip/@netmask")
++        prefix = util.xpath(xml, "/network/ip/@prefix")
++
++        if prefix:
++            prefix = int(prefix)
++            binstr = ((prefix * "1") + ((32 - prefix) * "0"))
++            netmaskStr = str(IP(int(binstr, base=2)))
++
++        if netmaskStr:
++            netmask = IP(netmaskStr)
++            gateway = IP(addrStr)
++            network = IP(gateway.int() & netmask.int())
++            ret = IP(str(network) + "/" + netmaskStr)
++        else:
++            ret = IP(str(addrStr))
+ 
+-        netmask = IP(netmaskStr)
+-        gateway = IP(addrStr)
+-
+-        network = IP(gateway.int() & netmask.int())
+-        return IP(str(network) + "/" + netmaskStr)
++        return ret
+ 
+     def get_ipv4_forward(self):
+         xml = self.get_xml()
+-- 
+1.8.0.2
+
diff --git a/virt-manager.spec b/virt-manager.spec
index b098708..fddbe51 100644
--- a/virt-manager.spec
+++ b/virt-manager.spec
@@ -2,13 +2,13 @@
 
 %define _package virt-manager
 %define _version 0.9.4
-%define _release 2
+%define _release 3
 %define virtinst_version 0.600.3
 
 %define qemu_user                  "qemu"
 %define preferred_distros          "fedora,rhel"
 %define kvm_packages               "qemu-system-x86"
-%define libvirt_packages           "libvirt"
+%define libvirt_packages           "libvirt-daemon-qemu"
 %define askpass_package            "openssh-askpass"
 %define disable_unsupported_rhel   0
 
@@ -47,6 +47,12 @@ Patch1: 0001-virt-manager-Fix-KVM_PACKAGES-substitution-variable.patch
 Patch2: 0002-domain-Handle-PMSUSPENDED-status.patch
 # Fix 'browse local' behavior when choosing directory (bz #855335)
 Patch3: 0003-browse_local-Fix-choosing-directory-of-F17.patch
+# Use correct KVM package names on first run (bz 873878)
+Patch4: 0007-Add-hidden-test-first-run-switch-for-testing-Package.patch
+Patch5: 0008-Fix-test-first-run.patch
+Patch6: 0009-really-fix-kvm-substitution.patch
+# network: fix parsing ip blocks with prefix= (bz 872814)
+Patch7: 0010-network-Fix-parsing-ip-blocks-with-prefix.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildArch: noarch
 
@@ -148,6 +154,10 @@ Common files used by the different Virtual Machine Manager interfaces.
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
+%patch4 -p1
+%patch5 -p1
+%patch6 -p1
+%patch7 -p1
 
 %build
 %if %{qemu_user}
@@ -270,6 +280,11 @@ update-desktop-database -q %{_datadir}/applications
 %endif
 
 %changelog
+* Mon Dec 17 2012 Cole Robinson <crobinso at redhat.com> - 0.9.4-3
+- Use correct KVM package names on first run (bz #873878)
+- network: fix parsing ip blocks with prefix= (bz #872814)
+- Don't recommend all of libvirt, just the kvm bits (bz #872246)
+
 * Wed Oct 24 2012 Cole Robinson <crobinso at redhat.com> - 0.9.4-2
 - Fix KVM package install on app first run
 - Fix listing domain with 'suspended' state (bz #850954)


More information about the scm-commits mailing list