From abec60a04200d1fed910f406bd354bee07c106fb Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Mon, 13 Apr 2015 18:37:47 -0400 Subject: [PATCH] sshtunnels: Don't use socket API for fd passed to spice (bz #1135808) Fix available install options for qemu ppc64le (bz #1209720) Catch errors fetching domcapabilities, fix ppc64le details (bz #1209723) Improve disk defaults for qemu -M q35 (bz #1207834) --- ...-use-socket-API-for-fd-passed-to-spi.patch | 22 +++ ...er-install-options-for-ppc64le-bz-12.patch | 34 ++++ ...Can-and-log-error-fetching-XML-bz-12.patch | 65 +++++++ ...hardware-Allow-SATA-CDROM-bz-1207834.patch | 22 +++ ...y-default-for-q35-cdrom-non-virtio-b.patch | 173 ++++++++++++++++++ ...n-t-advertise-IDE-for-Q35-bz-1207834.patch | 51 ++++++ virt-manager.spec | 30 ++- 7 files changed, 396 insertions(+), 1 deletion(-) create mode 100644 0009-sshtunnels-Don-t-use-socket-API-for-fd-passed-to-spi.patch create mode 100644 0010-create-Show-proper-install-options-for-ppc64le-bz-12.patch create mode 100644 0011-domcapabilities-Can-and-log-error-fetching-XML-bz-12.patch create mode 100644 0012-addhardware-Allow-SATA-CDROM-bz-1207834.patch create mode 100644 0013-guest-Use-sata-by-default-for-q35-cdrom-non-virtio-b.patch create mode 100644 0014-addhardware-Don-t-advertise-IDE-for-Q35-bz-1207834.patch diff --git a/0009-sshtunnels-Don-t-use-socket-API-for-fd-passed-to-spi.patch b/0009-sshtunnels-Don-t-use-socket-API-for-fd-passed-to-spi.patch new file mode 100644 index 0000000..908d401 --- /dev/null +++ b/0009-sshtunnels-Don-t-use-socket-API-for-fd-passed-to-spi.patch @@ -0,0 +1,22 @@ +From: Cole Robinson +Date: Sat, 11 Apr 2015 23:04:03 -0400 +Subject: [PATCH virt-manager] sshtunnels: Don't use socket API for fd passed + to spice (bug 1135808) + +--- + virtManager/sshtunnels.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/virtManager/sshtunnels.py b/virtManager/sshtunnels.py +index 3a338a4..3cd0182 100644 +--- a/virtManager/sshtunnels.py ++++ b/virtManager/sshtunnels.py +@@ -141,7 +141,7 @@ class _Tunnel(object): + self._outfds = socket.socketpair() + self._errfds = socket.socketpair() + +- return self._outfds[0].fileno(), self._launch_tunnel, ginfo ++ return os.dup(self._outfds[0].fileno()), self._launch_tunnel, ginfo + + def close(self): + if self.closed: diff --git a/0010-create-Show-proper-install-options-for-ppc64le-bz-12.patch b/0010-create-Show-proper-install-options-for-ppc64le-bz-12.patch new file mode 100644 index 0000000..1b758b8 --- /dev/null +++ b/0010-create-Show-proper-install-options-for-ppc64le-bz-12.patch @@ -0,0 +1,34 @@ +From: Cole Robinson +Date: Wed, 8 Apr 2015 09:31:07 -0400 +Subject: [PATCH virt-manager] create: Show proper install options for ppc64le + (bz 1209720) + +(cherry picked from commit 68a11727a49f7c07bc3fbf14a71b65edb53a8dd7) +--- + virtManager/create.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/virtManager/create.py b/virtManager/create.py +index 0f9bdaa..1600fda 100644 +--- a/virtManager/create.py ++++ b/virtManager/create.py +@@ -417,8 +417,8 @@ class vmmCreate(vmmGObjectUI): + is_container = self.conn.is_container() + can_remote_url = self.conn.get_backend().support_remote_url_install() + +- installable_arch = (self.capsguest.arch in +- ["i686", "x86_64", "ppc64", "ia64"]) ++ installable_arch = (self.capsinfo.arch in ++ ["i686", "x86_64", "ppc64", "ppc64le", "ia64"]) + + # Install Options + method_tree = self.widget("method-tree") +@@ -680,7 +680,7 @@ class vmmCreate(vmmGObjectUI): + archs.remove("i686") + archs.sort() + +- prios = ["x86_64", "i686", "armv7l", "ppc64"] ++ prios = ["x86_64", "i686", "armv7l", "ppc64", "ppc64le"] + if self.conn.caps.host.cpu.arch not in prios: + prios = [] + else: diff --git a/0011-domcapabilities-Can-and-log-error-fetching-XML-bz-12.patch b/0011-domcapabilities-Can-and-log-error-fetching-XML-bz-12.patch new file mode 100644 index 0000000..40d3b07 --- /dev/null +++ b/0011-domcapabilities-Can-and-log-error-fetching-XML-bz-12.patch @@ -0,0 +1,65 @@ +From: Cole Robinson +Date: Wed, 8 Apr 2015 09:53:30 -0400 +Subject: [PATCH virt-manager] domcapabilities: Can and log error fetching XML + (bz #1209723) + +(cherry picked from commit 6634053533e878d8e4ed6541350c060b22a096f6) +--- + virtManager/domain.py | 12 ++---------- + virtinst/domcapabilities.py | 22 ++++++++++++++++++++++ + 2 files changed, 24 insertions(+), 10 deletions(-) + +diff --git a/virtManager/domain.py b/virtManager/domain.py +index 4a98f7f..a00c0db 100644 +--- a/virtManager/domain.py ++++ b/virtManager/domain.py +@@ -508,17 +508,9 @@ class vmmDomain(vmmLibvirtObject): + "image allocated to the guest.") + + def get_domain_capabilities(self): +- if not self.conn.check_support( +- self.conn.SUPPORT_CONN_DOMAIN_CAPABILITIES): +- self._domain_caps = DomainCapabilities(self.conn.get_backend()) +- + if not self._domain_caps: +- xml = self.conn.get_backend().getDomainCapabilities( +- self.get_xmlobj().emulator, self.get_xmlobj().os.arch, +- self.get_xmlobj().os.machine, self.get_xmlobj().type) +- self._domain_caps = DomainCapabilities(self.conn.get_backend(), +- parsexml=xml) +- ++ self._domain_caps = DomainCapabilities.build_from_guest( ++ self.get_xmlobj()) + return self._domain_caps + + +diff --git a/virtinst/domcapabilities.py b/virtinst/domcapabilities.py +index 6de7afb..bdec335 100644 +--- a/virtinst/domcapabilities.py ++++ b/virtinst/domcapabilities.py +@@ -79,3 +79,25 @@ class DomainCapabilities(XMLBuilder): + _XML_ROOT_NAME = "domainCapabilities" + os = XMLChildProperty(_OS, is_single=True) + devices = XMLChildProperty(_Devices, is_single=True) ++ ++ @staticmethod ++ def build_from_params(conn, emulator, arch, machine, hvtype): ++ xml = None ++ if conn.check_support( ++ conn.SUPPORT_CONN_DOMAIN_CAPABILITIES): ++ try: ++ xml = conn.getDomainCapabilities(emulator, arch, ++ machine, hvtype) ++ except: ++ logging.debug("Error fetching domcapabilities XML", ++ exc_info=True) ++ ++ if not xml: ++ # If not supported, just use a stub object ++ return DomainCapabilities(conn) ++ return DomainCapabilities(conn, parsexml=xml) ++ ++ @staticmethod ++ def build_from_guest(guest): ++ return DomainCapabilities.build_from_params(guest.conn, ++ guest.emulator, guest.os.arch, guest.os.machine, guest.type) diff --git a/0012-addhardware-Allow-SATA-CDROM-bz-1207834.patch b/0012-addhardware-Allow-SATA-CDROM-bz-1207834.patch new file mode 100644 index 0000000..92c28cc --- /dev/null +++ b/0012-addhardware-Allow-SATA-CDROM-bz-1207834.patch @@ -0,0 +1,22 @@ +From: Cole Robinson +Date: Sat, 4 Apr 2015 19:07:39 -0400 +Subject: [PATCH virt-manager] addhardware: Allow SATA CDROM (bz 1207834) + +(cherry picked from commit dd8f7c90c0ab2ccccf341e344f0abd90853d8711) +--- + virtManager/addhardware.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py +index 0c989df..5e8c0b3 100644 +--- a/virtManager/addhardware.py ++++ b/virtManager/addhardware.py +@@ -800,7 +800,7 @@ class vmmAddHardware(vmmGObjectUI): + disk_buses = ["ide", "sata", "scsi", "sd", + "usb", "virtio", "virtio-scsi", "xen"] + floppy_buses = ["fdc"] +- cdrom_buses = ["ide", "scsi"] ++ cdrom_buses = ["ide", "sata", "scsi"] + lun_buses = ["virtio-scsi"] + + if bus in disk_buses: diff --git a/0013-guest-Use-sata-by-default-for-q35-cdrom-non-virtio-b.patch b/0013-guest-Use-sata-by-default-for-q35-cdrom-non-virtio-b.patch new file mode 100644 index 0000000..c35059b --- /dev/null +++ b/0013-guest-Use-sata-by-default-for-q35-cdrom-non-virtio-b.patch @@ -0,0 +1,173 @@ +From: Cole Robinson +Date: Mon, 6 Apr 2015 13:43:18 -0400 +Subject: [PATCH virt-manager] guest: Use sata by default for q35 cdrom, + non-virtio (bz #1207834) + +(cherry picked from commit e29f216503106738328d267b33773f54230c2f86) +--- + .../compare/virt-install-q35-defaults.xml | 133 +++++++++++++++++++++ + virtinst/guest.py | 4 + + 2 files changed, 137 insertions(+) + create mode 100644 tests/cli-test-xml/compare/virt-install-q35-defaults.xml + +diff --git a/tests/cli-test-xml/compare/virt-install-q35-defaults.xml b/tests/cli-test-xml/compare/virt-install-q35-defaults.xml +new file mode 100644 +index 0000000..b87afe1 +--- /dev/null ++++ b/tests/cli-test-xml/compare/virt-install-q35-defaults.xml +@@ -0,0 +1,133 @@ ++ ++ foobar ++ 00000000-1111-2222-3333-444444444444 ++ 65536 ++ 65536 ++ 1 ++ ++ hvm ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ core2duo ++ ++ ++ ++ ++ ++ ++ destroy ++ destroy ++ destroy ++ ++ /usr/bin/qemu-kvm ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ foobar ++ 00000000-1111-2222-3333-444444444444 ++ 65536 ++ 65536 ++ 1 ++ ++ hvm ++ ++ ++ ++ ++ ++ ++ ++ ++ core2duo ++ ++ ++ ++ ++ ++ ++ destroy ++ restart ++ restart ++ ++ /usr/bin/qemu-kvm ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/virtinst/guest.py b/virtinst/guest.py +index 2d0ec87..c0ce305 100644 +--- a/virtinst/guest.py ++++ b/virtinst/guest.py +@@ -875,6 +875,8 @@ class Guest(XMLBuilder): + d.bus = "xen" + return + if not self.os.is_hvm(): ++ # This likely isn't correct, but it's kind of a catch all ++ # for virt types we don't know how to handle. + d.bus = "ide" + return + +@@ -886,6 +888,8 @@ class Guest(XMLBuilder): + d.bus = "scsi" + elif self.os.is_arm(): + d.bus = "sd" ++ elif self.os.is_q35(): ++ d.bus = "sata" + else: + d.bus = "ide" + diff --git a/0014-addhardware-Don-t-advertise-IDE-for-Q35-bz-1207834.patch b/0014-addhardware-Don-t-advertise-IDE-for-Q35-bz-1207834.patch new file mode 100644 index 0000000..489eb79 --- /dev/null +++ b/0014-addhardware-Don-t-advertise-IDE-for-Q35-bz-1207834.patch @@ -0,0 +1,51 @@ +From: Cole Robinson +Date: Mon, 6 Apr 2015 13:36:54 -0400 +Subject: [PATCH virt-manager] addhardware: Don't advertise IDE for Q35 (bz + #1207834) + +Laine suggests we hide it altogether + +(cherry picked from commit feb010621b480387bd6e4d31573de9e5426cb9f3) +--- + virtManager/addhardware.py | 5 +++-- + virtinst/osxml.py | 4 ++++ + 2 files changed, 7 insertions(+), 2 deletions(-) + +diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py +index 5e8c0b3..a379438 100644 +--- a/virtManager/addhardware.py ++++ b/virtManager/addhardware.py +@@ -770,7 +770,9 @@ class vmmAddHardware(vmmGObjectUI): + model.clear() + + if self.vm.is_hvm(): +- model.append(["ide", "IDE"]) ++ if not self.vm.get_xmlobj().os.is_q35(): ++ model.append(["ide", "IDE"]) ++ model.append(["sata", "SATA"]) + model.append(["fdc", "Floppy"]) + + if not self.vm.stable_defaults(): +@@ -778,7 +780,6 @@ class vmmAddHardware(vmmGObjectUI): + model.append(["usb", "USB"]) + + if self.vm.get_hv_type() in ["qemu", "kvm", "test"]: +- model.append(["sata", "SATA"]) + model.append(["sd", "SD"]) + model.append(["virtio", "VirtIO"]) + model.append(["virtio-scsi", "VirtIO SCSI"]) +diff --git a/virtinst/osxml.py b/virtinst/osxml.py +index 78b12da..32fcf84 100644 +--- a/virtinst/osxml.py ++++ b/virtinst/osxml.py +@@ -50,6 +50,10 @@ class OSXML(XMLBuilder): + + def is_x86(self): + return self.arch == "x86_64" or self.arch == "i686" ++ def is_q35(self): ++ return (self.is_x86() and ++ self.machine and ++ "q35" in self.machine) + + def is_arm32(self): + return self.arch == "armv7l" diff --git a/virt-manager.spec b/virt-manager.spec index 9c24c8e..62e6042 100644 --- a/virt-manager.spec +++ b/virt-manager.spec @@ -28,7 +28,7 @@ Name: virt-manager Version: 1.1.0 -Release: 5.git%{gitcommit}%{_extra_release} +Release: 6.git%{gitcommit}%{_extra_release} %define verrel %{version}-%{release} Summary: Virtual Machine Manager @@ -56,6 +56,17 @@ Patch0006: 0006-virt-manager-reset-vgamem-for-video-when-changing-de.patch Patch0007: 0007-cpu-Drop-vendor-and-features-if-setting-host-model-b.patch # Drop bogus network domain name validation (bz #1195873) Patch0008: 0008-createnet-Drop-incorrect-domain-name-validation-bz-1.patch +# sshtunnels: Don't use socket API for fd passed to spice (bz #1135808) +Patch0009: 0009-sshtunnels-Don-t-use-socket-API-for-fd-passed-to-spi.patch +# Fix available install options for qemu ppc64le (bz #1209720) +Patch0010: 0010-create-Show-proper-install-options-for-ppc64le-bz-12.patch +# Catch errors fetching domcapabilities, fix ppc64le details (bz +# #1209723) +Patch0011: 0011-domcapabilities-Can-and-log-error-fetching-XML-bz-12.patch +# Improve disk defaults for qemu -M q35 (bz #1207834) +Patch0012: 0012-addhardware-Allow-SATA-CDROM-bz-1207834.patch +Patch0013: 0013-guest-Use-sata-by-default-for-q35-cdrom-non-virtio-b.patch +Patch0014: 0014-addhardware-Don-t-advertise-IDE-for-Q35-bz-1207834.patch Requires: virt-manager-common = %{verrel} @@ -139,6 +150,17 @@ machine). %patch0007 -p1 # Drop bogus network domain name validation (bz #1195873) %patch0008 -p1 +# sshtunnels: Don't use socket API for fd passed to spice (bz #1135808) +%patch0009 -p1 +# Fix available install options for qemu ppc64le (bz #1209720) +%patch0010 -p1 +# Catch errors fetching domcapabilities, fix ppc64le details (bz +# #1209723) +%patch0011 -p1 +# Improve disk defaults for qemu -M q35 (bz #1207834) +%patch0012 -p1 +%patch0013 -p1 +%patch0014 -p1 %build %if %{qemu_user} @@ -244,6 +266,12 @@ fi %changelog +* Mon Apr 13 2015 Cole Robinson - 1.1.0-6.git310f6527 +- sshtunnels: Don't use socket API for fd passed to spice (bz #1135808) +- Fix available install options for qemu ppc64le (bz #1209720) +- Catch errors fetching domcapabilities, fix ppc64le details (bz #1209723) +- Improve disk defaults for qemu -M q35 (bz #1207834) + * Fri Mar 27 2015 Cole Robinson - 1.1.0-5.git310f6527 - Fix new VM disk image names when VM name changes (bz #1169141) - Fix missing virt-install dep on pygobject (bz #1195794)