mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
virsh: Add --postcopy option for domjobabort command
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
01d65a1520
commit
ce34977c1f
@ -2053,10 +2053,16 @@ domjobabort
|
|||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
domjobabort domain
|
domjobabort domain [--postcopy]
|
||||||
|
|
||||||
Abort the currently running domain job.
|
Abort the currently running domain job.
|
||||||
|
|
||||||
|
When the job to be aborted is a migration which entered post-copy mode, it
|
||||||
|
cannot be aborted as none of the hosts involved in migration has a complete
|
||||||
|
state of the domain. Optional *--postcopy* can be used to interrupt such
|
||||||
|
migration although doing so may effectively suspend the domain until the
|
||||||
|
migration is resumed (see also *--postcopy-resume* option of ``migrate``).
|
||||||
|
|
||||||
|
|
||||||
domjobinfo
|
domjobinfo
|
||||||
----------
|
----------
|
||||||
|
@ -6477,6 +6477,10 @@ static const vshCmdInfo info_domjobabort[] = {
|
|||||||
|
|
||||||
static const vshCmdOptDef opts_domjobabort[] = {
|
static const vshCmdOptDef opts_domjobabort[] = {
|
||||||
VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_ACTIVE),
|
VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_ACTIVE),
|
||||||
|
{.name = "postcopy",
|
||||||
|
.type = VSH_OT_BOOL,
|
||||||
|
.help = N_("interrupt post-copy migration")
|
||||||
|
},
|
||||||
{.name = NULL}
|
{.name = NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -6484,11 +6488,21 @@ static bool
|
|||||||
cmdDomjobabort(vshControl *ctl, const vshCmd *cmd)
|
cmdDomjobabort(vshControl *ctl, const vshCmd *cmd)
|
||||||
{
|
{
|
||||||
g_autoptr(virshDomain) dom = NULL;
|
g_autoptr(virshDomain) dom = NULL;
|
||||||
|
unsigned int flags = 0;
|
||||||
|
int rc;
|
||||||
|
|
||||||
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
|
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (virDomainAbortJob(dom) < 0)
|
if (vshCommandOptBool(cmd, "postcopy"))
|
||||||
|
flags |= VIR_DOMAIN_ABORT_JOB_POSTCOPY;
|
||||||
|
|
||||||
|
if (flags == 0)
|
||||||
|
rc = virDomainAbortJob(dom);
|
||||||
|
else
|
||||||
|
rc = virDomainAbortJobFlags(dom, flags);
|
||||||
|
|
||||||
|
if (rc < 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user