[libvirt] [PATCH 4/4] virQEMUCapsHasPCIMultiBus: assume true if we have no version information
Pavel Hrdina
phrdina at redhat.com
Thu Nov 30 14:53:27 UTC 2017
On Wed, Nov 29, 2017 at 03:58:57PM +0100, Ján Tomko wrote:
> In status XML, we do not store the QEMU version information, we only
> format all the capabilities. We dropped QEMU_CAPS_PCI_MULTIBUS
> in commit 5b783379 which was released in libvirt 3.2.0.
>
> Therefore the only way of telling if the already running domain
> at the time of daemon restart has been started with a QEMU that does
> use 'pci.0' or not on PPC is to look at the pci-root controller's
> alias. This is not an option if the domain has a user-specified alias
> for the pci-root.
>
> Instead of reintroducing the capability, assume 'pci.0' when we have
> no version information. That way the only left broken use case would
> be the combination of user aliases and very old QEMU.
>
> https://bugzilla.redhat.com/show_bug.cgi?id=1518148
> ---
> src/qemu/qemu_capabilities.c | 16 ++++++++--------
> src/qemu/qemu_capspriv.h | 4 ----
> tests/qemuxml2argvtest.c | 5 -----
> 3 files changed, 8 insertions(+), 17 deletions(-)
>
> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
> index c9d0a66d8..7b52d1a71 100644
> --- a/src/qemu/qemu_capabilities.c
> +++ b/src/qemu/qemu_capabilities.c
> @@ -2436,6 +2436,14 @@ bool virQEMUCapsHasPCIMultiBus(virQEMUCapsPtr qemuCaps,
> * ppce500: 1.6.0
> */
>
> + /* We do not store the qemu version in domain status XML.
> + * Hope the user is using a QEMU new enough to use 'pci.0',
> + * otherwise the results of this function will be wrong
> + * for domains already running at the time of daemon
> + * restart */
> + if (qemuCaps->version == 0)
> + return true;
> +
I don't like this that we will hope that QEMU is new enough, but I
cannot think of a better way how to check it and this definitely
improves current code.
For the whole series:
Reviewed-by: Pavel Hrdina <phrdina at redhat.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20171130/6ba5c81f/attachment-0001.sig>
More information about the libvir-list
mailing list