提交 f486cb5e 编写于 作者: N Nikolay Shirokovskiy 提交者: Jiri Denemark

migration: add target peer disks port

Some hypervisors (namely qemu) can have a separate connecton for
non-shared disks migration of active domains. Currently we have
no means to control the port of such a connection. At the same
time we have options to control port of memory migration traffic
(thru migration uri) as well as interfaces that target server
is bound to for incoming migration (thru VIR_MIGRATE_PARAM_LISTEN_ADDRESS).
Let's add the option for setting disks port too.
Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
上级 61d0bcec
...@@ -773,6 +773,16 @@ typedef enum { ...@@ -773,6 +773,16 @@ typedef enum {
*/ */
# define VIR_MIGRATE_PARAM_MIGRATE_DISKS "migrate_disks" # define VIR_MIGRATE_PARAM_MIGRATE_DISKS "migrate_disks"
/**
* VIR_MIGRATE_PARAM_DISKS_PORT:
*
* virDomainMigrate* params field: port that destination server should use
* for incoming disks migration. Type is VIR_TYPED_PARAM_INT. If set to 0 or
* omitted, libvirt will choose a suitable default. At the moment this is only
* supported by the QEMU driver.
*/
# define VIR_MIGRATE_PARAM_DISKS_PORT "disks_port"
/* Domain migration. */ /* Domain migration. */
virDomainPtr virDomainMigrate (virDomainPtr domain, virConnectPtr dconn, virDomainPtr virDomainMigrate (virDomainPtr domain, virConnectPtr dconn,
unsigned long flags, const char *dname, unsigned long flags, const char *dname,
......
...@@ -9667,6 +9667,10 @@ static const vshCmdOptDef opts_migrate[] = { ...@@ -9667,6 +9667,10 @@ static const vshCmdOptDef opts_migrate[] = {
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.help = N_("comma separated list of disks to be migrated") .help = N_("comma separated list of disks to be migrated")
}, },
{.name = "disks-port",
.type = VSH_OT_INT,
.help = N_("port to use by target server for incoming disks migration")
},
{.name = NULL} {.name = NULL}
}; };
...@@ -9677,6 +9681,7 @@ doMigrate(void *opaque) ...@@ -9677,6 +9681,7 @@ doMigrate(void *opaque)
virDomainPtr dom = NULL; virDomainPtr dom = NULL;
const char *desturi = NULL; const char *desturi = NULL;
const char *opt = NULL; const char *opt = NULL;
int disksPort = 0;
unsigned int flags = 0; unsigned int flags = 0;
virshCtrlData *data = opaque; virshCtrlData *data = opaque;
vshControl *ctl = data->ctl; vshControl *ctl = data->ctl;
...@@ -9719,6 +9724,13 @@ doMigrate(void *opaque) ...@@ -9719,6 +9724,13 @@ doMigrate(void *opaque)
VIR_MIGRATE_PARAM_LISTEN_ADDRESS, opt) < 0) VIR_MIGRATE_PARAM_LISTEN_ADDRESS, opt) < 0)
goto save_error; goto save_error;
if (vshCommandOptInt(ctl, cmd, "disks-port", &disksPort) < 0)
goto out;
if (disksPort &&
virTypedParamsAddInt(&params, &nparams, &maxparams,
VIR_MIGRATE_PARAM_DISKS_PORT, disksPort) < 0)
goto save_error;
if (vshCommandOptStringReq(ctl, cmd, "dname", &opt) < 0) if (vshCommandOptStringReq(ctl, cmd, "dname", &opt) < 0)
goto out; goto out;
if (opt && if (opt &&
......
...@@ -1532,7 +1532,7 @@ to the I<uri> namespace is displayed instead of being modified. ...@@ -1532,7 +1532,7 @@ to the I<uri> namespace is displayed instead of being modified.
[I<--compressed>] [I<--abort-on-error>] [I<--auto-converge>] [I<--compressed>] [I<--abort-on-error>] [I<--auto-converge>]
I<domain> I<desturi> [I<migrateuri>] [I<graphicsuri>] [I<listen-address>] I<domain> I<desturi> [I<migrateuri>] [I<graphicsuri>] [I<listen-address>]
[I<dname>] [I<--timeout> B<seconds>] [I<--xml> B<file>] [I<dname>] [I<--timeout> B<seconds>] [I<--xml> B<file>]
[I<--migrate-disks> B<disk-list>] [I<--migrate-disks> B<disk-list>] [I<--disks-port> B<port>]
Migrate domain to another host. Add I<--live> for live migration; <--p2p> 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> for peer-2-peer migration; I<--direct> for direct migration; or I<--tunnelled>
...@@ -1659,6 +1659,9 @@ addresses are accepted as well as hostnames (the resolving is done on ...@@ -1659,6 +1659,9 @@ addresses are accepted as well as hostnames (the resolving is done on
destination). Some hypervisors do not support this feature and will return an destination). Some hypervisors do not support this feature and will return an
error if this parameter is used. error if this parameter is used.
Optional I<disks-port> sets the port that hypervisor on destination side should
bind to for incoming disks traffic. Currently it is supported only by qemu.
=item B<migrate-setmaxdowntime> I<domain> I<downtime> =item B<migrate-setmaxdowntime> I<domain> I<downtime>
Set maximum tolerable downtime for a domain which is being live-migrated to Set maximum tolerable downtime for a domain which is being live-migrated to
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册