mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 09:17:52 +03:00
virsh: Add support for virDomainMigrateGetMaxDowntime
Implement a migrate-getmaxdowntime command to complement migrate-setmaxdowntime.
This commit is contained in:
parent
457f8f33c9
commit
9002c5047a
@ -10719,6 +10719,47 @@ cmdMigrateSetMaxDowntime(vshControl *ctl, const vshCmd *cmd)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* "migrate-getmaxdowntime" command
|
||||||
|
*/
|
||||||
|
static const vshCmdInfo info_migrate_getmaxdowntime[] = {
|
||||||
|
{.name = "help",
|
||||||
|
.data = N_("get maximum tolerable downtime")
|
||||||
|
},
|
||||||
|
{.name = "desc",
|
||||||
|
.data = N_("Get maximum tolerable downtime of a domain which is being live-migrated to another host.")
|
||||||
|
},
|
||||||
|
{.name = NULL}
|
||||||
|
};
|
||||||
|
|
||||||
|
static const vshCmdOptDef opts_migrate_getmaxdowntime[] = {
|
||||||
|
VIRSH_COMMON_OPT_DOMAIN_FULL,
|
||||||
|
{.name = NULL}
|
||||||
|
};
|
||||||
|
|
||||||
|
static bool
|
||||||
|
cmdMigrateGetMaxDowntime(vshControl *ctl, const vshCmd *cmd)
|
||||||
|
{
|
||||||
|
virDomainPtr dom = NULL;
|
||||||
|
unsigned long long downtime;
|
||||||
|
bool ret = false;
|
||||||
|
|
||||||
|
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (virDomainMigrateGetMaxDowntime(dom, &downtime, 0) < 0)
|
||||||
|
goto done;
|
||||||
|
|
||||||
|
vshPrint(ctl, "%llu\n", downtime);
|
||||||
|
ret = true;
|
||||||
|
|
||||||
|
done:
|
||||||
|
virshDomainFree(dom);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* "migrate-compcache" command
|
* "migrate-compcache" command
|
||||||
*/
|
*/
|
||||||
@ -13875,6 +13916,12 @@ const vshCmdDef domManagementCmds[] = {
|
|||||||
.info = info_migrate_setmaxdowntime,
|
.info = info_migrate_setmaxdowntime,
|
||||||
.flags = 0
|
.flags = 0
|
||||||
},
|
},
|
||||||
|
{.name = "migrate-getmaxdowntime",
|
||||||
|
.handler = cmdMigrateGetMaxDowntime,
|
||||||
|
.opts = opts_migrate_getmaxdowntime,
|
||||||
|
.info = info_migrate_getmaxdowntime,
|
||||||
|
.flags = 0
|
||||||
|
},
|
||||||
{.name = "migrate-compcache",
|
{.name = "migrate-compcache",
|
||||||
.handler = cmdMigrateCompCache,
|
.handler = cmdMigrateCompCache,
|
||||||
.opts = opts_migrate_compcache,
|
.opts = opts_migrate_compcache,
|
||||||
|
@ -1857,6 +1857,12 @@ Set maximum tolerable downtime for a domain which is being live-migrated to
|
|||||||
another host. The I<downtime> is a number of milliseconds the guest is allowed
|
another host. The I<downtime> is a number of milliseconds the guest is allowed
|
||||||
to be down at the end of live migration.
|
to be down at the end of live migration.
|
||||||
|
|
||||||
|
=item B<migrate-getmaxdowntime> I<domain>
|
||||||
|
|
||||||
|
Get the maximum tolerable downtime for a domain which is being live-migrated to
|
||||||
|
another host. This is the number of milliseconds the guest is allowed
|
||||||
|
to be down at the end of live migration.
|
||||||
|
|
||||||
=item B<migrate-compcache> I<domain> [I<--size> B<bytes>]
|
=item B<migrate-compcache> I<domain> [I<--size> B<bytes>]
|
||||||
|
|
||||||
Sets and/or gets size of the cache (in bytes) used for compressing repeatedly
|
Sets and/or gets size of the cache (in bytes) used for compressing repeatedly
|
||||||
|
Loading…
Reference in New Issue
Block a user