Hello Vitor de Lima, Francesco Romani,

I'd like you to do a code review.  Please visit

    https://gerrit.ovirt.org/46265

to review the following change.

Change subject: virt: Remove QEMU passthrough hack in ppc64
......................................................................

virt: Remove QEMU passthrough hack in ppc64

Ever since 3.5 a virtual USB keyboard and mouse is included
in ppc64 guests with graphical consoles. This patch does not insert
any information about input devices in the domain XML in order to
libvirt handle the creation of these devices automatically.

Change-Id: I64d660bf7534203d5d5cdbc318ffd1429a16f954
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1122627
Signed-off-by: Vitor de Lima <[email protected]>
Reviewed-on: https://gerrit.ovirt.org/33871
Tested-by: Martin Polednik <[email protected]>
Reviewed-by: Francesco Romani <[email protected]>
Continuous-Integration: Jenkins CI
---
M tests/vmTestsData.py
M vdsm/virt/vm.py
M vdsm/virt/vmxml.py
3 files changed, 4 insertions(+), 37 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/65/46265/1

diff --git a/tests/vmTestsData.py b/tests/vmTestsData.py
index e1f53f3..a7b610e 100644
--- a/tests/vmTestsData.py
+++ b/tests/vmTestsData.py
@@ -101,8 +101,7 @@
 
     """<?xml version="1.0" encoding="utf-8"?>
         <domain type="kvm"
-        xmlns:ovirt="http://ovirt.org/vm/tune/1.0";
-        xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0";>
+        xmlns:ovirt="http://ovirt.org/vm/tune/1.0";>
             <name>testVm</name>
             <uuid>%(vmId)s</uuid>
             <memory>1048576</memory>
@@ -137,10 +136,6 @@
                     <topology cores="1" sockets="160" threads="1"/>
                     <numa/>
                 </cpu>
-                <qemu:commandline>
-                    <qemu:arg value="-usbdevice"/>
-                    <qemu:arg value="keyboard"/>
-                </qemu:commandline>
             </domain>
 """, )]
 
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 7b6dcfb..6e456b4 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -1626,9 +1626,6 @@
             for leaseElement in drive.getLeasesXML():
                 domxml._devices.appendChild(leaseElement)
 
-        if self.arch == caps.Architecture.PPC64:
-            domxml.appendKeyboardDevice()
-
         return domxml.toxml()
 
     def _cleanup(self):
diff --git a/vdsm/virt/vmxml.py b/vdsm/virt/vmxml.py
index 60e3357..4e27b48 100644
--- a/vdsm/virt/vmxml.py
+++ b/vdsm/virt/vmxml.py
@@ -159,14 +159,6 @@
 
         domainAttrs = {'type': domainType}
 
-        # Hack around libvirt issue BZ#988070, this is going to be removed as
-        # soon as the domain XML format supports the specification of USB
-        # keyboards
-
-        if self.arch == caps.Architecture.PPC64:
-            domainAttrs['xmlns:qemu'] = \
-                'http://libvirt.org/schemas/domain/qemu/1.0'
-
         self.dom = Element('domain', **domainAttrs)
         self.doc.appendChild(self.dom)
 
@@ -474,29 +466,12 @@
         """
         if utils.tobool(self.conf.get('tabletEnable')):
             inputAttrs = {'type': 'tablet', 'bus': 'usb'}
+        elif self.arch == caps.Architecture.X86_64:
+            inputAttrs = {'type': 'mouse', 'bus': 'ps2'}
         else:
-            if self.arch == caps.Architecture.PPC64:
-                mouseBus = 'usb'
-            else:
-                mouseBus = 'ps2'
+            inputAttrs = {'type': 'mouse', 'bus': 'usb'}
 
-            inputAttrs = {'type': 'mouse', 'bus': mouseBus}
         self._devices.appendChildWithArgs('input', **inputAttrs)
-
-    def appendKeyboardDevice(self):
-        """
-        Add keyboard device for ppc64 using a QEMU argument directly.
-        This is a workaround to the issue BZ#988070 in libvirt
-
-            <qemu:commandline>
-                <qemu:arg value='-usbdevice'/>
-                <qemu:arg value='keyboard'/>
-            </qemu:commandline>
-        """
-        commandLine = Element('qemu:commandline')
-        commandLine.appendChildWithArgs('qemu:arg', value='-usbdevice')
-        commandLine.appendChildWithArgs('qemu:arg', value='keyboard')
-        self.dom.appendChild(commandLine)
 
     def appendEmulator(self):
         emulatorPath = '/usr/bin/qemu-system-' + self.arch


-- 
To view, visit https://gerrit.ovirt.org/46265
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I64d660bf7534203d5d5cdbc318ffd1429a16f954
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.6
Gerrit-Owner: Martin Polednik <[email protected]>
Gerrit-Reviewer: Francesco Romani <[email protected]>
Gerrit-Reviewer: Vitor de Lima <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to