[libvirt] [PATCH] Clarify semantics of virDomainMigrate2

Eric Blake eblake at redhat.com
Fri Oct 14 19:40:07 UTC 2011


On 10/14/2011 01:34 PM, Jiri Denemark wrote:
> Explicitly disallow conflicts between domain name from dxml and dname.
> ---
>   src/libvirt.c             |    3 +++
>   src/qemu/qemu_driver.c    |    4 ++--
>   src/qemu/qemu_migration.c |   17 ++++++++++++++---
>   src/qemu/qemu_migration.h |    1 +
>   4 files changed, 20 insertions(+), 5 deletions(-)
>
> diff --git a/src/libvirt.c b/src/libvirt.c
> index f1e6a6b..69cffc5 100644
> --- a/src/libvirt.c
> +++ b/src/libvirt.c
> @@ -4854,6 +4854,9 @@ error:
>    * in accessing the underlying storage.  The migration will fail
>    * if @dxml would cause any guest-visible changes.  Pass NULL
>    * if no changes are needed to the XML between source and destination.
> + * @dxml cannot be used to rename the domain during migration (use
> + * @dname for that purpose).  Domain name in @dxml must either match the
> + * original domain name or @dname if it was specified.

ACK.

> @@ -1028,6 +1031,14 @@ char *qemuMigrationBegin(struct qemud_driver *driver,
>                                               VIR_DOMAIN_XML_INACTIVE)))
>               goto cleanup;
>
> +        if (STRNEQ(def->name, vm->def->name)&&
> +            (!dname || STRNEQ(def->name, dname))) {

If wanted, you can simplify this to:

STRNEQ(def->name, vm->def->name) &&
STRNEQ_NULLABLE(def->name, dname)

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org




More information about the libvir-list mailing list