/* Flags for controlling virtual CPU hot-plugging. */
typedef enum {
- /* Must choose at least one of these two bits; SetVcpus can choose both;
- see virDomainModificationImpact for details. */
+ /* See virDomainModificationImpact for these flags. */
+ VIR_DOMAIN_VCPU_CURRENT = VIR_DOMAIN_AFFECT_CURRENT,
VIR_DOMAIN_VCPU_LIVE = VIR_DOMAIN_AFFECT_LIVE,
VIR_DOMAIN_VCPU_CONFIG = VIR_DOMAIN_AFFECT_CONFIG,
* does not support it or if growing the number is arbitrary limited.
* This function requires privileged access to the hypervisor.
*
- * @flags must include VIR_DOMAIN_AFFECT_LIVE to affect a running
+ * @flags may include VIR_DOMAIN_AFFECT_LIVE to affect a running
* domain (which may fail if domain is not active), or
* VIR_DOMAIN_AFFECT_CONFIG to affect the next boot via the XML
* description of the domain. Both flags may be set.
+ * If neither flag is specified (that is, @flags is VIR_DOMAIN_AFFECT_CURRENT),
+ * then an inactive domain modifies persistent setup, while an active domain
+ * is hypervisor-dependent on whether just live or both live and persistent
+ * state is changed.
*
* If @flags includes VIR_DOMAIN_VCPU_MAXIMUM, then
* VIR_DOMAIN_AFFECT_LIVE must be clear, and only the maximum virtual
* equal to virConnectGetMaxVcpus(). Otherwise, this call affects the
* current virtual CPU limit, which must be less than or equal to the
* maximum limit.
+ * Not all hypervisors can support all flag combinations.
*
* Returns 0 in case of success, -1 in case of failure.
*/
}
/* Perform some argument validation common to all implementations. */
- if (nvcpus < 1 || (unsigned short) nvcpus != nvcpus ||
- (flags & (VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG)) == 0) {
+ if (nvcpus < 1 || (unsigned short) nvcpus != nvcpus) {
virLibDomainError(VIR_ERR_INVALID_ARG, __FUNCTION__);
goto error;
}