[libvirt] [PATCH 0/2] PowerPC : Miscellaneous fixes for 'ppc64le' architecture.

From a28ef5a3e7b9cb023948cf97d9f472bb3a1e06d3 Mon Sep 17 00:00:00 2001 From: Prerna Saxena <prerna@linux.vnet.ibm.com> Date: Thu, 26 Feb 2015 22:31:05 +0530
This series adds few miscellaneous fixes for PowerPC 64-bit Little Endian Architecture. Changelog : ========== v1 of Patch 1/2 already posted and acked : https://www.redhat.com/archives/libvir-list/2015-February/msg00486.html Patch 2/2 adds a testcase to supplement patch 1. Prerna Saxena (2): PowerPC: Augment XML schema to include 'ppc64le' arch and newer pseries-2.* machine types. Tests : Add test for 'ppc64le' architecture. docs/schemas/basictypes.rng | 1 + docs/schemas/domaincommon.rng | 7 ++++- .../qemuxml2argv-pseries-cpu-le.args | 7 +++++ .../qemuxml2argv-pseries-cpu-le.xml | 17 ++++++++++++ tests/qemuxml2argvtest.c | 2 ++ tests/testutilsqemu.c | 30 ++++++++++++++++++++++ 6 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-le.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-le.xml -- 1.9.3 -- Prerna Saxena Linux Technology Centre, IBM Systems and Technology Lab, Bangalore, India

From 7128e773058751e4d1024ef7d8e4ad286c93ba55 Mon Sep 17 00:00:00 2001 From: Prerna Saxena <prerna@linux.vnet.ibm.com> Date: Thu, 26 Feb 2015 08:10:58 -0600 Subject: [PATCH 1/2] PowerPC: Augment XML schema to include 'ppc64le' arch and newer pseries-2.* machine types.
Acked-by: Ján Tomko <jtomko@redhat.com> Signed-off-by: Prerna Saxena <prerna@linux.vnet.ibm.com> --- docs/schemas/basictypes.rng | 1 + docs/schemas/domaincommon.rng | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/schemas/basictypes.rng b/docs/schemas/basictypes.rng index 2bc9c1b..3e1841c 100644 --- a/docs/schemas/basictypes.rng +++ b/docs/schemas/basictypes.rng @@ -333,6 +333,7 @@ <value>parisc64</value> <value>ppc</value> <value>ppc64</value> + <value>ppc64le</value> <value>ppcemb</value> <value>s390</value> <value>s390x</value> diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 27a24b4..8613125 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -412,13 +412,18 @@ <group> <optional> <attribute name="arch"> - <value>ppc64</value> + <choice> + <value>ppc64</value> + <value>ppc64le</value> + </choice> </attribute> </optional> <optional> <attribute name="machine"> <choice> <value>pseries</value> + <value>pseries-2.1</value> + <value>pseries-2.2</value> </choice> </attribute> </optional> -- 1.9.3 -- Prerna Saxena Linux Technology Centre, IBM Systems and Technology Lab, Bangalore, India

Tests : Add test for 'ppc64le' architecture. Signed-off-by: Prerna Saxena <prerna@linux.vnet.ibm.com> --- .../qemuxml2argv-pseries-cpu-le.args | 7 +++++ .../qemuxml2argv-pseries-cpu-le.xml | 17 ++++++++++++ tests/qemuxml2argvtest.c | 2 ++ tests/testutilsqemu.c | 30 ++++++++++++++++++++++ 4 files changed, 56 insertions(+) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-le.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-le.xml diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-le.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-le.args new file mode 100644 index 0000000..f4f8d5e --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-le.args @@ -0,0 +1,7 @@ +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test \ +QEMU_AUDIO_DRV=none /usr/bin/qemu-system-ppc64 -S -M pseries \ +-m 512 -smp 1 -nographic -nodefconfig -nodefaults \ +-chardev socket,id=charmonitor,path=/tmp/test-monitor,server,nowait \ +-mon chardev=charmonitor,id=monitor,mode=readline -no-acpi -boot c -usb \ +-chardev pty,id=charserial0 \ +-device spapr-vty,chardev=charserial0,reg=0x30000000 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-le.xml b/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-le.xml new file mode 100644 index 0000000..b791a73 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-le.xml @@ -0,0 +1,17 @@ +<domain type='kvm'> + <name>QEMUGuest1</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <memory unit='KiB'>524288</memory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='ppc64le' machine='pseries'>hvm</type> + </os> + <clock offset='utc'/> + <devices> + <emulator>/usr/bin/qemu-system-ppc64</emulator> + <console type='pty'> + <address type="spapr-vio"/> + </console> + <memballoon model="none"/> + </devices> +</domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 39ed66b..982019e 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1341,6 +1341,8 @@ mymain(void) QEMU_CAPS_NODEFCONFIG); DO_TEST("pseries-cpu-compat", QEMU_CAPS_KVM, QEMU_CAPS_CPU_HOST, QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG); + DO_TEST("pseries-cpu-le", QEMU_CAPS_KVM, QEMU_CAPS_CPU_HOST, + QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG); DO_TEST("disk-ide-drive-split", QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_IDE_CD); diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index 7b26e50..1fd7c96 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -86,6 +86,33 @@ static int testQemuAddPPC64Guest(virCapsPtr caps) return -1; } +static int testQemuAddPPC64LEGuest(virCapsPtr caps) +{ + static const char *machine[] = { "pseries" }; + virCapsGuestMachinePtr *machines = NULL; + virCapsGuestPtr guest; + + machines = virCapabilitiesAllocMachines(machine, 1); + if (!machines) + goto error; + + guest = virCapabilitiesAddGuest(caps, "hvm", VIR_ARCH_PPC64LE, + "/usr/bin/qemu-system-ppc64", NULL, + 1, machines); + if (!guest) + goto error; + + if (!virCapabilitiesAddGuestDomain(guest, "qemu", NULL, NULL, 0, NULL)) + goto error; + + return 0; + + error: + /* No way to free a guest? */ + virCapabilitiesFreeMachines(machines, 1); + return -1; +} + static int testQemuAddPPCGuest(virCapsPtr caps) { static const char *machine[] = { "g3beige", @@ -332,6 +359,9 @@ virCapsPtr testQemuCapsInit(void) if (testQemuAddPPC64Guest(caps)) goto cleanup; + if (testQemuAddPPC64LEGuest(caps)) + goto cleanup; + if (testQemuAddPPCGuest(caps)) goto cleanup; -- 1.9.3 -- Prerna Saxena Linux Technology Centre, IBM Systems and Technology Lab, Bangalore, India

On Thu, Feb 26, 2015 at 10:45:54PM +0530, Prerna Saxena wrote:
Tests : Add test for 'ppc64le' architecture.
Signed-off-by: Prerna Saxena <prerna@linux.vnet.ibm.com> --- .../qemuxml2argv-pseries-cpu-le.args | 7 +++++ .../qemuxml2argv-pseries-cpu-le.xml | 17 ++++++++++++ tests/qemuxml2argvtest.c | 2 ++ tests/testutilsqemu.c | 30 ++++++++++++++++++++++ 4 files changed, 56 insertions(+) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-le.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-le.xml
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-le.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-le.args new file mode 100644 index 0000000..f4f8d5e --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-le.args @@ -0,0 +1,7 @@ +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test \ +QEMU_AUDIO_DRV=none /usr/bin/qemu-system-ppc64 -S -M pseries \ +-m 512 -smp 1 -nographic -nodefconfig -nodefaults \ +-chardev socket,id=charmonitor,path=/tmp/test-monitor,server,nowait \ +-mon chardev=charmonitor,id=monitor,mode=readline -no-acpi -boot c -usb \ +-chardev pty,id=charserial0 \ +-device spapr-vty,chardev=charserial0,reg=0x30000000
I don't see any reference to little endian on the command line. If the domain can only use the same endianness as the host system, do we need to check if the guest arch matches the host arch somewhere? Jan

On Wednesday 04 March 2015 09:28 PM, Ján Tomko wrote:
On Thu, Feb 26, 2015 at 10:45:54PM +0530, Prerna Saxena wrote:
Tests : Add test for 'ppc64le' architecture.
Signed-off-by: Prerna Saxena <prerna@linux.vnet.ibm.com> --- .../qemuxml2argv-pseries-cpu-le.args | 7 +++++ .../qemuxml2argv-pseries-cpu-le.xml | 17 ++++++++++++ tests/qemuxml2argvtest.c | 2 ++ tests/testutilsqemu.c | 30 ++++++++++++++++++++++ 4 files changed, 56 insertions(+) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-le.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-le.xml
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-le.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-le.args new file mode 100644 index 0000000..f4f8d5e --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-le.args @@ -0,0 +1,7 @@ +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test \ +QEMU_AUDIO_DRV=none /usr/bin/qemu-system-ppc64 -S -M pseries \ +-m 512 -smp 1 -nographic -nodefconfig -nodefaults \ +-chardev socket,id=charmonitor,path=/tmp/test-monitor,server,nowait \ +-mon chardev=charmonitor,id=monitor,mode=readline -no-acpi -boot c -usb \ +-chardev pty,id=charserial0 \ +-device spapr-vty,chardev=charserial0,reg=0x30000000 I don't see any reference to little endian on the command line.
If the domain can only use the same endianness as the host system, do we need to check if the guest arch matches the host arch somewhere?
Yes, SLOF in qemu-system-ppc64 can correctly initialize KVM based on the endianness discovered for the guest, so the command line stays the same for both ppc64 & ppc64le guests. However, we need libvirt to recognize ppc64le as a valid arch, since this is used by management utilities that depend on libvirt -- a classic example being virt-install. Regards, -- Prerna Saxena Linux Technology Centre, IBM Systems and Technology Lab, Bangalore, India

Ping !` Can you pls let me know if this suffices ? Regards, Prerna -------- Forwarded Message -------- Subject: [libvirt] [PATCH 0/2] PowerPC : Miscellaneous fixes for 'ppc64le' architecture. Date: Thu, 26 Feb 2015 22:39:20 +0530 From: Prerna Saxena <prerna@linux.vnet.ibm.com> To: libvirt mailing list <libvir-list@redhat.com> CC: Ján Tomko <jtomko@redhat.com>
From a28ef5a3e7b9cb023948cf97d9f472bb3a1e06d3 Mon Sep 17 00:00:00 2001 From: Prerna Saxena <prerna@linux.vnet.ibm.com> Date: Thu, 26 Feb 2015 22:31:05 +0530
This series adds few miscellaneous fixes for PowerPC 64-bit Little Endian Architecture. Changelog : ========== v1 of Patch 1/2 already posted and acked : https://www.redhat.com/archives/libvir-list/2015-February/msg00486.html Patch 2/2 adds a testcase to supplement patch 1. Prerna Saxena (2): PowerPC: Augment XML schema to include 'ppc64le' arch and newer pseries-2.* machine types. Tests : Add test for 'ppc64le' architecture. docs/schemas/basictypes.rng | 1 + docs/schemas/domaincommon.rng | 7 ++++- .../qemuxml2argv-pseries-cpu-le.args | 7 +++++ .../qemuxml2argv-pseries-cpu-le.xml | 17 ++++++++++++ tests/qemuxml2argvtest.c | 2 ++ tests/testutilsqemu.c | 30 ++++++++++++++++++++++ 6 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-le.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-le.xml -- 1.9.3 -- Prerna Saxena Linux Technology Centre, IBM Systems and Technology Lab, Bangalore, India -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

On 26.02.2015 18:09, Prerna Saxena wrote:
From a28ef5a3e7b9cb023948cf97d9f472bb3a1e06d3 Mon Sep 17 00:00:00 2001 From: Prerna Saxena <prerna@linux.vnet.ibm.com> Date: Thu, 26 Feb 2015 22:31:05 +0530
This series adds few miscellaneous fixes for PowerPC 64-bit Little Endian Architecture.
Changelog : ========== v1 of Patch 1/2 already posted and acked : https://www.redhat.com/archives/libvir-list/2015-February/msg00486.html Patch 2/2 adds a testcase to supplement patch 1.
Prerna Saxena (2): PowerPC: Augment XML schema to include 'ppc64le' arch and newer pseries-2.* machine types. Tests : Add test for 'ppc64le' architecture.
docs/schemas/basictypes.rng | 1 + docs/schemas/domaincommon.rng | 7 ++++- .../qemuxml2argv-pseries-cpu-le.args | 7 +++++ .../qemuxml2argv-pseries-cpu-le.xml | 17 ++++++++++++ tests/qemuxml2argvtest.c | 2 ++ tests/testutilsqemu.c | 30 ++++++++++++++++++++++ 6 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-le.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-le.xml
I've tweaked the commit messages a bit, ACKed and pushed. Michal

On Tuesday 03 March 2015 03:29 PM, Michal Privoznik wrote:
On 26.02.2015 18:09, Prerna Saxena wrote:
From a28ef5a3e7b9cb023948cf97d9f472bb3a1e06d3 Mon Sep 17 00:00:00 2001 From: Prerna Saxena <prerna@linux.vnet.ibm.com> Date: Thu, 26 Feb 2015 22:31:05 +0530
This series adds few miscellaneous fixes for PowerPC 64-bit Little Endian Architecture.
Changelog : ========== v1 of Patch 1/2 already posted and acked : https://www.redhat.com/archives/libvir-list/2015-February/msg00486.html Patch 2/2 adds a testcase to supplement patch 1.
Prerna Saxena (2): PowerPC: Augment XML schema to include 'ppc64le' arch and newer pseries-2.* machine types. Tests : Add test for 'ppc64le' architecture.
docs/schemas/basictypes.rng | 1 + docs/schemas/domaincommon.rng | 7 ++++- .../qemuxml2argv-pseries-cpu-le.args | 7 +++++ .../qemuxml2argv-pseries-cpu-le.xml | 17 ++++++++++++ tests/qemuxml2argvtest.c | 2 ++ tests/testutilsqemu.c | 30 ++++++++++++++++++++++ 6 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-le.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-le.xml
I've tweaked the commit messages a bit, ACKed and pushed.
Michal
Thank you :-) -- Prerna Saxena Linux Technology Centre, IBM Systems and Technology Lab, Bangalore, India
participants (3)
-
Ján Tomko
-
Michal Privoznik
-
Prerna Saxena