[libvirt] [PATCH v4 2/2] qemu: implement setting target disks migration port
Jiri Denemark
jdenemar at redhat.com
Thu Mar 17 15:24:56 UTC 2016
On Thu, Mar 17, 2016 at 17:58:48 +0300, Nikolay Shirokovskiy wrote:
> Mostly it is just passing new parameter here and there. In case
> of zero value we fallback to auto selecting port and thus keep
> backward compatibility.
>
> Also we need to fix places of auto selected port managment.
> We should bother only when auto selected was done that is
> when externally specified port is not 0.
>
> Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy at virtuozzo.com>
> ---
> src/qemu/qemu_driver.c | 25 ++++++++-----
> src/qemu/qemu_migration.c | 92 ++++++++++++++++++++++++++++++++++-------------
> src/qemu/qemu_migration.h | 3 ++
> 3 files changed, 87 insertions(+), 33 deletions(-)
Just a few nits...
> diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
> index 38fa81c..0a807a2 100644
> --- a/src/qemu/qemu_migration.c
> +++ b/src/qemu/qemu_migration.c
..
> @@ -3568,6 +3581,11 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver,
>
> if (autoPort)
> priv->migrationPort = port;
> + /* in this case port is autoselected and we don't need to manage it anymore
> + * after cookie is baked
I believe you wanted to say the port is *not* auto selected (we need to
manage it otherwise).
> + */
> + if (nbdPort != 0)
> + priv->nbdPort = 0;
> ret = 0;
>
> cleanup:
...
> @@ -4966,6 +4990,11 @@ doPeer2PeerMigrate3(virQEMUDriverPtr driver,
> VIR_MIGRATE_PARAM_MIGRATE_DISKS,
> migrate_disks[i]) < 0)
> goto cleanup;
> + if (nbdPort &&
> + virTypedParamsAddInt(¶ms, &nparams, &maxparams,
> + VIR_MIGRATE_PARAM_DISKS_PORT,
> + nbdPort) < 0)
> + goto cleanup;
Wrong indentation.
> }
>
> if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_PAUSED)
Jirka
More information about the libvir-list
mailing list