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

From: Li Zhang <zhlcindy@linux.vnet.ibm.com> For QEMU2.0 forward version, 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 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 2c8ec10..b49398f 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -3019,6 +3019,9 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps, if (qemuCaps->version >= 1006000) virQEMUCapsSet(qemuCaps, QEMU_CAPS_DEVICE_VIDEO_PRIMARY); + if (qemuCaps->version >= 2000000) + virQEMUCapsSet(qemuCaps, QEMU_CAPS_PCI_MULTIBUS); + if (virQEMUCapsProbeQMPCommands(qemuCaps, mon) < 0) goto cleanup; if (virQEMUCapsProbeQMPEvents(qemuCaps, mon) < 0) -- 1.8.2.1

On 04/08/2014 08:03 PM, Li Zhang wrote:
From: Li Zhang <zhlcindy@linux.vnet.ibm.com>
For QEMU2.0 forward version, 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 | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 2c8ec10..b49398f 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -3019,6 +3019,9 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps, if (qemuCaps->version >= 1006000) virQEMUCapsSet(qemuCaps, QEMU_CAPS_DEVICE_VIDEO_PRIMARY);
+ if (qemuCaps->version >= 2000000) + virQEMUCapsSet(qemuCaps, QEMU_CAPS_PCI_MULTIBUS); +
This is a version number check, which is bad. Is there a QMP command we can issue that gives a more reliable answer of whether the feature is present? -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 2014年04月09日 11:20, Eric Blake wrote:
From: Li Zhang <zhlcindy@linux.vnet.ibm.com>
For QEMU2.0 forward version, 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 | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 2c8ec10..b49398f 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -3019,6 +3019,9 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps, if (qemuCaps->version >= 1006000) virQEMUCapsSet(qemuCaps, QEMU_CAPS_DEVICE_VIDEO_PRIMARY);
+ if (qemuCaps->version >= 2000000) + virQEMUCapsSet(qemuCaps, QEMU_CAPS_PCI_MULTIBUS); + This is a version number check, which is bad. Is there a QMP command we can issue that gives a more reliable answer of whether the feature is
On 04/08/2014 08:03 PM, Li Zhang wrote: present?
Hi Eric, I can't find any QMP command for MULTIBUS in QEMU. There is only one "query-pci" to list PCI bus and devices information. Thanks.

[adding qemu] On 04/08/2014 11:36 PM, Li Zhang wrote:
On 2014年04月09日 11:20, Eric Blake wrote:
From: Li Zhang <zhlcindy@linux.vnet.ibm.com>
For QEMU2.0 forward version, 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 | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 2c8ec10..b49398f 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -3019,6 +3019,9 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps, if (qemuCaps->version >= 1006000) virQEMUCapsSet(qemuCaps, QEMU_CAPS_DEVICE_VIDEO_PRIMARY); + if (qemuCaps->version >= 2000000) + virQEMUCapsSet(qemuCaps, QEMU_CAPS_PCI_MULTIBUS); + This is a version number check, which is bad. Is there a QMP command we can issue that gives a more reliable answer of whether the feature is
On 04/08/2014 08:03 PM, Li Zhang wrote: present?
Hi Eric,
I can't find any QMP command for MULTIBUS in QEMU. There is only one "query-pci" to list PCI bus and devices information.
Maybe it's my fault for not being more vocal when the bus rename was being proposed on the qemu list, but libvirt really does want a way to probe via QMP whether the 'pci.0' (multibus) vs. 'pci' naming should be used for a given machine. Is there an existing command we can use, or is this something that we need to fix early on in qemu 2.1 and backport to 2.0-stable? -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 09.04.2014 04:03, Li Zhang wrote:
From: Li Zhang <zhlcindy@linux.vnet.ibm.com>
For QEMU2.0 forward version, 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 | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 2c8ec10..b49398f 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -3019,6 +3019,9 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps, if (qemuCaps->version >= 1006000) virQEMUCapsSet(qemuCaps, QEMU_CAPS_DEVICE_VIDEO_PRIMARY);
+ if (qemuCaps->version >= 2000000) + virQEMUCapsSet(qemuCaps, QEMU_CAPS_PCI_MULTIBUS); + if (virQEMUCapsProbeQMPCommands(qemuCaps, mon) < 0) goto cleanup; if (virQEMUCapsProbeQMPEvents(qemuCaps, mon) < 0)
Libvirt is setting this capability unconditionally for all x86_64 and i686 (see virQEMUCapsInitArchQMPBasic). What is the actual scenario you're seeing this error in? Michal

On 2014年04月09日 17:25, Michal Privoznik wrote:
On 09.04.2014 04:03, Li Zhang wrote:
From: Li Zhang <zhlcindy@linux.vnet.ibm.com>
For QEMU2.0 forward version, 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 | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 2c8ec10..b49398f 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -3019,6 +3019,9 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps, if (qemuCaps->version >= 1006000) virQEMUCapsSet(qemuCaps, QEMU_CAPS_DEVICE_VIDEO_PRIMARY);
+ if (qemuCaps->version >= 2000000) + virQEMUCapsSet(qemuCaps, QEMU_CAPS_PCI_MULTIBUS); + if (virQEMUCapsProbeQMPCommands(qemuCaps, mon) < 0) goto cleanup; if (virQEMUCapsProbeQMPEvents(qemuCaps, mon) < 0)
Libvirt is setting this capability unconditionally for all x86_64 and i686 (see virQEMUCapsInitArchQMPBasic). What is the actual scenario you're seeing this error in?
For pseries machine, before QEMU2.0, the PCI bus default name is always "pci". QEMU2.0 changed the name as "pci.0" to support MULTBUS a couple days ago. If libvirt still parses the name as "pci" with QEMU_CAPS_PCI_MULTIBUS disabled, it will report the error "Bus 'pci' not found". I may need to add a PPC64 condition if X86 always enables MULTIBUS. Thanks. --Li
Michal

On 10.04.2014 07:26, Li Zhang wrote:
On 2014年04月09日 17:25, Michal Privoznik wrote:
On 09.04.2014 04:03, Li Zhang wrote:
From: Li Zhang <zhlcindy@linux.vnet.ibm.com>
For QEMU2.0 forward version, 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 | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 2c8ec10..b49398f 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -3019,6 +3019,9 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps, if (qemuCaps->version >= 1006000) virQEMUCapsSet(qemuCaps, QEMU_CAPS_DEVICE_VIDEO_PRIMARY);
+ if (qemuCaps->version >= 2000000) + virQEMUCapsSet(qemuCaps, QEMU_CAPS_PCI_MULTIBUS); + if (virQEMUCapsProbeQMPCommands(qemuCaps, mon) < 0) goto cleanup; if (virQEMUCapsProbeQMPEvents(qemuCaps, mon) < 0)
Libvirt is setting this capability unconditionally for all x86_64 and i686 (see virQEMUCapsInitArchQMPBasic). What is the actual scenario you're seeing this error in?
For pseries machine, before QEMU2.0, the PCI bus default name is always "pci". QEMU2.0 changed the name as "pci.0" to support MULTBUS a couple days ago.
If libvirt still parses the name as "pci" with QEMU_CAPS_PCI_MULTIBUS disabled, it will report the error "Bus 'pci' not found".
I may need to add a PPC64 condition if X86 always enables MULTIBUS.
Yeah, I see. But then again, I think we need a different patch after all: diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 381b3ec..a14161d 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2940,10 +2940,13 @@ 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 || + if (qemuCaps->arch == VIR_ARCH_PPC64) { + virQEMUCapsSet(qemuCaps, QEMU_CAPS_PCI_MULTIBUS); + } else if (qemuCaps->arch == VIR_ARCH_X86_64 || qemuCaps->arch == VIR_ARCH_I686) { virQEMUCapsSet(qemuCaps, QEMU_CAPS_PCI_MULTIBUS); virQEMUCapsSet(qemuCaps, QEMU_CAPS_NO_ACPI); Michal

On 2014年04月10日 13:50, Michal Privoznik wrote:
On 10.04.2014 07:26, Li Zhang wrote:
On 2014年04月09日 17:25, Michal Privoznik wrote:
On 09.04.2014 04:03, Li Zhang wrote:
From: Li Zhang <zhlcindy@linux.vnet.ibm.com>
For QEMU2.0 forward version, 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 | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 2c8ec10..b49398f 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -3019,6 +3019,9 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps, if (qemuCaps->version >= 1006000) virQEMUCapsSet(qemuCaps, QEMU_CAPS_DEVICE_VIDEO_PRIMARY);
+ if (qemuCaps->version >= 2000000) + virQEMUCapsSet(qemuCaps, QEMU_CAPS_PCI_MULTIBUS); + if (virQEMUCapsProbeQMPCommands(qemuCaps, mon) < 0) goto cleanup; if (virQEMUCapsProbeQMPEvents(qemuCaps, mon) < 0)
Libvirt is setting this capability unconditionally for all x86_64 and i686 (see virQEMUCapsInitArchQMPBasic). What is the actual scenario you're seeing this error in?
For pseries machine, before QEMU2.0, the PCI bus default name is always "pci". QEMU2.0 changed the name as "pci.0" to support MULTBUS a couple days ago.
If libvirt still parses the name as "pci" with QEMU_CAPS_PCI_MULTIBUS disabled, it will report the error "Bus 'pci' not found".
I may need to add a PPC64 condition if X86 always enables MULTIBUS.
Yeah, I see. But then again, I think we need a different patch after all:
It still needs QEMU version check to be compatible with older QEMU. :) I will change it according to your suggestion. Thanks. :)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 381b3ec..a14161d 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2940,10 +2940,13 @@ 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 || + if (qemuCaps->arch == VIR_ARCH_PPC64) { + virQEMUCapsSet(qemuCaps, QEMU_CAPS_PCI_MULTIBUS); + } else if (qemuCaps->arch == VIR_ARCH_X86_64 || qemuCaps->arch == VIR_ARCH_I686) { virQEMUCapsSet(qemuCaps, QEMU_CAPS_PCI_MULTIBUS); virQEMUCapsSet(qemuCaps, QEMU_CAPS_NO_ACPI);
Michal

On Wed, Apr 09, 2014 at 10:03:32AM +0800, Li Zhang wrote:
From: Li Zhang <zhlcindy@linux.vnet.ibm.com>
For QEMU2.0 forward version, 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 | 3 +++ 1 file changed, 3 insertions(+)
Just wanted to point out that we merged https://www.redhat.com/archives/libvir-list/2014-April/msg00889.html which fixes this for all historical QEMU versions and PPC machine types 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 :|
participants (4)
-
Daniel P. Berrange
-
Eric Blake
-
Li Zhang
-
Michal Privoznik