[libvirt] Schedule for 0.9.3 release
by Daniel Veillard
As stated before I really want the next release schedule to be aligned
with month end, so I would like to get 0.9.3 out around Friday 1st July,
which means that there is one week left before we enter the feature
freeze. Make sure your patches get reviewed in time this week if they
need to make 0.9.3 :-)
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
daniel(a)veillard.com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
13 years, 5 months
[libvirt] [PATCH] apparmor: implement AppArmorSetFDLabel()
by Jamie Strandboge
During a savevm operation, libvirt will now use fd migration if qemu
supports it. When the AppArmor driver is enabled, AppArmorSetFDLabel()
is used but since this function simply returns '0', the dynamic AppArmor
profile is not updated and AppArmor blocks access to the save file. This
patch implements AppArmorSetFDLabel() to get the pathname of the file by
resolving the fd symlink in /proc, and then gives that pathname to
reload_profile(), which fixes 'virsh save' when AppArmor is enabled.
Passes 'check' and 'syntax-check' (though po_check failed for unrelated
reasons).
Reference: https://launchpad.net/bugs/795800
--
Jamie Strandboge | http://www.canonical.com
13 years, 5 months
[libvirt] [PATCH v3]: set and restore MAC address of a NIC when using PASSTHROUGH mode
by Gerhard Stenzel
This is a another rework of the patch Dirk sent out last week
taking into account most propsosed changes
The following patch addresses the problem that when a PASSTHROUGH
mode DIRECT NIC connection is made the MAC address of the NIC is
not automatically set and reset to the configured VM MAC and
back again.
The attached patch fixes this problem by setting and resetting the MAC
while remembering the previous setting while the VM is running.
This also works if libvirtd is restarted while the VM is running.
the patch passes make syntax-check
Signed-off-by: Dirk Herrendoerfer <d.herrendoerfer at herrendoerfer.name>
Signed-off-by: Gerhard Stenzel <gerhard.stenzel(a)de.ibm.com>
---
Index: libvirt/src/libvirt_macvtap.syms
===================================================================
--- libvirt.orig/src/libvirt_macvtap.syms
+++ libvirt/src/libvirt_macvtap.syms
@@ -5,6 +5,8 @@
# macvtap.h
delMacvtap;
+getMacaddr;
openMacvtapTap;
+setMacaddr;
vpAssociatePortProfileId;
vpDisassociatePortProfileId;
Index: libvirt/src/qemu/qemu_command.c
===================================================================
--- libvirt.orig/src/qemu/qemu_command.c
+++ libvirt/src/qemu/qemu_command.c
@@ -128,7 +128,7 @@ qemuPhysIfaceConnect(virDomainDefPtr def
rc = openMacvtapTap(net->ifname, net->mac, net->data.direct.linkdev,
net->data.direct.mode, vnet_hdr, def->uuid,
&net->data.direct.virtPortProfile, &res_ifname,
- vmop);
+ vmop, driver->stateDir);
if (rc >= 0) {
qemuAuditNetDevice(def, net, res_ifname, true);
VIR_FREE(net->ifname);
@@ -149,7 +149,7 @@ qemuPhysIfaceConnect(virDomainDefPtr def
if (err) {
VIR_FORCE_CLOSE(rc);
delMacvtap(net->ifname, net->mac, net->data.direct.linkdev,
- &net->data.direct.virtPortProfile);
+ net->data.direct.mode, &net->data.direct.virtPortProfile, driver->stateDir);
VIR_FREE(net->ifname);
}
}
Index: libvirt/src/qemu/qemu_process.c
===================================================================
--- libvirt.orig/src/qemu/qemu_process.c
+++ libvirt/src/qemu/qemu_process.c
@@ -2707,7 +2707,8 @@ void qemuProcessStop(struct qemud_driver
virDomainNetDefPtr net = def->nets[i];
if (net->type == VIR_DOMAIN_NET_TYPE_DIRECT) {
delMacvtap(net->ifname, net->mac, net->data.direct.linkdev,
- &net->data.direct.virtPortProfile);
+ net->data.direct.mode,
+ &net->data.direct.virtPortProfile, driver->stateDir);
VIR_FREE(net->ifname);
}
}
Index: libvirt/src/util/macvtap.c
===================================================================
--- libvirt.orig/src/util/macvtap.c
+++ libvirt/src/util/macvtap.c
@@ -87,6 +87,7 @@
# define LLDPAD_PID_FILE "/var/run/lldpad.pid"
+#define MACADDRSIZE 6
enum virVirtualPortOp {
ASSOCIATE = 0x1,
@@ -191,6 +192,149 @@ err_exit:
# if WITH_MACVTAP
+/**
+ * getMacaddr:
+ * Get the MAC address of a network device
+ *
+ * @macaddress: Pointer where the MAC address will be stored
+ * @srcdev: The interface name of the NIC to get the MAC from
+ *
+ * Returns zero in case of success,
+ * negative value otherwise with error reported.
+ *
+ */
+int
+getMacaddr(const unsigned char *macaddress, const char *srcdev )
+{
+ int sockfd;
+ int io;
+ struct ifreq ifr;
+
+ strcpy(ifr.ifr_name, srcdev);
+
+ sockfd = socket(AF_INET, SOCK_STREAM, 0);
+ if(sockfd < 0){
+ return -1;
+ }
+
+ io = ioctl(sockfd, SIOCGIFHWADDR, (char *)&ifr);
+ if(io < 0){
+ return -1;
+ }
+
+ memcpy(macaddress, ifr.ifr_ifru.ifru_hwaddr.sa_data, MACADDRSIZE);
+
+ return 0;
+}
+
+/**
+ * setMacaddr:
+ * Set the MAC address of a network device
+ *
+ * @macaddress: MAC address to assign to the NIC
+ * @srcdev: The interface name of the NIC
+ *
+ * Returns zero in case of success,
+ * negative value otherwise with error reported.
+ *
+ */
+int
+setMacaddr(const unsigned char *macaddress, const char *srcdev )
+{
+ int rc = 0;
+ struct nlmsghdr *resp;
+ struct nlmsgerr *err;
+ struct ifinfomsg ifinfo = { .ifi_family = AF_UNSPEC };
+ int ifindex;
+ unsigned char *recvbuf = NULL;
+ unsigned int recvbuflen;
+ struct nl_msg *nl_msg;
+
+ if (ifaceGetIndex(true, srcdev, &ifindex) != 0)
+ return -1;
+
+ nl_msg = nlmsg_alloc_simple(RTM_SETLINK, NLM_F_REQUEST);
+
+ if (!nl_msg) {
+ virReportOOMError();
+ return -1;
+ }
+
+ if (nlmsg_append(nl_msg, &ifinfo, sizeof(ifinfo), NLMSG_ALIGNTO) < 0)
+ goto buffer_too_small;
+
+ if (nla_put_u32(nl_msg, IFLA_LINK, ifindex) < 0)
+ goto buffer_too_small;
+
+ if (nla_put(nl_msg, IFLA_ADDRESS, MACADDRSIZE, macaddress) < 0)
+ goto buffer_too_small;
+
+ if (srcdev &&
+ nla_put(nl_msg, IFLA_IFNAME, strlen(srcdev)+1, srcdev) < 0)
+ goto buffer_too_small;
+
+ if (nlComm(nl_msg, &recvbuf, &recvbuflen, 0) < 0) {
+ rc = -1;
+ goto err_exit;
+ }
+
+ if (recvbuflen < NLMSG_LENGTH(0) || recvbuf == NULL)
+ goto malformed_resp;
+
+ resp = (struct nlmsghdr *)recvbuf;
+
+ switch (resp->nlmsg_type) {
+ case NLMSG_ERROR:
+ err = (struct nlmsgerr *)NLMSG_DATA(resp);
+ if (resp->nlmsg_len < NLMSG_LENGTH(sizeof(*err)))
+ goto malformed_resp;
+
+ switch (err->error) {
+
+ case 0:
+ break;
+
+ case -EEXIST:
+ rc = -1;
+ break;
+
+ default:
+ macvtapError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("error setting device mac address"));
+ rc = -1;
+ }
+ break;
+
+ case NLMSG_DONE:
+ break;
+
+ default:
+ goto malformed_resp;
+ }
+
+err_exit:
+ nlmsg_free(nl_msg);
+
+ VIR_FREE(recvbuf);
+
+ return rc;
+
+malformed_resp:
+ nlmsg_free(nl_msg);
+
+ macvtapError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("malformed netlink response message"));
+ VIR_FREE(recvbuf);
+ return -1;
+
+buffer_too_small:
+ nlmsg_free(nl_msg);
+
+ macvtapError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("allocated netlink buffer is too small"));
+ return -1;
+}
+
static int
link_add(const char *type,
const unsigned char *macaddress, int macaddrsize,
@@ -575,7 +719,8 @@ openMacvtapTap(const char *tgifname,
const unsigned char *vmuuid,
virVirtualPortProfileParamsPtr virtPortProfile,
char **res_ifname,
- enum virVMOperationType vmOp)
+ enum virVMOperationType vmOp,
+ char *stateDir)
{
const char *type = "macvtap";
int c, rc;
@@ -589,6 +734,54 @@ openMacvtapTap(const char *tgifname,
VIR_DEBUG("%s: VM OPERATION: %s", __FUNCTION__, virVMOperationTypeToString(vmOp));
+ /** Note: When using PASSTHROUGH mode with MACVTAP devices the link
+ * device's MAC address must be set to the VMs MAC address. In
+ * order to not confuse the first switch or bridge in line this MAC
+ * address must be reset when the VM is shut down.
+ * This is especially important when using SRIOV capable cards that
+ * emulate their switch in firmware.
+ */
+ if (mode == VIR_DOMAIN_NETDEV_MACVTAP_MODE_PASSTHRU) {
+ unsigned char oldmac[6];
+
+ rc = getMacaddr(&oldmac, linkdev);
+ if (rc) {
+ virReportSystemError(rc,
+ _("Getting MAC address from '%s' "
+ "to '%02x:%02x:%02x:%02x:%02x:%02x' failed."),
+ linkdev,
+ oldmac[0], oldmac[1], oldmac[2],
+ oldmac[3], oldmac[4], oldmac[5]);
+ } else {
+ char *path = NULL;
+
+ char macstr[VIR_MAC_STRING_BUFLEN];
+ if (virAsprintf(&path, "%s/%s",
+ stateDir,
+ linkdev) < 0) {
+ virReportOOMError();
+ return errno;
+ }
+ virFormatMacAddr(oldmac, macstr);
+ if (virFileWriteStr(path, macstr, O_CREAT|O_TRUNC|O_WRONLY) < 0) {
+ virReportSystemError(errno, _("Unable to preserve mac for %s"),
+ linkdev);
+ return errno;
+ }
+ }
+
+ rc = setMacaddr(macaddress, linkdev);
+ if (rc) {
+ virReportSystemError(errno,
+ _("Setting MAC address on '%s' to "
+ "'%02x:%02x:%02x:%02x:%02x:%02x' failed."),
+ linkdev,
+ macaddress[0], macaddress[1], macaddress[2],
+ macaddress[3], macaddress[4], macaddress[5]);
+ }
+ }
+
+
if (tgifname) {
if(ifaceGetIndex(false, tgifname, &ifindex) == 0) {
if (STRPREFIX(tgifname,
@@ -684,8 +886,43 @@ void
delMacvtap(const char *ifname,
const unsigned char *macaddr,
const char *linkdev,
- virVirtualPortProfileParamsPtr virtPortProfile)
-{
+ int mode,
+ virVirtualPortProfileParamsPtr virtPortProfile,
+ char *stateDir)
+{
+ if (mode == VIR_DOMAIN_NETDEV_MACVTAP_MODE_PASSTHRU) {
+ int ret;
+ char *oldmacname = NULL;
+ char *macstr = NULL;
+ char *path = NULL;
+ unsigned char oldmac[6];
+
+ if (virAsprintf(&path, "%s/%s",
+ stateDir,
+ linkdev) < 0) {
+ virReportOOMError();
+ goto disassociate_exit;
+ }
+
+ if (virFileReadAll(path, VIR_MAC_STRING_BUFLEN, &macstr) < 0) {
+ virReportSystemError(errno, _("Unable to preserve mac for %s"),
+ linkdev);
+ goto disassociate_exit;
+ }
+
+ if (virParseMacAddr(macstr, &oldmac[0]) != 0) {
+ virReportSystemError(VIR_ERR_INTERNAL_ERROR,
+ _("Cannot parse MAC address from '%s'"),
+ oldmacname);
+ }
+
+ /*reset mac and remove file-ignore results*/
+ ret = setMacaddr(oldmac, linkdev);
+ ret = unlink(path);
+ VIR_FREE(macstr);
+ }
+
+disassociate_exit:
if (ifname) {
vpDisassociatePortProfileId(ifname, macaddr,
linkdev,
Index: libvirt/src/util/macvtap.h
===================================================================
--- libvirt.orig/src/util/macvtap.h
+++ libvirt/src/util/macvtap.h
@@ -75,6 +75,10 @@ enum virVMOperationType {
# include "internal.h"
+int getMacaddr(const unsigned char *macaddress, const char *srcdev );
+
+int setMacaddr(const unsigned char *macaddress, const char *srcdev );
+
int openMacvtapTap(const char *ifname,
const unsigned char *macaddress,
const char *linkdev,
@@ -83,12 +87,15 @@ int openMacvtapTap(const char *ifname,
const unsigned char *vmuuid,
virVirtualPortProfileParamsPtr virtPortProfile,
char **res_ifname,
- enum virVMOperationType vmop);
+ enum virVMOperationType vmop,
+ char *stateDir);
void delMacvtap(const char *ifname,
const unsigned char *macaddress,
const char *linkdev,
- virVirtualPortProfileParamsPtr virtPortProfile);
+ int mode,
+ virVirtualPortProfileParamsPtr virtPortProfile,
+ char *stateDir);
int vpAssociatePortProfileId(const char *macvtap_ifname,
const unsigned char *macvtap_macaddr,
Index: libvirt/src/qemu/qemu_hotplug.c
===================================================================
--- libvirt.orig/src/qemu/qemu_hotplug.c
+++ libvirt/src/qemu/qemu_hotplug.c
@@ -1610,7 +1610,7 @@ int qemuDomainDetachNetDevice(struct qem
#if WITH_MACVTAP
if (detach->type == VIR_DOMAIN_NET_TYPE_DIRECT) {
delMacvtap(detach->ifname, detach->mac, detach->data.direct.linkdev,
- &detach->data.direct.virtPortProfile);
+ detach->data.direct.mode, &detach->data.direct.virtPortProfile, driver->stateDir);
VIR_FREE(detach->ifname);
}
#endif
===================================================================
Best regards,
Gerhard Stenzel
-------------------------------------------------------------------------------------
IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschaeftsfuehrung: Dirk Wittkopp
Sitz der Gesellschaft: Boeblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294
13 years, 5 months
[libvirt] [Libvirt-test-API][PATCH] Add a pair of keywords in parser.py for supportting testcases loop
by Nan Zhang
For example:
-----------------
domain:start
guestname
vm1
domain:save start_loop
guestname
vm1
domain:restore end_loop 10
guestname
vm1
domain:destroy
guestname
vm1
-----------------
---
parser.py | 46 +++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 45 insertions(+), 1 deletions(-)
diff --git a/parser.py b/parser.py
index 5b3ce58..e9cce58 100644
--- a/parser.py
+++ b/parser.py
@@ -31,13 +31,18 @@ class CaseFileParser(object):
""" Parser the case configuration file to generate a data list.
"""
def __init__(self, casefile=None, debug=False):
- """ Initialize the list and optionally parse case file. """
self.list = [[]]
self.variables = {}
self.missing_variables = []
self.debug = debug
self.casefile = casefile
self.env = env_parser.Envparser("env.cfg")
+ self.loop_finish = False
+ self.loop_start = 0
+ self.loop_end = 0
+ self.loop_times = 0
+ self.loop_list = []
+
if casefile:
self.parse_file(casefile)
@@ -306,6 +311,7 @@ class CaseFileParser(object):
def parse(self, fh, list):
""" For the testcase name parsing. """
+
while True:
if self.debug:
self.debug_print("the list is", list)
@@ -330,6 +336,44 @@ class CaseFileParser(object):
self.debug_print("we begin to handle the case",
tripped_casename)
+ if self.loop_finish:
+ for i in range(len(list)):
+ self.loop_list.append([])
+
+ i = 0
+ for caselist in list:
+ for j in range(self.loop_start, self.loop_end):
+ self.loop_list[i].append(caselist.pop())
+
+ self.loop_list[i].reverse()
+ self.debug_print("loop_list is", self.loop_list)
+ caselist.extend(self.loop_list[i] * self.loop_times)
+ i += 1
+
+ self.loop_finish = False
+
+ if len(tripped_caselist) == 2 and \
+ tripped_caselist[1] == "start_loop":
+ for caselist in list:
+ newdict = {}
+ newdict[tripped_casename] = {}
+ caselist.append(newdict)
+ self.loop_start = len(caselist) - 1
+ continue
+
+ if len(tripped_caselist) == 3 and \
+ tripped_caselist[1] == "end_loop":
+ looptimes = tripped_caselist[2]
+ self.debug_print("looptimes is", looptimes)
+ self.loop_times = int(looptimes)
+ self.loop_finish = True
+ for caselist in list:
+ newdict = {}
+ newdict[tripped_casename] = {}
+ caselist.append(newdict)
+ self.loop_end = len(caselist)
+ continue
+
if len(tripped_caselist) == 3 and \
tripped_caselist[1] == "times":
times = tripped_caselist[2]
--
1.7.4.4
13 years, 5 months
[libvirt] [PATCH 0/6] Introduce virDomainGetControlInfo API
by Jiri Denemark
The API can be used to query current state of an interface to VMM used
to control a domain.
In QEMU world this translates into monitor connection and one can use the API,
e.g., to check whether (and for how long) libvirtd is currently waiting for a
reply from qemu process.
Jiri Denemark (6):
Introduce virTimeMs for getting current time in ms
Use virTimeMs when appropriate
Introduce virDomainGetControlInfo API
Wire protocol and remote driver for virDomainGetControlInfo
qemu: Implement virDomainGetControlInfo
virsh: Add support for virDomainGetControlInfo
daemon/remote_generator.pl | 20 +++++++---
include/libvirt/libvirt.h.in | 40 +++++++++++++++++++++
python/generator.py | 1 +
python/libvirt-override-api.xml | 6 +++
src/driver.h | 5 +++
src/libvirt.c | 48 ++++++++++++++++++++++++++
src/libvirt_private.syms | 1 +
src/libvirt_public.syms | 5 +++
src/qemu/qemu_domain.c | 28 ++++++---------
src/qemu/qemu_domain.h | 2 +
src/qemu/qemu_driver.c | 72 ++++++++++++++++++++++++++++++++++-----
src/qemu/qemu_migration.c | 31 +++++-----------
src/qemu/qemu_process.c | 3 ++
src/remote/remote_driver.c | 1 +
src/remote/remote_protocol.x | 14 +++++++-
src/remote_protocol-structs | 9 +++++
src/util/event_poll.c | 45 +++++++++---------------
src/util/util.c | 24 +++++++++++++
src/util/util.h | 2 +
tools/virsh.c | 66 +++++++++++++++++++++++++++++++++++
tools/virsh.pod | 7 ++++
21 files changed, 348 insertions(+), 82 deletions(-)
--
1.7.5.3
13 years, 5 months
[libvirt] [PATCH RFC 0/5] support cpu bandwidth in libvirt
by Wen Congyang
I need this feature immediately after CFS bandwidth patchset is merged into
upstream kernel. So I prepare this patchset, and post it here for reviewing
before CFS bandwidth is merged into upstream kernel.
quota is an optional attribute specified in microseconds not a percentage of period.
TODO:
1. quota should be in the range [1000, 18446744073709551(2^64/1000)] or less than 0.
But I only limit it less or equal than 2^64/1000. Does anyone have a better
way to limit quota?
Wen Congyang (5):
cgroup: Implement cpu.cfs_period_us and cpu.cfs_quota_us tuning API
Update XML Schema for new entries
qemu: Implement period and quota tunable XML configuration and
parsing.
qemu: Implement cfs_period and cfs_quota's modification
doc: Add documentation for new cputune elements period and quota
docs/formatdomain.html.in | 19 +++
docs/schemas/domain.rng | 25 ++++-
src/conf/domain_conf.c | 20 +++-
src/conf/domain_conf.h | 2 +
src/libvirt_private.syms | 4 +
src/qemu/qemu_cgroup.c | 43 +++++-
src/qemu/qemu_driver.c | 162 +++++++++++++++++++----
src/util/cgroup.c | 81 +++++++++++-
src/util/cgroup.h | 6 +
tests/qemuxml2argvdata/qemuxml2argv-cputune.xml | 2 +
10 files changed, 328 insertions(+), 36 deletions(-)
13 years, 5 months
[libvirt] [RFC PATCH] Set and reset MAC for PASSTHROUGH mode
by Dirk Herrendoerfer
there is a problem present in libvirt that when a PASSTHROUGH mode
DIRECT NIC connection is made the MAC address of the NIC is not
automatically set and reset to the configured VM MAC and back again.
The attached patch fixes this problem by setting and resetting the MAC
while remembering the previous setting while the VM is running.
This also works if libvirtd is restarted while the VM is running.
The storing of the previous MAC address is done in a link ( currently in /tmp,
but should probably go into /var/run somewhere ).
Best regards
Dirk
13 years, 5 months
[libvirt] [PATCH] Fix documentation of virStreamRecv
by Matthias Bolte
virStreamRecv is for reading.
Also add some missing punctuation to virStreamSend's documentation.
---
src/libvirt.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/libvirt.c b/src/libvirt.c
index 36a90d1..689b065 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -12730,10 +12730,10 @@ virStreamRef(virStreamPtr stream)
* block the calling application for an arbitrary amount
* of time. Once an application has finished sending data
* it should call virStreamFinish to wait for successful
- * confirmation from the driver, or detect any error
+ * confirmation from the driver, or detect any error.
*
* This method may not be used if a stream source has been
- * registered
+ * registered.
*
* Errors are not guaranteed to be reported synchronously
* with the call, but may instead be delayed until a
@@ -12825,10 +12825,10 @@ error:
/**
* virStreamRecv:
* @stream: pointer to the stream object
- * @data: buffer to write to stream
+ * @data: buffer to read into from stream
* @nbytes: size of @data buffer
*
- * Write a series of bytes to the stream. This method may
+ * Reads a series of bytes from the stream. This method may
* block the calling application for an arbitrary amount
* of time.
*
--
1.7.0.4
13 years, 5 months
[libvirt] [PATCH] Deprecate several CURRENT/LIVE/CONFIG enums
by Hu Tao
This patch deprecates following enums:
VIR_DOMAIN_MEM_CURRENT
VIR_DOMAIN_MEM_LIVE
VIR_DOMAIN_MEM_CONFIG
VIR_DOMAIN_VCPU_LIVE
VIR_DOMAIN_VCPU_CONFIG
VIR_DOMAIN_DEVICE_MODIFY_CURRENT
VIR_DOMAIN_DEVICE_MODIFY_LIVE
VIR_DOMAIN_DEVICE_MODIFY_CONFIG
And modify internal codes to use virDomainModifycationImpact.
---
include/libvirt/libvirt.h.in | 69 +++++++++++++++++++-------------
python/generator.py | 6 +++
src/esx/esx_driver.c | 8 ++--
src/libvirt.c | 36 ++++++++--------
src/openvz/openvz_driver.c | 8 ++--
src/qemu/qemu_driver.c | 90 +++++++++++++++++++++---------------------
src/test/test_driver.c | 32 +++++++-------
src/uml/uml_driver.c | 4 +-
src/vbox/vbox_tmpl.c | 20 +++++-----
tools/virsh.c | 52 ++++++++++++------------
10 files changed, 172 insertions(+), 153 deletions(-)
diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
index df213f1..d0378c4 100644
--- a/include/libvirt/libvirt.h.in
+++ b/include/libvirt/libvirt.h.in
@@ -863,15 +863,6 @@ int virDomainGetMemoryParameters(virDomainPtr domain,
virTypedParameterPtr params,
int *nparams, unsigned int flags);
-/* Memory size modification flags. */
-typedef enum {
- VIR_DOMAIN_MEM_CURRENT = 0, /* affect current domain state */
- VIR_DOMAIN_MEM_LIVE = (1 << 0), /* affect active domain */
- VIR_DOMAIN_MEM_CONFIG = (1 << 1), /* affect next boot */
- VIR_DOMAIN_MEM_MAXIMUM = (1 << 2), /* affect Max rather than current */
-} virDomainMemoryModFlags;
-
-
/*
* Dynamic control of domains
*/
@@ -1027,16 +1018,6 @@ struct _virVcpuInfo {
};
typedef virVcpuInfo *virVcpuInfoPtr;
-/* Flags for controlling virtual CPU hot-plugging. */
-typedef enum {
- /* Must choose at least one of these two bits; SetVcpus can choose both */
- VIR_DOMAIN_VCPU_LIVE = (1 << 0), /* Affect active domain */
- VIR_DOMAIN_VCPU_CONFIG = (1 << 1), /* Affect next boot */
-
- /* Additional flags to be bit-wise OR'd in */
- VIR_DOMAIN_VCPU_MAXIMUM = (1 << 2), /* Max rather than current count */
-} virDomainVcpuFlags;
-
int virDomainSetVcpus (virDomainPtr domain,
unsigned int nvcpus);
int virDomainSetVcpusFlags (virDomainPtr domain,
@@ -1136,15 +1117,6 @@ int virDomainGetVcpus (virDomainPtr domain,
#define VIR_GET_CPUMAP(cpumaps,maplen,vcpu) &(cpumaps[(vcpu)*(maplen)])
-typedef enum {
-
- VIR_DOMAIN_DEVICE_MODIFY_CURRENT = 0, /* Modify device allocation based on current domain state */
- VIR_DOMAIN_DEVICE_MODIFY_LIVE = (1 << 0), /* Modify live device allocation */
- VIR_DOMAIN_DEVICE_MODIFY_CONFIG = (1 << 1), /* Modify persisted device allocation */
- VIR_DOMAIN_DEVICE_MODIFY_FORCE = (1 << 2), /* Forcibly modify device
- (ex. force eject a cdrom) */
-} virDomainDeviceModifyFlags;
-
int virDomainAttachDevice(virDomainPtr domain, const char *xml);
int virDomainDetachDevice(virDomainPtr domain, const char *xml);
@@ -2673,6 +2645,47 @@ typedef struct _virTypedParameter virMemoryParameter;
*/
typedef virMemoryParameter *virMemoryParameterPtr;
+/* Memory size modification flags.
+ *
+ * Provided for backwards compatibility; virDomainModificationImpact is
+ * the preferred enum since 0.9.3.
+ */
+typedef enum {
+ VIR_DOMAIN_MEM_CURRENT = VIR_DOMAIN_AFFECT_CURRENT,
+ VIR_DOMAIN_MEM_LIVE = VIR_DOMAIN_AFFECT_LIVE,
+ VIR_DOMAIN_MEM_CONFIG = VIR_DOMAIN_AFFECT_CONFIG,
+
+ VIR_DOMAIN_MEM_MAXIMUM = (1 << 2), /* affect Max rather than current */
+} virDomainMemoryModFlags;
+
+/* Device modification flags.
+ *
+ * Provided for backwards compatibility; virDomainModificationImpact is
+ * the preferred enum since 0.9.3.
+ */
+typedef enum {
+ VIR_DOMAIN_DEVICE_MODIFY_CURRENT = VIR_DOMAIN_AFFECT_CURRENT,
+ VIR_DOMAIN_DEVICE_MODIFY_LIVE = VIR_DOMAIN_AFFECT_LIVE,
+ VIR_DOMAIN_DEVICE_MODIFY_CONFIG = VIR_DOMAIN_AFFECT_CONFIG,
+
+ VIR_DOMAIN_DEVICE_MODIFY_FORCE = (1 << 2), /* Forcibly modify device
+ (ex. force eject a cdrom) */
+} virDomainDeviceModifyFlags;
+
+/* Flags for controlling virtual CPU hot-plugging.
+ *
+ * Provided for backwards compatibility; virDomainModificationImpact is
+ * the preferred enum since 0.9.3.
+ */
+typedef enum {
+ /* Must choose at least one of these two bits; SetVcpus can choose both */
+ VIR_DOMAIN_VCPU_LIVE = VIR_DOMAIN_AFFECT_LIVE,
+ VIR_DOMAIN_VCPU_CONFIG = VIR_DOMAIN_AFFECT_CONFIG,
+
+ /* Additional flags to be bit-wise OR'd in */
+ VIR_DOMAIN_VCPU_MAXIMUM = (1 << 2), /* Max rather than current count */
+} virDomainVcpuFlags;
+
#ifdef __cplusplus
}
#endif
diff --git a/python/generator.py b/python/generator.py
index 7c38fdd..2cbe168 100755
--- a/python/generator.py
+++ b/python/generator.py
@@ -166,6 +166,12 @@ def enum(type, name, value):
value = 5
elif value == 'VIR_TYPED_PARAM_BOOLEAN':
value = 6
+ elif value == 'VIR_DOMAIN_AFFECT_CURRENT':
+ value = 0
+ elif value == 'VIR_DOMAIN_AFFECT_LIVE':
+ value = 1
+ elif value == 'VIR_DOMAIN_AFFECT_CONFIG':
+ value = 2
enums[type][name] = value
#######################################################################
diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c
index a5b96a9..3a140e9 100644
--- a/src/esx/esx_driver.c
+++ b/src/esx/esx_driver.c
@@ -2535,7 +2535,7 @@ esxDomainSetVcpusFlags(virDomainPtr domain, unsigned int nvcpus,
esxVI_TaskInfoState taskInfoState;
char *taskInfoErrorMessage = NULL;
- if (flags != VIR_DOMAIN_VCPU_LIVE) {
+ if (flags != VIR_DOMAIN_AFFECT_LIVE) {
ESX_ERROR(VIR_ERR_INVALID_ARG, _("unsupported flags: (0x%x)"), flags);
return -1;
}
@@ -2606,7 +2606,7 @@ esxDomainSetVcpusFlags(virDomainPtr domain, unsigned int nvcpus,
static int
esxDomainSetVcpus(virDomainPtr domain, unsigned int nvcpus)
{
- return esxDomainSetVcpusFlags(domain, nvcpus, VIR_DOMAIN_VCPU_LIVE);
+ return esxDomainSetVcpusFlags(domain, nvcpus, VIR_DOMAIN_AFFECT_LIVE);
}
@@ -2619,7 +2619,7 @@ esxDomainGetVcpusFlags(virDomainPtr domain, unsigned int flags)
esxVI_ObjectContent *hostSystem = NULL;
esxVI_DynamicProperty *dynamicProperty = NULL;
- if (flags != (VIR_DOMAIN_VCPU_LIVE | VIR_DOMAIN_VCPU_MAXIMUM)) {
+ if (flags != (VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_VCPU_MAXIMUM)) {
ESX_ERROR(VIR_ERR_INVALID_ARG, _("unsupported flags: (0x%x)"), flags);
return -1;
}
@@ -2674,7 +2674,7 @@ esxDomainGetVcpusFlags(virDomainPtr domain, unsigned int flags)
static int
esxDomainGetMaxVcpus(virDomainPtr domain)
{
- return esxDomainGetVcpusFlags(domain, (VIR_DOMAIN_VCPU_LIVE |
+ return esxDomainGetVcpusFlags(domain, (VIR_DOMAIN_AFFECT_LIVE |
VIR_DOMAIN_VCPU_MAXIMUM));
}
diff --git a/src/libvirt.c b/src/libvirt.c
index 18c4e08..463c033 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -2865,12 +2865,12 @@ error:
* to Domain0 i.e. the domain where the application runs.
* This function may requires privileged access to the hypervisor.
*
- * @flags may include VIR_DOMAIN_MEM_LIVE or VIR_DOMAIN_MEM_CONFIG.
- * Both flags may be set. If VIR_DOMAIN_MEM_LIVE is set, the change affects
+ * @flags may include VIR_DOMAIN_AFFECT_LIVE or VIR_DOMAIN_AFFECT_CONFIG.
+ * Both flags may be set. If VIR_DOMAIN_AFFECT_LIVE is set, the change affects
* a running domain and will fail if domain is not active.
- * If VIR_DOMAIN_MEM_CONFIG is set, the change affects persistent state,
+ * If VIR_DOMAIN_AFFECT_CONFIG is set, the change affects persistent state,
* and will fail for transient domains. If neither flag is specified
- * (that is, @flags is VIR_DOMAIN_MEM_CURRENT), then an inactive domain
+ * (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 VIR_DOMAIN_MEM_MAXIMUM is set, the change affects domain's maximum memory
@@ -6514,13 +6514,13 @@ error:
* 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_VCPU_LIVE to affect a running
+ * @flags must include VIR_DOMAIN_AFFECT_LIVE to affect a running
* domain (which may fail if domain is not active), or
- * VIR_DOMAIN_VCPU_CONFIG to affect the next boot via the XML
+ * VIR_DOMAIN_AFFECT_CONFIG to affect the next boot via the XML
* description of the domain. Both flags may be set.
*
* If @flags includes VIR_DOMAIN_VCPU_MAXIMUM, then
- * VIR_DOMAIN_VCPU_LIVE must be clear, and only the maximum virtual
+ * VIR_DOMAIN_AFFECT_LIVE must be clear, and only the maximum virtual
* CPU limit is altered; generally, this value must be less than or
* equal to virConnectGetMaxVcpus(). Otherwise, this call affects the
* current virtual CPU limit, which must be less than or equal to the
@@ -6551,7 +6551,7 @@ virDomainSetVcpusFlags(virDomainPtr domain, unsigned int nvcpus,
/* Perform some argument validation common to all implementations. */
if (nvcpus < 1 || (unsigned short) nvcpus != nvcpus ||
- (flags & (VIR_DOMAIN_VCPU_LIVE | VIR_DOMAIN_VCPU_CONFIG)) == 0) {
+ (flags & (VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG)) == 0) {
virLibDomainError(VIR_ERR_INVALID_ARG, __FUNCTION__);
goto error;
}
@@ -6610,7 +6610,7 @@ virDomainGetVcpusFlags(virDomainPtr domain, unsigned int flags)
}
/* Exactly one of these two flags should be set. */
- if (!(flags & VIR_DOMAIN_VCPU_LIVE) == !(flags & VIR_DOMAIN_VCPU_CONFIG)) {
+ if (!(flags & VIR_DOMAIN_AFFECT_LIVE) == !(flags & VIR_DOMAIN_AFFECT_CONFIG)) {
virLibDomainError(VIR_ERR_INVALID_ARG, __FUNCTION__);
goto error;
}
@@ -6958,11 +6958,11 @@ error:
* @flags: an OR'ed set of virDomainDeviceModifyFlags
*
* Attach a virtual device to a domain, using the flags parameter
- * to control how the device is attached. VIR_DOMAIN_DEVICE_MODIFY_CURRENT
+ * to control how the device is attached. VIR_DOMAIN_AFFECT_CURRENT
* specifies that the device allocation is made based on current domain
- * state. VIR_DOMAIN_DEVICE_MODIFY_LIVE specifies that the device shall be
+ * state. VIR_DOMAIN_AFFECT_LIVE specifies that the device shall be
* allocated to the active domain instance only and is not added to the
- * persisted domain configuration. VIR_DOMAIN_DEVICE_MODIFY_CONFIG
+ * persisted domain configuration. VIR_DOMAIN_AFFECT_CONFIG
* specifies that the device shall be allocated to the persisted domain
* configuration only. Note that the target hypervisor must return an
* error if unable to satisfy flags. E.g. the hypervisor driver will
@@ -7075,11 +7075,11 @@ error:
* @flags: an OR'ed set of virDomainDeviceModifyFlags
*
* Detach a virtual device from a domain, using the flags parameter
- * to control how the device is detached. VIR_DOMAIN_DEVICE_MODIFY_CURRENT
+ * to control how the device is detached. VIR_DOMAIN_AFFECT_CURRENT
* specifies that the device allocation is removed based on current domain
- * state. VIR_DOMAIN_DEVICE_MODIFY_LIVE specifies that the device shall be
+ * state. VIR_DOMAIN_AFFECT_LIVE specifies that the device shall be
* deallocated from the active domain instance only and is not from the
- * persisted domain configuration. VIR_DOMAIN_DEVICE_MODIFY_CONFIG
+ * persisted domain configuration. VIR_DOMAIN_AFFECT_CONFIG
* specifies that the device shall be deallocated from the persisted domain
* configuration only. Note that the target hypervisor must return an
* error if unable to satisfy flags. E.g. the hypervisor driver will
@@ -7137,11 +7137,11 @@ error:
* @flags: an OR'ed set of virDomainDeviceModifyFlags
*
* Change a virtual device on a domain, using the flags parameter
- * to control how the device is changed. VIR_DOMAIN_DEVICE_MODIFY_CURRENT
+ * to control how the device is changed. VIR_DOMAIN_AFFECT_CURRENT
* specifies that the device change is made based on current domain
- * state. VIR_DOMAIN_DEVICE_MODIFY_LIVE specifies that the device shall be
+ * state. VIR_DOMAIN_AFFECT_LIVE specifies that the device shall be
* changed on the active domain instance only and is not added to the
- * persisted domain configuration. VIR_DOMAIN_DEVICE_MODIFY_CONFIG
+ * persisted domain configuration. VIR_DOMAIN_AFFECT_CONFIG
* specifies that the device shall be changed on the persisted domain
* configuration only. Note that the target hypervisor must return an
* error if unable to satisfy flags. E.g. the hypervisor driver will
diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c
index e24b5d8..645e426 100644
--- a/src/openvz/openvz_driver.c
+++ b/src/openvz/openvz_driver.c
@@ -1200,7 +1200,7 @@ static int
openvzDomainGetVcpusFlags(virDomainPtr dom ATTRIBUTE_UNUSED,
unsigned int flags)
{
- if (flags != (VIR_DOMAIN_VCPU_LIVE | VIR_DOMAIN_VCPU_MAXIMUM)) {
+ if (flags != (VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_VCPU_MAXIMUM)) {
openvzError(VIR_ERR_INVALID_ARG, _("unsupported flags (0x%x)"), flags);
return -1;
}
@@ -1210,7 +1210,7 @@ openvzDomainGetVcpusFlags(virDomainPtr dom ATTRIBUTE_UNUSED,
static int openvzDomainGetMaxVcpus(virDomainPtr dom)
{
- return openvzDomainGetVcpusFlags(dom, (VIR_DOMAIN_VCPU_LIVE |
+ return openvzDomainGetVcpusFlags(dom, (VIR_DOMAIN_AFFECT_LIVE |
VIR_DOMAIN_VCPU_MAXIMUM));
}
@@ -1244,7 +1244,7 @@ static int openvzDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
struct openvz_driver *driver = dom->conn->privateData;
int ret = -1;
- if (flags != VIR_DOMAIN_VCPU_LIVE) {
+ if (flags != VIR_DOMAIN_AFFECT_LIVE) {
openvzError(VIR_ERR_INVALID_ARG, _("unsupported flags (0x%x)"), flags);
return -1;
}
@@ -1277,7 +1277,7 @@ cleanup:
static int
openvzDomainSetVcpus(virDomainPtr dom, unsigned int nvcpus)
{
- return openvzDomainSetVcpusFlags(dom, nvcpus, VIR_DOMAIN_VCPU_LIVE);
+ return openvzDomainSetVcpusFlags(dom, nvcpus, VIR_DOMAIN_AFFECT_LIVE);
}
static virDrvOpenStatus openvzOpen(virConnectPtr conn,
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 80de79a..8083707 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -1595,8 +1595,8 @@ static int qemudDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
int ret = -1, r;
bool isActive;
- virCheckFlags(VIR_DOMAIN_MEM_LIVE |
- VIR_DOMAIN_MEM_CONFIG |
+ virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
+ VIR_DOMAIN_AFFECT_CONFIG |
VIR_DOMAIN_MEM_MAXIMUM, -1);
qemuDriverLock(driver);
@@ -1615,26 +1615,26 @@ static int qemudDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
isActive = virDomainObjIsActive(vm);
- if (flags == VIR_DOMAIN_MEM_CURRENT) {
+ if (flags == VIR_DOMAIN_AFFECT_CURRENT) {
if (isActive)
- flags = VIR_DOMAIN_MEM_LIVE;
+ flags = VIR_DOMAIN_AFFECT_LIVE;
else
- flags = VIR_DOMAIN_MEM_CONFIG;
+ flags = VIR_DOMAIN_AFFECT_CONFIG;
}
if (flags == VIR_DOMAIN_MEM_MAXIMUM) {
if (isActive)
- flags = VIR_DOMAIN_MEM_LIVE | VIR_DOMAIN_MEM_MAXIMUM;
+ flags = VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_MEM_MAXIMUM;
else
- flags = VIR_DOMAIN_MEM_CONFIG | VIR_DOMAIN_MEM_MAXIMUM;
+ flags = VIR_DOMAIN_AFFECT_CONFIG | VIR_DOMAIN_MEM_MAXIMUM;
}
- if (!isActive && (flags & VIR_DOMAIN_MEM_LIVE)) {
+ if (!isActive && (flags & VIR_DOMAIN_AFFECT_LIVE)) {
qemuReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("domain is not running"));
goto endjob;
}
- if (flags & VIR_DOMAIN_MEM_CONFIG) {
+ if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
if (!vm->persistent) {
qemuReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("cannot change persistent config of a transient domain"));
@@ -1647,14 +1647,14 @@ static int qemudDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
if (flags & VIR_DOMAIN_MEM_MAXIMUM) {
/* resize the maximum memory */
- if (flags & VIR_DOMAIN_MEM_LIVE) {
+ if (flags & VIR_DOMAIN_AFFECT_LIVE) {
qemuReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("cannot resize the maximum memory on an "
"active domain"));
goto endjob;
}
- if (flags & VIR_DOMAIN_MEM_CONFIG) {
+ if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
/* Help clang 2.8 decipher the logic flow. */
sa_assert(persistentDef);
persistentDef->mem.max_balloon = newmem;
@@ -1673,7 +1673,7 @@ static int qemudDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
goto endjob;
}
- if (flags & VIR_DOMAIN_MEM_LIVE) {
+ if (flags & VIR_DOMAIN_AFFECT_LIVE) {
priv = vm->privateData;
qemuDomainObjEnterMonitor(vm);
r = qemuMonitorSetBalloon(priv->mon, newmem);
@@ -1691,7 +1691,7 @@ static int qemudDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
}
}
- if (flags & VIR_DOMAIN_MEM_CONFIG) {
+ if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
sa_assert(persistentDef);
persistentDef->mem.cur_balloon = newmem;
ret = virDomainSaveConfig(driver->configDir, persistentDef);
@@ -1712,7 +1712,7 @@ cleanup:
static int qemudDomainSetMemory(virDomainPtr dom, unsigned long newmem)
{
- return qemudDomainSetMemoryFlags(dom, newmem, VIR_DOMAIN_MEM_LIVE);
+ return qemudDomainSetMemoryFlags(dom, newmem, VIR_DOMAIN_AFFECT_LIVE);
}
static int qemudDomainSetMaxMemory(virDomainPtr dom, unsigned long memory)
@@ -2760,15 +2760,15 @@ qemudDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
int max;
int ret = -1;
- virCheckFlags(VIR_DOMAIN_VCPU_LIVE |
- VIR_DOMAIN_VCPU_CONFIG |
+ virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
+ VIR_DOMAIN_AFFECT_CONFIG |
VIR_DOMAIN_VCPU_MAXIMUM, -1);
/* At least one of LIVE or CONFIG must be set. MAXIMUM cannot be
* mixed with LIVE. */
- if ((flags & (VIR_DOMAIN_VCPU_LIVE | VIR_DOMAIN_VCPU_CONFIG)) == 0 ||
- (flags & (VIR_DOMAIN_VCPU_MAXIMUM | VIR_DOMAIN_VCPU_LIVE)) ==
- (VIR_DOMAIN_VCPU_MAXIMUM | VIR_DOMAIN_VCPU_LIVE)) {
+ if ((flags & (VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG)) == 0 ||
+ (flags & (VIR_DOMAIN_VCPU_MAXIMUM | VIR_DOMAIN_AFFECT_LIVE)) ==
+ (VIR_DOMAIN_VCPU_MAXIMUM | VIR_DOMAIN_AFFECT_LIVE)) {
qemuReportError(VIR_ERR_INVALID_ARG,
_("invalid flag combination: (0x%x)"), flags);
return -1;
@@ -2794,13 +2794,13 @@ qemudDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
if (qemuDomainObjBeginJob(vm) < 0)
goto cleanup;
- if (!virDomainObjIsActive(vm) && (flags & VIR_DOMAIN_VCPU_LIVE)) {
+ if (!virDomainObjIsActive(vm) && (flags & VIR_DOMAIN_AFFECT_LIVE)) {
qemuReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("domain is not running"));
goto endjob;
}
- if (!vm->persistent && (flags & VIR_DOMAIN_VCPU_CONFIG)) {
+ if (!vm->persistent && (flags & VIR_DOMAIN_AFFECT_CONFIG)) {
qemuReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("cannot change persistent config of a transient domain"));
goto endjob;
@@ -2834,23 +2834,23 @@ qemudDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
goto endjob;
switch (flags) {
- case VIR_DOMAIN_VCPU_MAXIMUM | VIR_DOMAIN_VCPU_CONFIG:
+ case VIR_DOMAIN_VCPU_MAXIMUM | VIR_DOMAIN_AFFECT_CONFIG:
persistentDef->maxvcpus = nvcpus;
if (nvcpus < persistentDef->vcpus)
persistentDef->vcpus = nvcpus;
ret = 0;
break;
- case VIR_DOMAIN_VCPU_CONFIG:
+ case VIR_DOMAIN_AFFECT_CONFIG:
persistentDef->vcpus = nvcpus;
ret = 0;
break;
- case VIR_DOMAIN_VCPU_LIVE:
+ case VIR_DOMAIN_AFFECT_LIVE:
ret = qemudDomainHotplugVcpus(vm, nvcpus);
break;
- case VIR_DOMAIN_VCPU_LIVE | VIR_DOMAIN_VCPU_CONFIG:
+ case VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG:
ret = qemudDomainHotplugVcpus(vm, nvcpus);
if (ret == 0) {
persistentDef->vcpus = nvcpus;
@@ -2859,7 +2859,7 @@ qemudDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
}
/* Save the persistent config to disk */
- if (flags & VIR_DOMAIN_VCPU_CONFIG)
+ if (flags & VIR_DOMAIN_AFFECT_CONFIG)
ret = virDomainSaveConfig(driver->configDir, persistentDef);
endjob:
@@ -2875,7 +2875,7 @@ cleanup:
static int
qemudDomainSetVcpus(virDomainPtr dom, unsigned int nvcpus)
{
- return qemudDomainSetVcpusFlags(dom, nvcpus, VIR_DOMAIN_VCPU_LIVE);
+ return qemudDomainSetVcpusFlags(dom, nvcpus, VIR_DOMAIN_AFFECT_LIVE);
}
@@ -3049,12 +3049,12 @@ qemudDomainGetVcpusFlags(virDomainPtr dom, unsigned int flags)
virDomainDefPtr def;
int ret = -1;
- virCheckFlags(VIR_DOMAIN_VCPU_LIVE |
- VIR_DOMAIN_VCPU_CONFIG |
+ virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
+ VIR_DOMAIN_AFFECT_CONFIG |
VIR_DOMAIN_VCPU_MAXIMUM, -1);
/* Exactly one of LIVE or CONFIG must be set. */
- if (!(flags & VIR_DOMAIN_VCPU_LIVE) == !(flags & VIR_DOMAIN_VCPU_CONFIG)) {
+ if (!(flags & VIR_DOMAIN_AFFECT_LIVE) == !(flags & VIR_DOMAIN_AFFECT_CONFIG)) {
qemuReportError(VIR_ERR_INVALID_ARG,
_("invalid flag combination: (0x%x)"), flags);
return -1;
@@ -3072,7 +3072,7 @@ qemudDomainGetVcpusFlags(virDomainPtr dom, unsigned int flags)
goto cleanup;
}
- if (flags & VIR_DOMAIN_VCPU_LIVE) {
+ if (flags & VIR_DOMAIN_AFFECT_LIVE) {
if (!virDomainObjIsActive(vm)) {
qemuReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("domain not active"));
@@ -3094,7 +3094,7 @@ cleanup:
static int
qemudDomainGetMaxVcpus(virDomainPtr dom)
{
- return qemudDomainGetVcpusFlags(dom, (VIR_DOMAIN_VCPU_LIVE |
+ return qemudDomainGetVcpusFlags(dom, (VIR_DOMAIN_AFFECT_LIVE |
VIR_DOMAIN_VCPU_MAXIMUM));
}
@@ -4458,8 +4458,8 @@ qemuDomainModifyDeviceFlags(virDomainPtr dom, const char *xml,
bool force = (flags & VIR_DOMAIN_DEVICE_MODIFY_FORCE) != 0;
int ret = -1;
- virCheckFlags(VIR_DOMAIN_DEVICE_MODIFY_LIVE |
- VIR_DOMAIN_DEVICE_MODIFY_CONFIG |
+ virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
+ VIR_DOMAIN_AFFECT_CONFIG |
(action == QEMU_DEVICE_UPDATE ?
VIR_DOMAIN_DEVICE_MODIFY_FORCE : 0), -1);
@@ -4477,13 +4477,13 @@ qemuDomainModifyDeviceFlags(virDomainPtr dom, const char *xml,
goto cleanup;
if (virDomainObjIsActive(vm)) {
- if (flags == VIR_DOMAIN_DEVICE_MODIFY_CURRENT)
- flags |= VIR_DOMAIN_DEVICE_MODIFY_LIVE;
+ if (flags == VIR_DOMAIN_AFFECT_CURRENT)
+ flags |= VIR_DOMAIN_AFFECT_LIVE;
} else {
- if (flags == VIR_DOMAIN_DEVICE_MODIFY_CURRENT)
- flags |= VIR_DOMAIN_DEVICE_MODIFY_CONFIG;
+ if (flags == VIR_DOMAIN_AFFECT_CURRENT)
+ flags |= VIR_DOMAIN_AFFECT_CONFIG;
/* check consistency between flags and the vm state */
- if (flags & VIR_DOMAIN_DEVICE_MODIFY_LIVE) {
+ if (flags & VIR_DOMAIN_AFFECT_LIVE) {
qemuReportError(VIR_ERR_OPERATION_INVALID,
"%s",
_("cannot do live update a device on "
@@ -4492,13 +4492,13 @@ qemuDomainModifyDeviceFlags(virDomainPtr dom, const char *xml,
}
}
- if ((flags & VIR_DOMAIN_DEVICE_MODIFY_CONFIG) && !vm->persistent) {
+ if ((flags & VIR_DOMAIN_AFFECT_CONFIG) && !vm->persistent) {
qemuReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("cannot modify device on transient domain"));
goto endjob;
}
- if (flags & VIR_DOMAIN_DEVICE_MODIFY_CONFIG) {
+ if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
dev = virDomainDeviceDefParse(driver->caps, vm->def, xml,
VIR_DOMAIN_XML_INACTIVE);
if (dev == NULL)
@@ -4526,7 +4526,7 @@ qemuDomainModifyDeviceFlags(virDomainPtr dom, const char *xml,
} else
ret = 0;
- if (!ret && (flags & VIR_DOMAIN_DEVICE_MODIFY_LIVE)) {
+ if (!ret && (flags & VIR_DOMAIN_AFFECT_LIVE)) {
/* If dev exists it was created to modify the domain config. Free it. */
virDomainDeviceDefFree(dev);
dev = virDomainDeviceDefParse(driver->caps, vm->def, xml,
@@ -4558,7 +4558,7 @@ qemuDomainModifyDeviceFlags(virDomainPtr dom, const char *xml,
ret = -1;
}
/* Finally, if no error until here, we can save config. */
- if (!ret && (flags & VIR_DOMAIN_DEVICE_MODIFY_CONFIG)) {
+ if (!ret && (flags & VIR_DOMAIN_AFFECT_CONFIG)) {
ret = virDomainSaveConfig(driver->configDir, vmdef);
if (!ret) {
virDomainObjAssignDef(vm, vmdef, false);
@@ -4588,7 +4588,7 @@ static int qemuDomainAttachDeviceFlags(virDomainPtr dom, const char *xml,
static int qemuDomainAttachDevice(virDomainPtr dom, const char *xml)
{
return qemuDomainAttachDeviceFlags(dom, xml,
- VIR_DOMAIN_DEVICE_MODIFY_LIVE);
+ VIR_DOMAIN_AFFECT_LIVE);
}
@@ -4608,7 +4608,7 @@ static int qemuDomainDetachDeviceFlags(virDomainPtr dom, const char *xml,
static int qemuDomainDetachDevice(virDomainPtr dom, const char *xml)
{
return qemuDomainDetachDeviceFlags(dom, xml,
- VIR_DOMAIN_DEVICE_MODIFY_LIVE);
+ VIR_DOMAIN_AFFECT_LIVE);
}
static int qemudDomainGetAutostart(virDomainPtr dom,
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 2da24f1..efb75c7 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -2066,12 +2066,12 @@ testDomainGetVcpusFlags(virDomainPtr domain, unsigned int flags)
virDomainDefPtr def;
int ret = -1;
- virCheckFlags(VIR_DOMAIN_VCPU_LIVE |
- VIR_DOMAIN_VCPU_CONFIG |
+ virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
+ VIR_DOMAIN_AFFECT_CONFIG |
VIR_DOMAIN_VCPU_MAXIMUM, -1);
/* Exactly one of LIVE or CONFIG must be set. */
- if (!(flags & VIR_DOMAIN_VCPU_LIVE) == !(flags & VIR_DOMAIN_VCPU_CONFIG)) {
+ if (!(flags & VIR_DOMAIN_AFFECT_LIVE) == !(flags & VIR_DOMAIN_AFFECT_CONFIG)) {
testError(VIR_ERR_INVALID_ARG,
_("invalid flag combination: (0x%x)"), flags);
return -1;
@@ -2089,7 +2089,7 @@ testDomainGetVcpusFlags(virDomainPtr domain, unsigned int flags)
goto cleanup;
}
- if (flags & VIR_DOMAIN_VCPU_LIVE) {
+ if (flags & VIR_DOMAIN_AFFECT_LIVE) {
if (!virDomainObjIsActive(vm)) {
testError(VIR_ERR_OPERATION_INVALID, "%s",
_("domain not active"));
@@ -2111,7 +2111,7 @@ cleanup:
static int
testDomainGetMaxVcpus(virDomainPtr domain)
{
- return testDomainGetVcpusFlags(domain, (VIR_DOMAIN_VCPU_LIVE |
+ return testDomainGetVcpusFlags(domain, (VIR_DOMAIN_AFFECT_LIVE |
VIR_DOMAIN_VCPU_MAXIMUM));
}
@@ -2124,15 +2124,15 @@ testDomainSetVcpusFlags(virDomainPtr domain, unsigned int nrCpus,
virDomainDefPtr persistentDef;
int ret = -1, maxvcpus;
- virCheckFlags(VIR_DOMAIN_VCPU_LIVE |
- VIR_DOMAIN_VCPU_CONFIG |
+ virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
+ VIR_DOMAIN_AFFECT_CONFIG |
VIR_DOMAIN_VCPU_MAXIMUM, -1);
/* At least one of LIVE or CONFIG must be set. MAXIMUM cannot be
* mixed with LIVE. */
- if ((flags & (VIR_DOMAIN_VCPU_LIVE | VIR_DOMAIN_VCPU_CONFIG)) == 0 ||
- (flags & (VIR_DOMAIN_VCPU_MAXIMUM | VIR_DOMAIN_VCPU_LIVE)) ==
- (VIR_DOMAIN_VCPU_MAXIMUM | VIR_DOMAIN_VCPU_LIVE)) {
+ if ((flags & (VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG)) == 0 ||
+ (flags & (VIR_DOMAIN_VCPU_MAXIMUM | VIR_DOMAIN_AFFECT_LIVE)) ==
+ (VIR_DOMAIN_VCPU_MAXIMUM | VIR_DOMAIN_AFFECT_LIVE)) {
testError(VIR_ERR_INVALID_ARG,
_("invalid flag combination: (0x%x)"), flags);
return -1;
@@ -2152,7 +2152,7 @@ testDomainSetVcpusFlags(virDomainPtr domain, unsigned int nrCpus,
goto cleanup;
}
- if (!virDomainObjIsActive(privdom) && (flags & VIR_DOMAIN_VCPU_LIVE)) {
+ if (!virDomainObjIsActive(privdom) && (flags & VIR_DOMAIN_AFFECT_LIVE)) {
testError(VIR_ERR_OPERATION_INVALID,
"%s", _("cannot hotplug vcpus for an inactive domain"));
goto cleanup;
@@ -2176,23 +2176,23 @@ testDomainSetVcpusFlags(virDomainPtr domain, unsigned int nrCpus,
goto cleanup;
switch (flags) {
- case VIR_DOMAIN_VCPU_MAXIMUM | VIR_DOMAIN_VCPU_CONFIG:
+ case VIR_DOMAIN_VCPU_MAXIMUM | VIR_DOMAIN_AFFECT_CONFIG:
persistentDef->maxvcpus = nrCpus;
if (nrCpus < persistentDef->vcpus)
persistentDef->vcpus = nrCpus;
ret = 0;
break;
- case VIR_DOMAIN_VCPU_CONFIG:
+ case VIR_DOMAIN_AFFECT_CONFIG:
persistentDef->vcpus = nrCpus;
ret = 0;
break;
- case VIR_DOMAIN_VCPU_LIVE:
+ case VIR_DOMAIN_AFFECT_LIVE:
ret = testDomainUpdateVCPUs(domain->conn, privdom, nrCpus, 0);
break;
- case VIR_DOMAIN_VCPU_LIVE | VIR_DOMAIN_VCPU_CONFIG:
+ case VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG:
ret = testDomainUpdateVCPUs(domain->conn, privdom, nrCpus, 0);
if (ret == 0) {
persistentDef->vcpus = nrCpus;
@@ -2209,7 +2209,7 @@ cleanup:
static int
testSetVcpus(virDomainPtr domain, unsigned int nrCpus)
{
- return testDomainSetVcpusFlags(domain, nrCpus, VIR_DOMAIN_VCPU_LIVE);
+ return testDomainSetVcpusFlags(domain, nrCpus, VIR_DOMAIN_AFFECT_LIVE);
}
static int testDomainGetVcpus(virDomainPtr domain,
diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c
index 536cd8c..4427e95 100644
--- a/src/uml/uml_driver.c
+++ b/src/uml/uml_driver.c
@@ -1831,7 +1831,7 @@ cleanup:
static int umlDomainAttachDeviceFlags(virDomainPtr dom,
const char *xml,
unsigned int flags) {
- if (flags & VIR_DOMAIN_DEVICE_MODIFY_CONFIG) {
+ if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
umlReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("cannot modify the persistent configuration of a domain"));
return -1;
@@ -1939,7 +1939,7 @@ cleanup:
static int umlDomainDetachDeviceFlags(virDomainPtr dom,
const char *xml,
unsigned int flags) {
- if (flags & VIR_DOMAIN_DEVICE_MODIFY_CONFIG) {
+ if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
umlReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("cannot modify the persistent configuration of a domain"));
return -1;
diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c
index 2986f5a..f2233a5 100644
--- a/src/vbox/vbox_tmpl.c
+++ b/src/vbox/vbox_tmpl.c
@@ -2044,7 +2044,7 @@ vboxDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
PRUint32 CPUCount = nvcpus;
nsresult rc;
- if (flags != VIR_DOMAIN_VCPU_LIVE) {
+ if (flags != VIR_DOMAIN_AFFECT_LIVE) {
vboxError(VIR_ERR_INVALID_ARG, _("unsupported flags: (0x%x)"), flags);
return -1;
}
@@ -2092,7 +2092,7 @@ vboxDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
static int
vboxDomainSetVcpus(virDomainPtr dom, unsigned int nvcpus)
{
- return vboxDomainSetVcpusFlags(dom, nvcpus, VIR_DOMAIN_VCPU_LIVE);
+ return vboxDomainSetVcpusFlags(dom, nvcpus, VIR_DOMAIN_AFFECT_LIVE);
}
static int
@@ -2102,7 +2102,7 @@ vboxDomainGetVcpusFlags(virDomainPtr dom, unsigned int flags)
ISystemProperties *systemProperties = NULL;
PRUint32 maxCPUCount = 0;
- if (flags != (VIR_DOMAIN_VCPU_LIVE | VIR_DOMAIN_VCPU_MAXIMUM)) {
+ if (flags != (VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_VCPU_MAXIMUM)) {
vboxError(VIR_ERR_INVALID_ARG, _("unsupported flags: (0x%x)"), flags);
return -1;
}
@@ -2127,7 +2127,7 @@ vboxDomainGetVcpusFlags(virDomainPtr dom, unsigned int flags)
static int
vboxDomainGetMaxVcpus(virDomainPtr dom)
{
- return vboxDomainGetVcpusFlags(dom, (VIR_DOMAIN_VCPU_LIVE |
+ return vboxDomainGetVcpusFlags(dom, (VIR_DOMAIN_AFFECT_LIVE |
VIR_DOMAIN_VCPU_MAXIMUM));
}
@@ -5292,7 +5292,7 @@ static int vboxDomainAttachDevice(virDomainPtr dom, const char *xml) {
static int vboxDomainAttachDeviceFlags(virDomainPtr dom, const char *xml,
unsigned int flags) {
- if (flags & VIR_DOMAIN_DEVICE_MODIFY_CONFIG) {
+ if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
vboxError(VIR_ERR_OPERATION_INVALID, "%s",
_("cannot modify the persistent configuration of a domain"));
return -1;
@@ -5303,11 +5303,11 @@ static int vboxDomainAttachDeviceFlags(virDomainPtr dom, const char *xml,
static int vboxDomainUpdateDeviceFlags(virDomainPtr dom, const char *xml,
unsigned int flags) {
- virCheckFlags(VIR_DOMAIN_DEVICE_MODIFY_CURRENT |
- VIR_DOMAIN_DEVICE_MODIFY_LIVE |
- VIR_DOMAIN_DEVICE_MODIFY_CONFIG, -1);
+ virCheckFlags(VIR_DOMAIN_AFFECT_CURRENT |
+ VIR_DOMAIN_AFFECT_LIVE |
+ VIR_DOMAIN_AFFECT_CONFIG, -1);
- if (flags & VIR_DOMAIN_DEVICE_MODIFY_CONFIG) {
+ if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
vboxError(VIR_ERR_OPERATION_INVALID, "%s",
_("cannot modify the persistent configuration of a domain"));
return -1;
@@ -5442,7 +5442,7 @@ cleanup:
static int vboxDomainDetachDeviceFlags(virDomainPtr dom, const char *xml,
unsigned int flags) {
- if (flags & VIR_DOMAIN_DEVICE_MODIFY_CONFIG) {
+ if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
vboxError(VIR_ERR_OPERATION_INVALID, "%s",
_("cannot modify the persistent configuration of a domain"));
return -1;
diff --git a/tools/virsh.c b/tools/virsh.c
index d98be1c..5663f3f 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -2718,7 +2718,7 @@ cmdVcpucount(vshControl *ctl, const vshCmd *cmd)
* up. */
if (all || (maximum && config)) {
count = virDomainGetVcpusFlags(dom, (VIR_DOMAIN_VCPU_MAXIMUM |
- VIR_DOMAIN_VCPU_CONFIG));
+ VIR_DOMAIN_AFFECT_CONFIG));
if (count < 0 && (last_error->code == VIR_ERR_NO_SUPPORT
|| last_error->code == VIR_ERR_INVALID_ARG)) {
char *tmp;
@@ -2748,7 +2748,7 @@ cmdVcpucount(vshControl *ctl, const vshCmd *cmd)
if (all || (maximum && live)) {
count = virDomainGetVcpusFlags(dom, (VIR_DOMAIN_VCPU_MAXIMUM |
- VIR_DOMAIN_VCPU_LIVE));
+ VIR_DOMAIN_AFFECT_LIVE));
if (count < 0 && (last_error->code == VIR_ERR_NO_SUPPORT
|| last_error->code == VIR_ERR_INVALID_ARG)) {
count = virDomainGetMaxVcpus(dom);
@@ -2768,7 +2768,7 @@ cmdVcpucount(vshControl *ctl, const vshCmd *cmd)
}
if (all || (current && config)) {
- count = virDomainGetVcpusFlags(dom, VIR_DOMAIN_VCPU_CONFIG);
+ count = virDomainGetVcpusFlags(dom, VIR_DOMAIN_AFFECT_CONFIG);
if (count < 0 && (last_error->code == VIR_ERR_NO_SUPPORT
|| last_error->code == VIR_ERR_INVALID_ARG)) {
char *tmp, *end;
@@ -2805,7 +2805,7 @@ cmdVcpucount(vshControl *ctl, const vshCmd *cmd)
}
if (all || (current && live)) {
- count = virDomainGetVcpusFlags(dom, VIR_DOMAIN_VCPU_LIVE);
+ count = virDomainGetVcpusFlags(dom, VIR_DOMAIN_AFFECT_LIVE);
if (count < 0 && (last_error->code == VIR_ERR_NO_SUPPORT
|| last_error->code == VIR_ERR_INVALID_ARG)) {
virDomainInfo info;
@@ -3078,8 +3078,8 @@ cmdSetvcpus(vshControl *ctl, const vshCmd *cmd)
int config = vshCommandOptBool(cmd, "config");
int live = vshCommandOptBool(cmd, "live");
int flags = ((maximum ? VIR_DOMAIN_VCPU_MAXIMUM : 0) |
- (config ? VIR_DOMAIN_VCPU_CONFIG : 0) |
- (live ? VIR_DOMAIN_VCPU_LIVE : 0));
+ (config ? VIR_DOMAIN_AFFECT_CONFIG : 0) |
+ (live ? VIR_DOMAIN_AFFECT_LIVE : 0));
if (!vshConnectionUsability(ctl, ctl->conn))
return false;
@@ -3195,12 +3195,12 @@ cmdSetmem(vshControl *ctl, const vshCmd *cmd)
vshError(ctl, "%s", _("--current must be specified exclusively"));
return false;
}
- flags = VIR_DOMAIN_MEM_CURRENT;
+ flags = VIR_DOMAIN_AFFECT_CURRENT;
} else {
if (config)
- flags |= VIR_DOMAIN_MEM_CONFIG;
+ flags |= VIR_DOMAIN_AFFECT_CONFIG;
if (live)
- flags |= VIR_DOMAIN_MEM_LIVE;
+ flags |= VIR_DOMAIN_AFFECT_LIVE;
/* neither option is specified */
if (!live && !config)
flags = -1;
@@ -3286,9 +3286,9 @@ cmdSetmaxmem(vshControl *ctl, const vshCmd *cmd)
}
} else {
if (config)
- flags |= VIR_DOMAIN_MEM_CONFIG;
+ flags |= VIR_DOMAIN_AFFECT_CONFIG;
if (live)
- flags |= VIR_DOMAIN_MEM_LIVE;
+ flags |= VIR_DOMAIN_AFFECT_LIVE;
/* neither option is specified */
if (!live && !config)
flags = -1;
@@ -9281,9 +9281,9 @@ cmdAttachDevice(vshControl *ctl, const vshCmd *cmd)
}
if (vshCommandOptBool(cmd, "persistent")) {
- flags = VIR_DOMAIN_DEVICE_MODIFY_CONFIG;
+ flags = VIR_DOMAIN_AFFECT_CONFIG;
if (virDomainIsActive(dom) == 1)
- flags |= VIR_DOMAIN_DEVICE_MODIFY_LIVE;
+ flags |= VIR_DOMAIN_AFFECT_LIVE;
ret = virDomainAttachDeviceFlags(dom, buffer, flags);
} else {
ret = virDomainAttachDevice(dom, buffer);
@@ -9346,9 +9346,9 @@ cmdDetachDevice(vshControl *ctl, const vshCmd *cmd)
}
if (vshCommandOptBool(cmd, "persistent")) {
- flags = VIR_DOMAIN_DEVICE_MODIFY_CONFIG;
+ flags = VIR_DOMAIN_AFFECT_CONFIG;
if (virDomainIsActive(dom) == 1)
- flags |= VIR_DOMAIN_DEVICE_MODIFY_LIVE;
+ flags |= VIR_DOMAIN_AFFECT_LIVE;
ret = virDomainDetachDeviceFlags(dom, buffer, flags);
} else {
ret = virDomainDetachDevice(dom, buffer);
@@ -9412,11 +9412,11 @@ cmdUpdateDevice(vshControl *ctl, const vshCmd *cmd)
}
if (vshCommandOptBool(cmd, "persistent")) {
- flags = VIR_DOMAIN_DEVICE_MODIFY_CONFIG;
+ flags = VIR_DOMAIN_AFFECT_CONFIG;
if (virDomainIsActive(dom) == 1)
- flags |= VIR_DOMAIN_DEVICE_MODIFY_LIVE;
+ flags |= VIR_DOMAIN_AFFECT_LIVE;
} else {
- flags = VIR_DOMAIN_DEVICE_MODIFY_LIVE;
+ flags = VIR_DOMAIN_AFFECT_LIVE;
}
if (vshCommandOptBool(cmd, "force"))
@@ -9528,9 +9528,9 @@ cmdAttachInterface(vshControl *ctl, const vshCmd *cmd)
xml = virBufferContentAndReset(&buf);
if (vshCommandOptBool(cmd, "persistent")) {
- flags = VIR_DOMAIN_DEVICE_MODIFY_CONFIG;
+ flags = VIR_DOMAIN_AFFECT_CONFIG;
if (virDomainIsActive(dom) == 1)
- flags |= VIR_DOMAIN_DEVICE_MODIFY_LIVE;
+ flags |= VIR_DOMAIN_AFFECT_LIVE;
ret = virDomainAttachDeviceFlags(dom, xml, flags);
} else {
ret = virDomainAttachDevice(dom, xml);
@@ -9667,9 +9667,9 @@ cmdDetachInterface(vshControl *ctl, const vshCmd *cmd)
}
if (vshCommandOptBool(cmd, "persistent")) {
- flags = VIR_DOMAIN_DEVICE_MODIFY_CONFIG;
+ flags = VIR_DOMAIN_AFFECT_CONFIG;
if (virDomainIsActive(dom) == 1)
- flags |= VIR_DOMAIN_DEVICE_MODIFY_LIVE;
+ flags |= VIR_DOMAIN_AFFECT_LIVE;
ret = virDomainDetachDeviceFlags(dom,
(char *)xmlBufferContent(xml_buf),
flags);
@@ -9805,9 +9805,9 @@ cmdAttachDisk(vshControl *ctl, const vshCmd *cmd)
xml = virBufferContentAndReset(&buf);
if (vshCommandOptBool(cmd, "persistent")) {
- flags = VIR_DOMAIN_DEVICE_MODIFY_CONFIG;
+ flags = VIR_DOMAIN_AFFECT_CONFIG;
if (virDomainIsActive(dom) == 1)
- flags |= VIR_DOMAIN_DEVICE_MODIFY_LIVE;
+ flags |= VIR_DOMAIN_AFFECT_LIVE;
ret = virDomainAttachDeviceFlags(dom, xml, flags);
} else {
ret = virDomainAttachDevice(dom, xml);
@@ -9927,9 +9927,9 @@ cmdDetachDisk(vshControl *ctl, const vshCmd *cmd)
}
if (vshCommandOptBool(cmd, "persistent")) {
- flags = VIR_DOMAIN_DEVICE_MODIFY_CONFIG;
+ flags = VIR_DOMAIN_AFFECT_CONFIG;
if (virDomainIsActive(dom) == 1)
- flags |= VIR_DOMAIN_DEVICE_MODIFY_LIVE;
+ flags |= VIR_DOMAIN_AFFECT_LIVE;
ret = virDomainDetachDeviceFlags(dom,
(char *)xmlBufferContent(xml_buf),
flags);
--
1.7.3.1
13 years, 5 months