[PATCH 1/2] Add PPC support to ISO Stream feature test

This patch removes hardcoded tags from iso stream xml. Tags are related to machine type and architecture and are set in running type. Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo@linux.vnet.ibm.com> --- src/kimchi/featuretests.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/kimchi/featuretests.py b/src/kimchi/featuretests.py index 5192361..277dd56 100644 --- a/src/kimchi/featuretests.py +++ b/src/kimchi/featuretests.py @@ -20,6 +20,7 @@ import cherrypy import libvirt import lxml.etree as ET +import platform import socket import subprocess import threading @@ -37,7 +38,7 @@ ISO_STREAM_XML = """ <name>ISO_STREAMING</name> <memory unit='KiB'>1048576</memory> <os> - <type arch='x86_64' machine='pc-1.2'>hvm</type> + <type arch='%(arch)s' machine='%(machine)s'>hvm</type> <boot dev='cdrom'/> </os> <devices> @@ -100,7 +101,14 @@ class FeatureTests(object): @staticmethod def libvirt_supports_iso_stream(protocol): - xml = ISO_STREAM_XML % {'protocol': protocol} + if platform.machine().startswith('ppc'): + arch = "ppc64" + machine = "pseries" + else: + arch = "x86_64" + machine = "pc-1.2" + xml = ISO_STREAM_XML % {'protocol': protocol, 'arch': arch, + 'machine': machine} conn = None try: FeatureTests.disable_screen_error_logging() -- 1.9.3

This patch removes hardcoded tags from SIMPLE_VM_XML. Tags are related to machine type, memory and architecture. Now they are set in running type. Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo@linux.vnet.ibm.com> --- src/kimchi/kvmusertests.py | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/kimchi/kvmusertests.py b/src/kimchi/kvmusertests.py index 1757725..a3fad3b 100644 --- a/src/kimchi/kvmusertests.py +++ b/src/kimchi/kvmusertests.py @@ -16,6 +16,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +import platform import psutil import uuid @@ -29,11 +30,11 @@ from kimchi.rollbackcontext import RollbackContext class UserTests(object): SIMPLE_VM_XML = """ <domain type='kvm'> - <name>%s</name> - <uuid>%s</uuid> - <memory unit='KiB'>10240</memory> + <name>%(name)s</name> + <uuid>%(uuid)s</uuid> + <memory unit='KiB'>%(memory)s</memory> <os> - <type arch='x86_64' machine='pc'>hvm</type> + <type arch='%(arch)s' machine='%(machine)s'>hvm</type> <boot dev='hd'/> </os> </domain>""" @@ -47,7 +48,19 @@ class UserTests(object): vm_uuid = uuid.uuid1() vm_name = "kimchi_test_%s" % vm_uuid - xml = cls.SIMPLE_VM_XML % (vm_name, vm_uuid) + if platform.machine().startswith('ppc'): + arch = "ppc64" + machine = "pseries" + memory = "262144" + else: + arch = "x86_64" + machine = "pc" + memory = "10240" + + xml = cls.SIMPLE_VM_XML % {'name': vm_name, 'uuid': vm_uuid, + 'memory': memory, 'arch': arch, + 'machine': machine} + with RollbackContext() as rollback: conn = libvirt.open('qemu:///system') rollback.prependDefer(conn.close) -- 1.9.3

-- Tested-by: Paulo Vital <pvital@linux.vnet.ibm.com> Reviewed-by: Paulo Vital <pvital@linux.vnet.ibm.com> On Thu, 2014-07-03 at 14:37 -0300, Rodrigo Trujillo wrote:
This patch removes hardcoded tags from SIMPLE_VM_XML. Tags are related to machine type, memory and architecture. Now they are set in running type.
Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo@linux.vnet.ibm.com> --- src/kimchi/kvmusertests.py | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-)
diff --git a/src/kimchi/kvmusertests.py b/src/kimchi/kvmusertests.py index 1757725..a3fad3b 100644 --- a/src/kimchi/kvmusertests.py +++ b/src/kimchi/kvmusertests.py @@ -16,6 +16,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+import platform import psutil import uuid
@@ -29,11 +30,11 @@ from kimchi.rollbackcontext import RollbackContext class UserTests(object): SIMPLE_VM_XML = """ <domain type='kvm'> - <name>%s</name> - <uuid>%s</uuid> - <memory unit='KiB'>10240</memory> + <name>%(name)s</name> + <uuid>%(uuid)s</uuid> + <memory unit='KiB'>%(memory)s</memory> <os> - <type arch='x86_64' machine='pc'>hvm</type> + <type arch='%(arch)s' machine='%(machine)s'>hvm</type> <boot dev='hd'/> </os> </domain>""" @@ -47,7 +48,19 @@ class UserTests(object): vm_uuid = uuid.uuid1() vm_name = "kimchi_test_%s" % vm_uuid
- xml = cls.SIMPLE_VM_XML % (vm_name, vm_uuid) + if platform.machine().startswith('ppc'): + arch = "ppc64" + machine = "pseries" + memory = "262144" + else: + arch = "x86_64" + machine = "pc" + memory = "10240" + + xml = cls.SIMPLE_VM_XML % {'name': vm_name, 'uuid': vm_uuid, + 'memory': memory, 'arch': arch, + 'machine': machine} + with RollbackContext() as rollback: conn = libvirt.open('qemu:///system') rollback.prependDefer(conn.close)

Please, ignore this patch. I am sending a new one. On 07/03/2014 02:37 PM, Rodrigo Trujillo wrote:
This patch removes hardcoded tags from SIMPLE_VM_XML. Tags are related to machine type, memory and architecture. Now they are set in running type.
Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo@linux.vnet.ibm.com> --- src/kimchi/kvmusertests.py | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-)
diff --git a/src/kimchi/kvmusertests.py b/src/kimchi/kvmusertests.py index 1757725..a3fad3b 100644 --- a/src/kimchi/kvmusertests.py +++ b/src/kimchi/kvmusertests.py @@ -16,6 +16,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+import platform import psutil import uuid
@@ -29,11 +30,11 @@ from kimchi.rollbackcontext import RollbackContext class UserTests(object): SIMPLE_VM_XML = """ <domain type='kvm'> - <name>%s</name> - <uuid>%s</uuid> - <memory unit='KiB'>10240</memory> + <name>%(name)s</name> + <uuid>%(uuid)s</uuid> + <memory unit='KiB'>%(memory)s</memory> <os> - <type arch='x86_64' machine='pc'>hvm</type> + <type arch='%(arch)s' machine='%(machine)s'>hvm</type> <boot dev='hd'/> </os> </domain>""" @@ -47,7 +48,19 @@ class UserTests(object): vm_uuid = uuid.uuid1() vm_name = "kimchi_test_%s" % vm_uuid
- xml = cls.SIMPLE_VM_XML % (vm_name, vm_uuid) + if platform.machine().startswith('ppc'): + arch = "ppc64" + machine = "pseries" + memory = "262144" + else: + arch = "x86_64" + machine = "pc" + memory = "10240" + + xml = cls.SIMPLE_VM_XML % {'name': vm_name, 'uuid': vm_uuid, + 'memory': memory, 'arch': arch, + 'machine': machine} + with RollbackContext() as rollback: conn = libvirt.open('qemu:///system') rollback.prependDefer(conn.close)

-- Tested-by: Paulo Vital <pvital@linux.vnet.ibm.com> Reviewed-by: Paulo Vital <pvital@linux.vnet.ibm.com> On Thu, 2014-07-03 at 14:37 -0300, Rodrigo Trujillo wrote:
This patch removes hardcoded tags from iso stream xml. Tags are related to machine type and architecture and are set in running type.
Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo@linux.vnet.ibm.com> --- src/kimchi/featuretests.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/kimchi/featuretests.py b/src/kimchi/featuretests.py index 5192361..277dd56 100644 --- a/src/kimchi/featuretests.py +++ b/src/kimchi/featuretests.py @@ -20,6 +20,7 @@ import cherrypy import libvirt import lxml.etree as ET +import platform import socket import subprocess import threading @@ -37,7 +38,7 @@ ISO_STREAM_XML = """ <name>ISO_STREAMING</name> <memory unit='KiB'>1048576</memory> <os> - <type arch='x86_64' machine='pc-1.2'>hvm</type> + <type arch='%(arch)s' machine='%(machine)s'>hvm</type> <boot dev='cdrom'/> </os> <devices> @@ -100,7 +101,14 @@ class FeatureTests(object):
@staticmethod def libvirt_supports_iso_stream(protocol): - xml = ISO_STREAM_XML % {'protocol': protocol} + if platform.machine().startswith('ppc'): + arch = "ppc64" + machine = "pseries" + else: + arch = "x86_64" + machine = "pc-1.2" + xml = ISO_STREAM_XML % {'protocol': protocol, 'arch': arch, + 'machine': machine} conn = None try: FeatureTests.disable_screen_error_logging()

On 07/03/2014 02:37 PM, Rodrigo Trujillo wrote:
This patch removes hardcoded tags from iso stream xml. Tags are related to machine type and architecture and are set in running type.
Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo@linux.vnet.ibm.com> --- src/kimchi/featuretests.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/kimchi/featuretests.py b/src/kimchi/featuretests.py index 5192361..277dd56 100644 --- a/src/kimchi/featuretests.py +++ b/src/kimchi/featuretests.py @@ -20,6 +20,7 @@ import cherrypy import libvirt import lxml.etree as ET +import platform import socket import subprocess import threading @@ -37,7 +38,7 @@ ISO_STREAM_XML = """ <name>ISO_STREAMING</name> <memory unit='KiB'>1048576</memory> <os> - <type arch='x86_64' machine='pc-1.2'>hvm</type> + <type arch='%(arch)s' machine='%(machine)s'>hvm</type>
We can only use: <type>hvm</type> to make it platform independent
<boot dev='cdrom'/> </os> <devices> @@ -100,7 +101,14 @@ class FeatureTests(object):
@staticmethod def libvirt_supports_iso_stream(protocol): - xml = ISO_STREAM_XML % {'protocol': protocol} + if platform.machine().startswith('ppc'): + arch = "ppc64" + machine = "pseries" + else: + arch = "x86_64" + machine = "pc-1.2" + xml = ISO_STREAM_XML % {'protocol': protocol, 'arch': arch, + 'machine': machine} conn = None try: FeatureTests.disable_screen_error_logging()

On 07/07/2014 11:24 AM, Aline Manera wrote:
On 07/03/2014 02:37 PM, Rodrigo Trujillo wrote:
This patch removes hardcoded tags from iso stream xml. Tags are related to machine type and architecture and are set in running type.
Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo@linux.vnet.ibm.com> --- src/kimchi/featuretests.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/kimchi/featuretests.py b/src/kimchi/featuretests.py index 5192361..277dd56 100644 --- a/src/kimchi/featuretests.py +++ b/src/kimchi/featuretests.py @@ -20,6 +20,7 @@ import cherrypy import libvirt import lxml.etree as ET +import platform import socket import subprocess import threading @@ -37,7 +38,7 @@ ISO_STREAM_XML = """ <name>ISO_STREAMING</name> <memory unit='KiB'>1048576</memory> <os> - <type arch='x86_64' machine='pc-1.2'>hvm</type> + <type arch='%(arch)s' machine='%(machine)s'>hvm</type>
We can only use:
<type>hvm</type>
to make it platform independent
ACK... waiting to test in a PPC machine... then will send a new patch version
<boot dev='cdrom'/> </os> <devices> @@ -100,7 +101,14 @@ class FeatureTests(object):
@staticmethod def libvirt_supports_iso_stream(protocol): - xml = ISO_STREAM_XML % {'protocol': protocol} + if platform.machine().startswith('ppc'): + arch = "ppc64" + machine = "pseries" + else: + arch = "x86_64" + machine = "pc-1.2" + xml = ISO_STREAM_XML % {'protocol': protocol, 'arch': arch, + 'machine': machine} conn = None try: FeatureTests.disable_screen_error_logging()

Please, ignore this patch. I am sending a new one On 07/03/2014 02:37 PM, Rodrigo Trujillo wrote:
This patch removes hardcoded tags from iso stream xml. Tags are related to machine type and architecture and are set in running type.
Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo@linux.vnet.ibm.com> --- src/kimchi/featuretests.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/kimchi/featuretests.py b/src/kimchi/featuretests.py index 5192361..277dd56 100644 --- a/src/kimchi/featuretests.py +++ b/src/kimchi/featuretests.py @@ -20,6 +20,7 @@ import cherrypy import libvirt import lxml.etree as ET +import platform import socket import subprocess import threading @@ -37,7 +38,7 @@ ISO_STREAM_XML = """ <name>ISO_STREAMING</name> <memory unit='KiB'>1048576</memory> <os> - <type arch='x86_64' machine='pc-1.2'>hvm</type> + <type arch='%(arch)s' machine='%(machine)s'>hvm</type> <boot dev='cdrom'/> </os> <devices> @@ -100,7 +101,14 @@ class FeatureTests(object):
@staticmethod def libvirt_supports_iso_stream(protocol): - xml = ISO_STREAM_XML % {'protocol': protocol} + if platform.machine().startswith('ppc'): + arch = "ppc64" + machine = "pseries" + else: + arch = "x86_64" + machine = "pc-1.2" + xml = ISO_STREAM_XML % {'protocol': protocol, 'arch': arch, + 'machine': machine} conn = None try: FeatureTests.disable_screen_error_logging()
participants (3)
-
Aline Manera
-
Paulo Ricardo Paz Vital
-
Rodrigo Trujillo