/* Additionally, these flags may be bitwise-OR'd in. */
VIR_DOMAIN_VCPU_MAXIMUM = (1 << 2), /* Max rather than current count */
VIR_DOMAIN_VCPU_GUEST = (1 << 3), /* Modify state of the cpu in the guest */
+ VIR_DOMAIN_VCPU_HOTPLUGGABLE = (1 << 4), /* Make vcpus added hot(un)pluggable */
} virDomainVcpuFlags;
int virDomainSetVcpus (virDomainPtr domain,
.type = VSH_OT_BOOL,
.help = N_("modify cpu state in the guest")
},
+ {.name = "hotpluggable",
+ .type = VSH_OT_BOOL,
+ .help = N_("make added vcpus hot(un)pluggable")
+ },
{.name = NULL}
};
bool live = vshCommandOptBool(cmd, "live");
bool current = vshCommandOptBool(cmd, "current");
bool guest = vshCommandOptBool(cmd, "guest");
+ bool hotpluggable = vshCommandOptBool(cmd, "hotpluggable");
unsigned int flags = VIR_DOMAIN_AFFECT_CURRENT;
VSH_EXCLUSIVE_OPTIONS_VAR(current, live);
flags |= VIR_DOMAIN_VCPU_GUEST;
if (maximum)
flags |= VIR_DOMAIN_VCPU_MAXIMUM;
+ if (hotpluggable)
+ flags |= VIR_DOMAIN_VCPU_HOTPLUGGABLE;
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
return false;
on hypervisor.
=item B<setvcpus> I<domain> I<count> [I<--maximum>] [[I<--config>]
-[I<--live>] | [I<--current>]] [I<--guest>]
+[I<--live>] | [I<--current>]] [I<--guest>] [I<--hotpluggable>]
Change the number of virtual CPUs active in a guest domain. By default,
this command works on active guest domains. To change the settings for an
instead of the hypervisor. This flag is usable only for live domains
and may require guest agent to be configured in the guest.
+To allow adding vcpus to persistent definitions that can be later hotunplugged
+after the domain is booted it is necessary to specify the I<--hotpluggable>
+flag. Vcpus added to live domains supporting vcpu unplug are automatically
+marked as hotpluggable.
+
The I<--maximum> flag controls the maximum number of virtual cpus that can
be hot-plugged the next time the domain is booted. As such, it must only be
used with the I<--config> flag, and not with the I<--live> or the I<--current>