mirror of
https://github.com/libvirt/libvirt.git
synced 2026-08-09 04:28:32 -05:00
API/qemu: add async unplug flag to virDomainSetVcpu
Add VIR_DOMAIN_SETVCPU_ASYNC_UNPLUG for virDomainSetVcpu(). Define a dedicated virDomainSetVcpuBehaviour flag type and wire the new flag through the QEMU driver. As with setvcpus async unplug, success indicates request acceptance while final completion is reported by the vcpu-removed event. Update the API documentation and add virsh support for the async path to the setvcpu subcommand. Signed-off-by: Akash Kulhalli <akash.kulhalli@oracle.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
committed by
Peter Krempa
parent
fb2791327e
commit
19e1dcf860
@@ -7837,6 +7837,10 @@ static const vshCmdOptDef opts_setvcpu[] = {
|
||||
.type = VSH_OT_BOOL,
|
||||
.help = N_("disable cpus specified by cpumap")
|
||||
},
|
||||
{.name = "async",
|
||||
.type = VSH_OT_BOOL,
|
||||
.help = N_("return after firing vcpu unplug request")
|
||||
},
|
||||
VIRSH_COMMON_OPT_DOMAIN_CONFIG,
|
||||
VIRSH_COMMON_OPT_DOMAIN_LIVE,
|
||||
VIRSH_COMMON_OPT_DOMAIN_CURRENT,
|
||||
@@ -7851,6 +7855,7 @@ cmdSetvcpu(vshControl *ctl, const vshCmd *cmd)
|
||||
bool disable = vshCommandOptBool(cmd, "disable");
|
||||
bool config = vshCommandOptBool(cmd, "config");
|
||||
bool live = vshCommandOptBool(cmd, "live");
|
||||
bool async = vshCommandOptBool(cmd, "async");
|
||||
const char *vcpulist = NULL;
|
||||
int state = 0;
|
||||
unsigned int flags = VIR_DOMAIN_AFFECT_CURRENT;
|
||||
@@ -7859,11 +7864,14 @@ cmdSetvcpu(vshControl *ctl, const vshCmd *cmd)
|
||||
|
||||
VSH_EXCLUSIVE_OPTIONS("current", "live");
|
||||
VSH_EXCLUSIVE_OPTIONS("current", "config");
|
||||
VSH_EXCLUSIVE_OPTIONS("async", "enable");
|
||||
|
||||
if (config)
|
||||
flags |= VIR_DOMAIN_AFFECT_CONFIG;
|
||||
if (live)
|
||||
flags |= VIR_DOMAIN_AFFECT_LIVE;
|
||||
if (async)
|
||||
flags |= VIR_DOMAIN_SETVCPU_ASYNC_UNPLUG;
|
||||
|
||||
if (!(enable || disable)) {
|
||||
vshError(ctl, "%s", _("one of --enable, --disable is required"));
|
||||
|
||||
Reference in New Issue
Block a user