[libvirt] [PATCH 0/6] BUG fix for PowerPC.

From: Li Zhang <zhlcindy@linux.vnet.ibm.com> This patch series is to fix bugs on PowerPC we found when testing libvirt. Li Zhang (6): Set std VGA model as default model for ppc64. Use -machine option for PPC64 Remove QEMU_CAPS_NO_ACPI capability for non-x86 platform Support all backend serial devices for pSeries guest Set the default machine as pseries for PPC64 Use help string "-device driver," when getting additional caps. src/conf/capabilities.c | 6 ++++ src/conf/domain_conf.c | 2 ++ src/qemu/qemu_capabilities.c | 12 ++++++-- src/qemu/qemu_command.c | 31 +++++++++++--------- .../qemuxml2argv-machine-core-off.args | 2 +- .../qemuxml2argv-machine-core-on.args | 2 +- .../qemuxml2argv-pseries-basic.args | 2 +- .../qemuxml2argv-pseries-vio-user-assigned.args | 2 +- .../qemuxml2argvdata/qemuxml2argv-pseries-vio.args | 2 +- 9 files changed, 39 insertions(+), 22 deletions(-) -- 1.7.10.1

From: Li Zhang <zhlcindy@linux.vnet.ibm.com> Cirrus VGA model is not supported on ppc64 currently. It needs to set std VGA model as the default model. Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> --- src/conf/domain_conf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index ccb3b63..b02bc66 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -7284,6 +7284,8 @@ virDomainVideoDefaultType(virDomainDefPtr def) (STREQ(def->os.type, "xen") || STREQ(def->os.type, "linux"))) return VIR_DOMAIN_VIDEO_TYPE_XEN; + else if (def->os.arch == VIR_ARCH_PPC64) + return VIR_DOMAIN_VIDEO_TYPE_VGA; else return VIR_DOMAIN_VIDEO_TYPE_CIRRUS; -- 1.7.10.1

On Thu, Dec 20, 2012 at 02:02:22PM +0800, Li Zhang wrote:
From: Li Zhang <zhlcindy@linux.vnet.ibm.com>
Cirrus VGA model is not supported on ppc64 currently. It needs to set std VGA model as the default model.
Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> --- src/conf/domain_conf.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index ccb3b63..b02bc66 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -7284,6 +7284,8 @@ virDomainVideoDefaultType(virDomainDefPtr def) (STREQ(def->os.type, "xen") || STREQ(def->os.type, "linux"))) return VIR_DOMAIN_VIDEO_TYPE_XEN; + else if (def->os.arch == VIR_ARCH_PPC64) + return VIR_DOMAIN_VIDEO_TYPE_VGA; else return VIR_DOMAIN_VIDEO_TYPE_CIRRUS;
ACK Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

From: Li Zhang <zhlcindy@linux.vnet.ibm.com> On PPC64 platform, it sets USB option in -machine option. It is set as the following: -machine pseries,usb=off This will disable USB, which avoids creating one USB controller implicitly in the platform's initialization. Libvirt will add one USB controller if there is no definition in XML file. Users also can add one specific USB controller in the XML file as the following: <controller type='usb' index='0' model='pci-ohci'> </controller> Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> --- src/qemu/qemu_command.c | 29 ++++++++++++-------- .../qemuxml2argv-machine-core-off.args | 2 +- .../qemuxml2argv-machine-core-on.args | 2 +- .../qemuxml2argv-pseries-basic.args | 2 +- .../qemuxml2argv-pseries-vio-user-assigned.args | 2 +- .../qemuxml2argvdata/qemuxml2argv-pseries-vio.args | 2 +- 6 files changed, 22 insertions(+), 17 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index ef16d27..6a90ed5 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4535,6 +4535,8 @@ qemuBuildMachineArgStr(virCommandPtr cmd, const virDomainDefPtr def, qemuCapsPtr caps) { + + virBuffer buf = VIR_BUFFER_INITIALIZER; /* This should *never* be NULL, since we always provide * a machine in the capabilities data for QEMU. So this * check is just here as a safety in case the unexpected @@ -4542,27 +4544,30 @@ qemuBuildMachineArgStr(virCommandPtr cmd, if (!def->os.machine) return 0; - if (!def->mem.dump_core) { + if (!def->mem.dump_core && def->os.arch != VIR_ARCH_PPC64) { /* if no parameter to the machine type is needed, we still use * '-M' to keep the most of the compatibility with older versions. */ virCommandAddArgList(cmd, "-M", def->os.machine, NULL); } else { - if (!qemuCapsGet(caps, QEMU_CAPS_DUMP_GUEST_CORE)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - "%s", _("dump-guest-core is not available " - " with this QEMU binary")); - return -1; - } - /* However, in case there is a parameter to be added, we need to * use the "-machine" parameter because qemu is not parsing the * "-M" correctly */ virCommandAddArg(cmd, "-machine"); - virCommandAddArgFormat(cmd, - "%s,dump-guest-core=%s", - def->os.machine, - virDomainMemDumpTypeToString(def->mem.dump_core)); + virBufferAsprintf(&buf, "%s,usb=off", def->os.machine); + + if (def->mem.dump_core) { + if (!qemuCapsGet(caps, QEMU_CAPS_DUMP_GUEST_CORE)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + "%s", _("dump-guest-core is not available " + " with this QEMU binary")); + return -1; + } + + virBufferAsprintf(&buf, ",dump-guest-core=%s", + virDomainMemDumpTypeToString(def->mem.dump_core)); + } + virCommandAddArg(cmd, virBufferContentAndReset(&buf)); } return 0; diff --git a/tests/qemuxml2argvdata/qemuxml2argv-machine-core-off.args b/tests/qemuxml2argvdata/qemuxml2argv-machine-core-off.args index 57c1aa3..d5b3614 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-machine-core-off.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-machine-core-off.args @@ -1,5 +1,5 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu \ --S -machine pc,dump-guest-core=off -m 214 -smp 1 -nographic \ +-S -machine pc,usb=off,dump-guest-core=off -m 214 -smp 1 -nographic \ -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb \ -hda /dev/HostVG/QEMUGuest1 -net none -serial \ none -parallel none diff --git a/tests/qemuxml2argvdata/qemuxml2argv-machine-core-on.args b/tests/qemuxml2argvdata/qemuxml2argv-machine-core-on.args index 4e57b21..f7e3ed0 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-machine-core-on.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-machine-core-on.args @@ -1,5 +1,5 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu \ --S -machine pc,dump-guest-core=on -m 214 -smp 1 -nographic \ +-S -machine pc,usb=off,dump-guest-core=on -m 214 -smp 1 -nographic \ -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb \ -hda /dev/HostVG/QEMUGuest1 -net none -serial \ none -parallel none diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-basic.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-basic.args index 745910b..f3bc7e9 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-basic.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-basic.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /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 +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu-system-ppc64 -S -machine pseries,usb=off -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-vio-user-assigned.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio-user-assigned.args index 16a4f10..c997a0a 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio-user-assigned.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio-user-assigned.args @@ -1,5 +1,5 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu-system-ppc64 \ --S -M pseries -m 512 -smp 1 -nographic -nodefconfig -nodefaults \ +-S -machine pseries,usb=off -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 \ -device spapr-vscsi,id=scsi0,reg=0x2000 \ diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio.args index 9bbc662..75b8696 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio.args @@ -1,5 +1,5 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu-system-ppc64 \ --S -M pseries -m 512 -smp 1 -nographic -nodefconfig -nodefaults \ +-S -machine pseries,usb=off -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 \ -device spapr-vscsi,id=scsi0,reg=0x2000 \ -- 1.7.10.1

On Thu, Dec 20, 2012 at 02:02:23PM +0800, Li Zhang wrote:
From: Li Zhang <zhlcindy@linux.vnet.ibm.com>
On PPC64 platform, it sets USB option in -machine option. It is set as the following: -machine pseries,usb=off
This will disable USB, which avoids creating one USB controller implicitly in the platform's initialization. Libvirt will add one USB controller if there is no definition in XML file. Users also can add one specific USB controller in the XML file as the following:
<controller type='usb' index='0' model='pci-ohci'> </controller>
NACK, current behaviour matches libvirt on x86, where we also add a USB controller by default. The mechanism for disabling the default USB controlle ris to use <controller type='usb' index='0' model='none'> PPC should follow this same behaviour Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On Thu, Dec 20, 2012 at 6:28 PM, Daniel P. Berrange <berrange@redhat.com>wrote:
On Thu, Dec 20, 2012 at 02:02:23PM +0800, Li Zhang wrote:
From: Li Zhang <zhlcindy@linux.vnet.ibm.com>
On PPC64 platform, it sets USB option in -machine option. It is set as the following: -machine pseries,usb=off
This will disable USB, which avoids creating one USB controller implicitly in the platform's initialization. Libvirt will add one USB controller if there is no definition in XML file. Users also can add one specific USB controller in the XML file as the following:
<controller type='usb' index='0' model='pci-ohci'> </controller>
NACK, current behaviour matches libvirt on x86, where we also add a USB controller by default.
Yes, I saw the code in Libvirt which adds a USB controller by default. My problem is that: In QEMU for pseries, default VGA is enabled, one USB controller is created and USB keyboard and mouse are created. If libvirt also creates USB controller with -device xxxx, it will produce the error: qemu-system-ppc64: -device pci-ohci,id=usb,bus=pci,addr=0x1.0x2: PCI: single function device can't be populated in function 1.2 qemu-system-ppc64: -device pci-ohci,id=usb,bus=pci,addr=0x1.0x2: Device 'pci-ohci' could not be initialized 2012-12-20 15:16:54.985+0000: shutting down To avoid the conflict, we need to use -machine name,usb=off to disable USB option. My patch doesn't create the default USB controller, it only help disable USB option. Thanks. :)
The mechanism for disabling the default USB controlle ris to use
<controller type='usb' index='0' model='none'>
PPC should follow this same behaviour
Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/:| |: http://libvirt.org -o- http://virt-manager.org:| |: http://autobuild.org -o- http://search.cpan.org/~danberr/:| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc:|
-- Best Regards -Li

On Fri, Dec 21, 2012 at 10:21 AM, Li Zhang <zhlcindy@gmail.com> wrote:
On Thu, Dec 20, 2012 at 6:28 PM, Daniel P. Berrange <berrange@redhat.com>wrote:
On Thu, Dec 20, 2012 at 02:02:23PM +0800, Li Zhang wrote:
From: Li Zhang <zhlcindy@linux.vnet.ibm.com>
On PPC64 platform, it sets USB option in -machine option. It is set as the following: -machine pseries,usb=off
This will disable USB, which avoids creating one USB controller implicitly in the platform's initialization. Libvirt will add one USB controller if there is no definition in XML file. Users also can add one specific USB controller in the XML file as the following:
<controller type='usb' index='0' model='pci-ohci'> </controller>
NACK, current behaviour matches libvirt on x86, where we also add a USB controller by default.
Yes, I saw the code in Libvirt which adds a USB controller by default.
My problem is that: In QEMU for pseries, default VGA is enabled, one USB controller is created and USB keyboard and mouse are created. If libvirt also creates USB controller with -device xxxx, it will produce the error:
qemu-system-ppc64: -device pci-ohci,id=usb,bus=pci,addr=0x1.0x2: PCI: single function device can't be populated in function 1.2 qemu-system-ppc64: -device pci-ohci,id=usb,bus=pci,addr=0x1.0x2: Device 'pci-ohci' could not be initialized 2012-12-20 15:16:54.985+0000: shutting down
To avoid the conflict, we need to use -machine name,usb=off to disable USB option. My patch doesn't create the default USB controller, it only help disable USB option.
Hi Daniel, I think this is one bug for USB option. USB option in machine options can't be used with -device xxxx at the same time Actually, some platforms would like to enable USB option by default. So we need to pass usb=off, then use -device xxx to create a USB controller in libvirt. We discussed this problem in QEMU mailing list before. Here is the link, http://lists.nongnu.org/archive/html/qemu-devel/2012-06/msg01008.html Any idea? Thanks. :)
Thanks. :)
The mechanism for disabling the default USB controlle ris to use
<controller type='usb' index='0' model='none'>
PPC should follow this same behaviour
Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
--
Best Regards -Li
-- Best Regards -Li

From: Li Zhang <zhlcindy@linux.vnet.ibm.com> ACPI is only supported on x86 platform, PPC can't support it. So QEMU_CAPS_NO_ACPI shouldn't be set. This patch is to remove QEMU_CAPS_NO_ACPI capability for non-x86 platform. Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> --- src/qemu/qemu_capabilities.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 50d999a..a6ac169 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2260,7 +2260,13 @@ qemuCapsInitQMPBasic(qemuCapsPtr caps) qemuCapsSet(caps, QEMU_CAPS_DRIVE_CACHE_DIRECTSYNC); qemuCapsSet(caps, QEMU_CAPS_NO_SHUTDOWN); qemuCapsSet(caps, QEMU_CAPS_DRIVE_CACHE_UNSAFE); - qemuCapsSet(caps, QEMU_CAPS_NO_ACPI); + + /* ACPI is only supported on x86, PPC or + * other platforms don't support it*/ + if (caps->arch == VIR_ARCH_I686 || + caps->arch == VIR_ARCH_X86_64) + qemuCapsSet(caps, QEMU_CAPS_NO_ACPI); + qemuCapsSet(caps, QEMU_CAPS_FSDEV_READONLY); qemuCapsSet(caps, QEMU_CAPS_VIRTIO_BLK_SG_IO); qemuCapsSet(caps, QEMU_CAPS_DRIVE_COPY_ON_READ); -- 1.7.10.1

On Thu, Dec 20, 2012 at 02:02:24PM +0800, Li Zhang wrote:
From: Li Zhang <zhlcindy@linux.vnet.ibm.com>
ACPI is only supported on x86 platform, PPC can't support it. So QEMU_CAPS_NO_ACPI shouldn't be set.
This patch is to remove QEMU_CAPS_NO_ACPI capability for non-x86 platform.
Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> --- src/qemu/qemu_capabilities.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 50d999a..a6ac169 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2260,7 +2260,13 @@ qemuCapsInitQMPBasic(qemuCapsPtr caps) qemuCapsSet(caps, QEMU_CAPS_DRIVE_CACHE_DIRECTSYNC); qemuCapsSet(caps, QEMU_CAPS_NO_SHUTDOWN); qemuCapsSet(caps, QEMU_CAPS_DRIVE_CACHE_UNSAFE); - qemuCapsSet(caps, QEMU_CAPS_NO_ACPI); + + /* ACPI is only supported on x86, PPC or + * other platforms don't support it*/ + if (caps->arch == VIR_ARCH_I686 || + caps->arch == VIR_ARCH_X86_64) + qemuCapsSet(caps, QEMU_CAPS_NO_ACPI); + qemuCapsSet(caps, QEMU_CAPS_FSDEV_READONLY); qemuCapsSet(caps, QEMU_CAPS_VIRTIO_BLK_SG_IO); qemuCapsSet(caps, QEMU_CAPS_DRIVE_COPY_ON_READ);
ACK Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

From: Li Zhang <zhlcindy@linux.vnet.ibm.com> Currently, it only considers PTY backend serial devices for pseries. It need to support all kinds of serial devices. This patch is to fix the problem which is that it doesn't work when specifying source type as file. Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> --- src/qemu/qemu_command.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 6a90ed5..f769dc6 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -923,7 +923,6 @@ int qemuDomainAssignSpaprVIOAddresses(virDomainDefPtr def, for (i = 0 ; i < def->nserials; i++) { if (def->serials[i]->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL && - def->serials[i]->source.type == VIR_DOMAIN_CHR_TYPE_PTY && (def->os.arch == VIR_ARCH_PPC64) && STREQ(def->os.machine, "pseries")) def->serials[i]->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO; @@ -6975,7 +6974,6 @@ qemuBuildChrDeviceStr(virDomainChrDefPtr serial, if ((arch == VIR_ARCH_PPC64) && STREQ(machine, "pseries")) { if (serial->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL && - serial->source.type == VIR_DOMAIN_CHR_TYPE_PTY && serial->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO) { virBufferAsprintf(&cmd, "spapr-vty,chardev=char%s", serial->info.alias); -- 1.7.10.1

On Thu, Dec 20, 2012 at 02:02:25PM +0800, Li Zhang wrote:
From: Li Zhang <zhlcindy@linux.vnet.ibm.com>
Currently, it only considers PTY backend serial devices for pseries. It need to support all kinds of serial devices.
This patch is to fix the problem which is that it doesn't work when specifying source type as file.
Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> --- src/qemu/qemu_command.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 6a90ed5..f769dc6 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -923,7 +923,6 @@ int qemuDomainAssignSpaprVIOAddresses(virDomainDefPtr def,
for (i = 0 ; i < def->nserials; i++) { if (def->serials[i]->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL && - def->serials[i]->source.type == VIR_DOMAIN_CHR_TYPE_PTY && (def->os.arch == VIR_ARCH_PPC64) && STREQ(def->os.machine, "pseries")) def->serials[i]->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO; @@ -6975,7 +6974,6 @@ qemuBuildChrDeviceStr(virDomainChrDefPtr serial,
if ((arch == VIR_ARCH_PPC64) && STREQ(machine, "pseries")) { if (serial->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL && - serial->source.type == VIR_DOMAIN_CHR_TYPE_PTY && serial->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO) { virBufferAsprintf(&cmd, "spapr-vty,chardev=char%s", serial->info.alias);
ACK Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

From: Li Zhang <zhlcindy@linux.vnet.ibm.com> pseries machine type is preferred for ppc64. This patch is to set pseries as the default machine type. Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> --- src/conf/capabilities.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c index 7cdb5b7..ba03a84 100644 --- a/src/conf/capabilities.c +++ b/src/conf/capabilities.c @@ -624,6 +624,12 @@ virCapabilitiesDefaultGuestMachine(virCapsPtr caps, guest->arch.id != arch) continue; + for (j = 0; j < guest->arch.defaultInfo.nmachines; j ++) { + if (arch == VIR_ARCH_PPC64 && + STREQ(guest->arch.defaultInfo.machines[j]->name, "pseries")) + return guest->arch.defaultInfo.machines[j]->name; + } + for (j = 0; j < guest->arch.ndomains; j++) { virCapsGuestDomainPtr dom = guest->arch.domains[j]; -- 1.7.10.1

On Thu, Dec 20, 2012 at 02:02:26PM +0800, Li Zhang wrote:
From: Li Zhang <zhlcindy@linux.vnet.ibm.com>
pseries machine type is preferred for ppc64. This patch is to set pseries as the default machine type.
Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> --- src/conf/capabilities.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c index 7cdb5b7..ba03a84 100644 --- a/src/conf/capabilities.c +++ b/src/conf/capabilities.c @@ -624,6 +624,12 @@ virCapabilitiesDefaultGuestMachine(virCapsPtr caps, guest->arch.id != arch) continue;
+ for (j = 0; j < guest->arch.defaultInfo.nmachines; j ++) { + if (arch == VIR_ARCH_PPC64 && + STREQ(guest->arch.defaultInfo.machines[j]->name, "pseries")) + return guest->arch.defaultInfo.machines[j]->name; + } + for (j = 0; j < guest->arch.ndomains; j++) { virCapsGuestDomainPtr dom = guest->arch.domains[j];
NACK, libvirt queries QEMU to determine the default machine type: $ qemu-system-ppc64 -M '?' Supported machines are: none empty machine ref405ep ref405ep taihu taihu bamboo bamboo mac99 Mac99 based PowerMAC (default) ^^^^^^^^^ g3beige Heathrow based PowerMAC prep PowerPC PREP platform pseries pSeries Logical Partition (PAPR compliant) virtex-ml507 Xilinx Virtex ML507 reference design ppce500 generic paravirt e500 platform mpc8544ds mpc8544ds So if you want to change the default, then you should modify QEMU upstream Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On Thu, Dec 20, 2012 at 6:31 PM, Daniel P. Berrange <berrange@redhat.com>wrote:
On Thu, Dec 20, 2012 at 02:02:26PM +0800, Li Zhang wrote:
From: Li Zhang <zhlcindy@linux.vnet.ibm.com>
pseries machine type is preferred for ppc64. This patch is to set pseries as the default machine type.
Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> --- src/conf/capabilities.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c index 7cdb5b7..ba03a84 100644 --- a/src/conf/capabilities.c +++ b/src/conf/capabilities.c @@ -624,6 +624,12 @@ virCapabilitiesDefaultGuestMachine(virCapsPtr caps, guest->arch.id != arch) continue;
+ for (j = 0; j < guest->arch.defaultInfo.nmachines; j ++) { + if (arch == VIR_ARCH_PPC64 && + STREQ(guest->arch.defaultInfo.machines[j]->name, "pseries")) + return guest->arch.defaultInfo.machines[j]->name; + } + for (j = 0; j < guest->arch.ndomains; j++) { virCapsGuestDomainPtr dom = guest->arch.domains[j];
NACK, libvirt queries QEMU to determine the default machine type:
$ qemu-system-ppc64 -M '?' Supported machines are: none empty machine ref405ep ref405ep taihu taihu bamboo bamboo mac99 Mac99 based PowerMAC (default) ^^^^^^^^^ g3beige Heathrow based PowerMAC prep PowerPC PREP platform pseries pSeries Logical Partition (PAPR compliant) virtex-ml507 Xilinx Virtex ML507 reference design ppce500 generic paravirt e500 platform mpc8544ds mpc8544ds
So if you want to change the default, then you should modify QEMU upstream
Actually, Libvirt has redefined the default machine in the function virCapabilitiesDefaultGuestMachine. The default machine will be the last one, mpc8544ds which is not we expect. Thanks.
Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/:| |: http://libvirt.org -o- http://virt-manager.org:| |: http://autobuild.org -o- http://search.cpan.org/~danberr/:| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc:|
-- Best Regards -Li

On Fri, Dec 21, 2012 at 10:27 AM, Li Zhang <zhlcindy@gmail.com> wrote:
On Thu, Dec 20, 2012 at 6:31 PM, Daniel P. Berrange <berrange@redhat.com>wrote:
On Thu, Dec 20, 2012 at 02:02:26PM +0800, Li Zhang wrote:
From: Li Zhang <zhlcindy@linux.vnet.ibm.com>
pseries machine type is preferred for ppc64. This patch is to set pseries as the default machine type.
Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> --- src/conf/capabilities.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c index 7cdb5b7..ba03a84 100644 --- a/src/conf/capabilities.c +++ b/src/conf/capabilities.c @@ -624,6 +624,12 @@ virCapabilitiesDefaultGuestMachine(virCapsPtr caps, guest->arch.id != arch) continue;
+ for (j = 0; j < guest->arch.defaultInfo.nmachines; j ++) { + if (arch == VIR_ARCH_PPC64 && + STREQ(guest->arch.defaultInfo.machines[j]->name, "pseries")) + return guest->arch.defaultInfo.machines[j]->name; + } + for (j = 0; j < guest->arch.ndomains; j++) { virCapsGuestDomainPtr dom = guest->arch.domains[j];
NACK, libvirt queries QEMU to determine the default machine type:
$ qemu-system-ppc64 -M '?' Supported machines are: none empty machine ref405ep ref405ep taihu taihu bamboo bamboo mac99 Mac99 based PowerMAC (default) ^^^^^^^^^ g3beige Heathrow based PowerMAC prep PowerPC PREP platform pseries pSeries Logical Partition (PAPR compliant) virtex-ml507 Xilinx Virtex ML507 reference design ppce500 generic paravirt e500 platform mpc8544ds mpc8544ds
So if you want to change the default, then you should modify QEMU upstream
Actually, Libvirt has redefined the default machine in the function virCapabilitiesDefaultGuestMachine. The default machine will be the last one, mpc8544ds which is not we expect.
Please ignore my above comment. Upstream is still mac99. My concern is that it may be a little hard to change it in QEMU.
Thanks.
Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
--
Best Regards -Li
-- Best Regards -Li

From: Li Zhang <zhlcindy@linux.vnet.ibm.com> QEMU of upstream and PPC64 can support "-device driver,?", But the help string is "-device driver,help", This patch is to replace "-device driver,?" with "-device driver,". Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> --- src/qemu/qemu_capabilities.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index a6ac169..839c966 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1599,7 +1599,7 @@ qemuCapsExtractDeviceStr(const char *qemu, * in combination with '-device ?'. Upstream qemu 0.12.x doesn't * understand '-device name,?', and always exits with status 1 for * the simpler '-device ?', so this function is really only useful - * if -help includes "device driver,?". */ + * if -help includes "device driver,". */ cmd = qemuCapsProbeCommand(qemu, caps, hookData); virCommandAddArgList(cmd, "-device", "?", @@ -2186,7 +2186,7 @@ qemuCapsInitHelp(qemuCapsPtr caps, uid_t runUid, gid_t runGid) /* qemuCapsExtractDeviceStr will only set additional caps if qemu * understands the 0.13.0+ notion of "-device driver,". */ if (qemuCapsGet(caps, QEMU_CAPS_DEVICE) && - strstr(help, "-device driver,?") && + strstr(help, "-device driver,") && qemuCapsExtractDeviceStr(caps->binary, caps, &hookData) < 0) goto cleanup; -- 1.7.10.1

On Thu, Dec 20, 2012 at 02:02:27PM +0800, Li Zhang wrote:
From: Li Zhang <zhlcindy@linux.vnet.ibm.com>
QEMU of upstream and PPC64 can support "-device driver,?", But the help string is "-device driver,help",
This patch is to replace "-device driver,?" with "-device driver,".
Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> --- src/qemu/qemu_capabilities.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index a6ac169..839c966 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1599,7 +1599,7 @@ qemuCapsExtractDeviceStr(const char *qemu, * in combination with '-device ?'. Upstream qemu 0.12.x doesn't * understand '-device name,?', and always exits with status 1 for * the simpler '-device ?', so this function is really only useful - * if -help includes "device driver,?". */ + * if -help includes "device driver,". */ cmd = qemuCapsProbeCommand(qemu, caps, hookData); virCommandAddArgList(cmd, "-device", "?", @@ -2186,7 +2186,7 @@ qemuCapsInitHelp(qemuCapsPtr caps, uid_t runUid, gid_t runGid) /* qemuCapsExtractDeviceStr will only set additional caps if qemu * understands the 0.13.0+ notion of "-device driver,". */ if (qemuCapsGet(caps, QEMU_CAPS_DEVICE) && - strstr(help, "-device driver,?") && + strstr(help, "-device driver,") && qemuCapsExtractDeviceStr(caps->binary, caps, &hookData) < 0) goto cleanup;
NACK. For any QEMU version where the help text shows 'driver,help' we should be using QMP to determine capabilities. The -help parsing is only for legacy QEMU versions Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On Thu, Dec 20, 2012 at 6:32 PM, Daniel P. Berrange <berrange@redhat.com>wrote:
On Thu, Dec 20, 2012 at 02:02:27PM +0800, Li Zhang wrote:
From: Li Zhang <zhlcindy@linux.vnet.ibm.com>
QEMU of upstream and PPC64 can support "-device driver,?", But the help string is "-device driver,help",
This patch is to replace "-device driver,?" with "-device driver,".
Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> --- src/qemu/qemu_capabilities.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index a6ac169..839c966 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1599,7 +1599,7 @@ qemuCapsExtractDeviceStr(const char *qemu, * in combination with '-device ?'. Upstream qemu 0.12.x doesn't * understand '-device name,?', and always exits with status 1 for * the simpler '-device ?', so this function is really only useful - * if -help includes "device driver,?". */ + * if -help includes "device driver,". */ cmd = qemuCapsProbeCommand(qemu, caps, hookData); virCommandAddArgList(cmd, "-device", "?", @@ -2186,7 +2186,7 @@ qemuCapsInitHelp(qemuCapsPtr caps, uid_t runUid, gid_t runGid) /* qemuCapsExtractDeviceStr will only set additional caps if qemu * understands the 0.13.0+ notion of "-device driver,". */ if (qemuCapsGet(caps, QEMU_CAPS_DEVICE) && - strstr(help, "-device driver,?") && + strstr(help, "-device driver,") && qemuCapsExtractDeviceStr(caps->binary, caps, &hookData) < 0) goto cleanup;
NACK.
For any QEMU version where the help text shows 'driver,help' we should be using QMP to determine capabilities.
The -help parsing is only for legacy QEMU versions
Got it, thanks. :)
Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/:| |: http://libvirt.org -o- http://virt-manager.org:| |: http://autobuild.org -o- http://search.cpan.org/~danberr/:| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc:|
-- Best Regards -Li

On 12/19/2012 11:02 PM, Li Zhang wrote:
From: Li Zhang <zhlcindy@linux.vnet.ibm.com>
This patch series is to fix bugs on PowerPC we found when testing libvirt.
Li Zhang (6): Set std VGA model as default model for ppc64. Use -machine option for PPC64 Remove QEMU_CAPS_NO_ACPI capability for non-x86 platform Support all backend serial devices for pSeries guest Set the default machine as pseries for PPC64 Use help string "-device driver," when getting additional caps.
src/conf/capabilities.c | 6 ++++ src/conf/domain_conf.c | 2 ++ src/qemu/qemu_capabilities.c | 12 ++++++-- src/qemu/qemu_command.c | 31 +++++++++++--------- .../qemuxml2argv-machine-core-off.args | 2 +- .../qemuxml2argv-machine-core-on.args | 2 +- .../qemuxml2argv-pseries-basic.args | 2 +- .../qemuxml2argv-pseries-vio-user-assigned.args | 2 +- .../qemuxml2argvdata/qemuxml2argv-pseries-vio.args | 2 +- 9 files changed, 39 insertions(+), 22 deletions(-)
I've pushed 1, 3, and 4 (the ones with ACK). -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Fri, Dec 21, 2012 at 7:28 AM, Eric Blake <eblake@redhat.com> wrote:
On 12/19/2012 11:02 PM, Li Zhang wrote:
From: Li Zhang <zhlcindy@linux.vnet.ibm.com>
This patch series is to fix bugs on PowerPC we found when testing libvirt.
Li Zhang (6): Set std VGA model as default model for ppc64. Use -machine option for PPC64 Remove QEMU_CAPS_NO_ACPI capability for non-x86 platform Support all backend serial devices for pSeries guest Set the default machine as pseries for PPC64 Use help string "-device driver," when getting additional caps.
src/conf/capabilities.c | 6 ++++ src/conf/domain_conf.c | 2 ++ src/qemu/qemu_capabilities.c | 12 ++++++-- src/qemu/qemu_command.c | 31 +++++++++++--------- .../qemuxml2argv-machine-core-off.args | 2 +- .../qemuxml2argv-machine-core-on.args | 2 +- .../qemuxml2argv-pseries-basic.args | 2 +- .../qemuxml2argv-pseries-vio-user-assigned.args | 2 +- .../qemuxml2argvdata/qemuxml2argv-pseries-vio.args | 2 +- 9 files changed, 39 insertions(+), 22 deletions(-)
I've pushed 1, 3, and 4 (the ones with ACK).
Thanks.
-- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
-- Best Regards -Li
participants (3)
-
Daniel P. Berrange
-
Eric Blake
-
Li Zhang