From 72aafe9c812e17547df185abebb3fe4e56d0d982 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Tue, 8 Oct 2013 13:49:25 +0200 Subject: [PATCH] Migration: Introduce VIR_MIGRATE_PARAM_LISTEN_ADDRESS The parameter allows overriding default listen address for '-incoming' cmd line argument on destination. Signed-off-by: Michal Privoznik --- include/libvirt/libvirt.h.in | 10 ++++++++++ tools/virsh-domain.c | 11 +++++++++++ tools/virsh.pod | 10 ++++++++-- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in index 83c219edd2..820e8ce777 100644 --- a/include/libvirt/libvirt.h.in +++ b/include/libvirt/libvirt.h.in @@ -1270,6 +1270,16 @@ typedef enum { */ #define VIR_MIGRATE_PARAM_GRAPHICS_URI "graphics_uri" +/** + * VIR_MIGRATE_PARAM_LISTEN_ADDRESS: + * + * virDomainMigrate* params field: The listen address that hypervisor on the + * destination side should bind to for incoming migration. Both, IPv4 and IPv6 + * addresses are accepted as well as hostnames (the resolving is done on + * destination). Some hypervisors do not support this feature an will return an + * error if this field is used. + */ +#define VIR_MIGRATE_PARAM_LISTEN_ADDRESS "listen_address" /* Domain migration. */ virDomainPtr virDomainMigrate (virDomainPtr domain, virConnectPtr dconn, diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 42c9920593..6d241db7dc 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -8550,6 +8550,10 @@ static const vshCmdOptDef opts_migrate[] = { .type = VSH_OT_DATA, .help = N_("graphics URI to be used for seamless graphics migration") }, + {.name = "listen-address", + .type = VSH_OT_DATA, + .help = N_("listen address that destination should bind to for incoming migration") + }, {.name = "dname", .type = VSH_OT_DATA, .help = N_("rename to new name during migration (if supported)") @@ -8606,6 +8610,13 @@ doMigrate(void *opaque) VIR_MIGRATE_PARAM_GRAPHICS_URI, opt) < 0) goto save_error; + if (vshCommandOptStringReq(ctl, cmd, "listen-address", &opt) < 0) + goto out; + if (opt && + virTypedParamsAddString(¶ms, &nparams, &maxparams, + VIR_MIGRATE_PARAM_LISTEN_ADDRESS, opt) < 0) + goto save_error; + if (vshCommandOptStringReq(ctl, cmd, "dname", &opt) < 0) goto out; if (opt && diff --git a/tools/virsh.pod b/tools/virsh.pod index e12a800fb9..c6f6adda02 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -1081,8 +1081,8 @@ stats. [I<--persistent>] [I<--undefinesource>] [I<--suspend>] [I<--copy-storage-all>] [I<--copy-storage-inc>] [I<--change-protection>] [I<--unsafe>] [I<--verbose>] [I<--compressed>] [I<--abort-on-error>] -I I [I] [I] [I] -[I<--timeout> B] [I<--xml> B] +I I [I] [I] [I] +[I] [I<--timeout> B] [I<--xml> B] Migrate domain to another host. Add I<--live> for live migration; <--p2p> for peer-2-peer migration; I<--direct> for direct migration; or I<--tunnelled> @@ -1189,6 +1189,12 @@ specific parameters separated by '&'. Currently recognized parameters are spice://target.host.com:1234/?tlsPort=4567 +Optional I sets the listen address that hypervisor on the +destination side should bind to for incoming migration. Both IPv4 and IPv6 +addresses are accepted as well as hostnames (the resolving is done on +destination). Some hypervisors do not support this feature and will return an +error if this parameter is used. + =item B I I Set maximum tolerable downtime for a domain which is being live-migrated to