[libvirt] [PATCH v2 1/1] Enable QEMU_CAPS_PCI_MULTIBUS capability for QEMU2.0 forward on PPC64.

From: Li Zhang <zhlcindy@linux.vnet.ibm.com> For QEMU2.0 forward version on PPC64, it supports PCI multibus. Currently, libvirt still disables it which causes an error "Bus 'pci' not found". Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> --- src/qemu/qemu_capabilities.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 381b3ec..812bbe0 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2813,13 +2813,16 @@ virQEMUCapsInitHelp(virQEMUCapsPtr qemuCaps, uid_t runUid, gid_t runGid) false) < 0) goto cleanup; - /* Currently only x86_64 and i686 support PCI-multibus. */ - if (qemuCaps->arch == VIR_ARCH_X86_64 || - qemuCaps->arch == VIR_ARCH_I686) { + /* Currently only x86_64, i686 and PPC64 support PCI-multibus. */ + if ((qemuCaps->arch == VIR_ARCH_PPC64 && + qemuCaps->version >= 2000000) || + ARCH_IS_X86(qemuCaps->arch)) { virQEMUCapsSet(qemuCaps, QEMU_CAPS_PCI_MULTIBUS); - } else { - /* -no-acpi is not supported on other archs - * even if qemu reports it in -help */ + } + + /* -no-acpi is not supported on non-X86 archs + * even if qemu reports it in -help */ + if (!ARCH_IS_X86(qemuCaps->arch)) { virQEMUCapsClear(qemuCaps, QEMU_CAPS_NO_ACPI); } @@ -2940,11 +2943,14 @@ virQEMUCapsInitArchQMPBasic(virQEMUCapsPtr qemuCaps, } /* - * Currently only x86_64 and i686 support PCI-multibus, - * -no-acpi and -no-kvm-pit-reinjection. + * Currently only x86_64, i686 and PPC64 support PCI-multibus, + * Moreover, the first two arches support -no-acpi and + * -no-kvm-pit-reinjection. */ - if (qemuCaps->arch == VIR_ARCH_X86_64 || - qemuCaps->arch == VIR_ARCH_I686) { + if (qemuCaps->arch == VIR_ARCH_PPC64 && + qemuCaps->version >= 2000000) { + virQEMUCapsSet(qemuCaps, QEMU_CAPS_PCI_MULTIBUS); + } else if (ARCH_IS_X86(qemuCaps->arch)) { virQEMUCapsSet(qemuCaps, QEMU_CAPS_PCI_MULTIBUS); virQEMUCapsSet(qemuCaps, QEMU_CAPS_NO_ACPI); virQEMUCapsSet(qemuCaps, QEMU_CAPS_NO_KVM_PIT); -- 1.8.2.1

On 04/10/2014 02:59 AM, Li Zhang wrote:
From: Li Zhang <zhlcindy@linux.vnet.ibm.com>
For QEMU2.0 forward version on PPC64, it supports PCI multibus. Currently, libvirt still disables it which causes an error "Bus 'pci' not found".
Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> --- src/qemu/qemu_capabilities.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 381b3ec..812bbe0 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2813,13 +2813,16 @@ virQEMUCapsInitHelp(virQEMUCapsPtr qemuCaps, uid_t runUid, gid_t runGid) false) < 0) goto cleanup;
- /* Currently only x86_64 and i686 support PCI-multibus. */ - if (qemuCaps->arch == VIR_ARCH_X86_64 || - qemuCaps->arch == VIR_ARCH_I686) { + /* Currently only x86_64, i686 and PPC64 support PCI-multibus. */ + if ((qemuCaps->arch == VIR_ARCH_PPC64 && + qemuCaps->version >= 2000000) || + ARCH_IS_X86(qemuCaps->arch)) {
Yuck. Why again did you push this into qemu 2.0 without also providing a QMP witness command to query whether the new naming is in effect? We may be forced to take this patch, but I'm not very happy with the situation. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Thu, Apr 10, 2014 at 06:36:10AM -0600, Eric Blake wrote:
On 04/10/2014 02:59 AM, Li Zhang wrote:
From: Li Zhang <zhlcindy@linux.vnet.ibm.com>
For QEMU2.0 forward version on PPC64, it supports PCI multibus. Currently, libvirt still disables it which causes an error "Bus 'pci' not found".
Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> --- src/qemu/qemu_capabilities.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 381b3ec..812bbe0 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2813,13 +2813,16 @@ virQEMUCapsInitHelp(virQEMUCapsPtr qemuCaps, uid_t runUid, gid_t runGid) false) < 0) goto cleanup;
- /* Currently only x86_64 and i686 support PCI-multibus. */ - if (qemuCaps->arch == VIR_ARCH_X86_64 || - qemuCaps->arch == VIR_ARCH_I686) { + /* Currently only x86_64, i686 and PPC64 support PCI-multibus. */ + if ((qemuCaps->arch == VIR_ARCH_PPC64 && + qemuCaps->version >= 2000000) || + ARCH_IS_X86(qemuCaps->arch)) {
Yuck. Why again did you push this into qemu 2.0 without also providing a QMP witness command to query whether the new naming is in effect?
We may be forced to take this patch, but I'm not very happy with the situation.
This was also supposed to have been done against all QEMU architectures, not merely PPC64, so we could avoid this architecture specific dep :-( I wonder if QEMU would be willing to revert this patch before 2.0 to allow a properly complete fix to be done. Regards, 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 2014年04月10日 20:39, Daniel P. Berrange wrote:
On Thu, Apr 10, 2014 at 06:36:10AM -0600, Eric Blake wrote:
On 04/10/2014 02:59 AM, Li Zhang wrote:
From: Li Zhang <zhlcindy@linux.vnet.ibm.com>
For QEMU2.0 forward version on PPC64, it supports PCI multibus. Currently, libvirt still disables it which causes an error "Bus 'pci' not found".
Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> --- src/qemu/qemu_capabilities.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 381b3ec..812bbe0 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2813,13 +2813,16 @@ virQEMUCapsInitHelp(virQEMUCapsPtr qemuCaps, uid_t runUid, gid_t runGid) false) < 0) goto cleanup;
- /* Currently only x86_64 and i686 support PCI-multibus. */ - if (qemuCaps->arch == VIR_ARCH_X86_64 || - qemuCaps->arch == VIR_ARCH_I686) { + /* Currently only x86_64, i686 and PPC64 support PCI-multibus. */ + if ((qemuCaps->arch == VIR_ARCH_PPC64 && + qemuCaps->version >= 2000000) || + ARCH_IS_X86(qemuCaps->arch)) { Yuck. Why again did you push this into qemu 2.0 without also providing a QMP witness command to query whether the new naming is in effect?
We may be forced to take this patch, but I'm not very happy with the situation. This was also supposed to have been done against all QEMU architectures, not merely PPC64, so we could avoid this architecture specific dep :-( I wonder if QEMU would be willing to revert this patch before 2.0 to allow a properly complete fix to be done.
I see, Daniel. We can hold this patch for a while. It may be a better solution by using a QMP command. If there is no QMP command, I will check whether we can add one for it. Thanks.
Regards, Daniel

On 2014年04月10日 20:36, Eric Blake wrote:
On 04/10/2014 02:59 AM, Li Zhang wrote:
From: Li Zhang <zhlcindy@linux.vnet.ibm.com>
For QEMU2.0 forward version on PPC64, it supports PCI multibus. Currently, libvirt still disables it which causes an error "Bus 'pci' not found".
Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> --- src/qemu/qemu_capabilities.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 381b3ec..812bbe0 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2813,13 +2813,16 @@ virQEMUCapsInitHelp(virQEMUCapsPtr qemuCaps, uid_t runUid, gid_t runGid) false) < 0) goto cleanup;
- /* Currently only x86_64 and i686 support PCI-multibus. */ - if (qemuCaps->arch == VIR_ARCH_X86_64 || - qemuCaps->arch == VIR_ARCH_I686) { + /* Currently only x86_64, i686 and PPC64 support PCI-multibus. */ + if ((qemuCaps->arch == VIR_ARCH_PPC64 && + qemuCaps->version >= 2000000) || + ARCH_IS_X86(qemuCaps->arch)) { Yuck. Why again did you push this into qemu 2.0 without also providing a QMP witness command to query whether the new naming is in effect?
We may be forced to take this patch, but I'm not very happy with the situation.
I'm sorry. I make a change of the patch according to Michal's suggestion. I add QEMU2.0 check because we still didn't find any QEMU command. I also will wait for the witness from QEMU. If there is a command, I will add change it accordingly. Sorry again.
participants (3)
-
Daniel P. Berrange
-
Eric Blake
-
Li Zhang