[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH] conf: Fix backwards migration of pSeries guests



On Wed, Jul 19, 2017 at 14:10:27 +0200, Andrea Bolognani wrote:
> Recent commits made it so that pci-root controllers for

Did we release this?

> pSeries guests are automatically assigned the
> spapr-pci-host-bridge model name; however, that prevents
> guests to migrate to older versions of libvirt which don't
> know about that model name at all, which at the moment is
> all of them :)
> 
> To avoid the issue, just strip the model name from PHBs
> when formatting the migratable XML; guests that use more
> than one PHB are not going to be migratable anyway.
> 
> Signed-off-by: Andrea Bolognani <abologna redhat com>
> ---
>  src/conf/domain_conf.c | 15 ++++++++++++++-
>  1 file changed, 14 insertions(+), 1 deletion(-)
> 
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index 9320794..21bd7c7 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -21919,7 +21919,20 @@ virDomainControllerDefFormat(virBufferPtr buf,
>      }
>  
>      if (def->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI) {
> -        if (def->opts.pciopts.modelName != VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE) {
> +        bool formatModelName = true;
> +
> +        if (def->opts.pciopts.modelName == VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE)
> +            formatModelName = false;
> +
> +        /* Don't format the model name for PHBs when migrating so that
> +         * guests that only use the default one can be migrated to older
> +         * libvirt version which don't know about PHBs at all */
> +        if (virDomainControllerIsPCIHostBridge(def) &&

This function has a confusing name, since it's explicitly checking for a
pSeries specific thing but the name does not really imply that.

> +            flags & VIR_DOMAIN_DEF_FORMAT_MIGRATABLE) {
> +            formatModelName = false;
> +        }

Won't this suppress the formatting of the type even if the user
specified it explicitly? In that case we should not suppress it IMO.
It will cause problems once there's a different model available.

If the term 'PCI host bridge' is a p-series specific thing, we should
make it more obvious in the code since it's too generic sounding without
knowledge of the context.

Attachment: signature.asc
Description: PGP signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]