[libvirt] [RFC PATCH] qemu: Fail APIs not allowed during async job
by Jiri Denemark
When an asynchronous job is running while another API that is
incompatible with that job is called, we now try to wait until the job
finishes and either run the API or fail with timeout. I guess nicer
solution is to just fail such API immediately and let the application
retry once the asynchronous job ends.
---
src/qemu/THREADS.txt | 5 ++---
src/qemu/qemu_domain.c | 28 +++++++++++++++-------------
2 files changed, 17 insertions(+), 16 deletions(-)
diff --git a/src/qemu/THREADS.txt b/src/qemu/THREADS.txt
index 3a27a85..9183f1f 100644
--- a/src/qemu/THREADS.txt
+++ b/src/qemu/THREADS.txt
@@ -69,8 +69,7 @@ There are a number of locks on various objects
specify what kind of action it is about to take and this is checked
against the allowed set of jobs in case an asynchronous job is
running. If the job is incompatible with current asynchronous job,
- it needs to wait until the asynchronous job ends and try to acquire
- the job again.
+ the operation fails.
Immediately after acquiring the virDomainObjPtr lock, any method
which intends to update state must acquire either asynchronous or
@@ -80,7 +79,7 @@ There are a number of locks on various objects
whenever it hits a piece of code which may sleep/wait, and
re-acquire it after the sleep/wait. Whenever an asynchronous job
wants to talk to the monitor, it needs to acquire nested job (a
- special kind of normla job) to obtain exclusive access to the
+ special kind of normal job) to obtain exclusive access to the
monitor.
Since the virDomainObjPtr lock was dropped while waiting for the
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index f9755a4..b2a36ad 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -723,21 +723,25 @@ qemuDomainObjBeginJobInternal(struct qemud_driver *driver,
if (driver_locked)
qemuDriverUnlock(driver);
-retry:
- while (!nested && !qemuDomainJobAllowed(priv, job)) {
- if (virCondWaitUntil(&priv->job.asyncCond, &obj->lock, then) < 0)
- goto error;
- }
+ if (!nested && !qemuDomainJobAllowed(priv, job))
+ goto not_allowed;
while (priv->job.active) {
- if (virCondWaitUntil(&priv->job.cond, &obj->lock, then) < 0)
+ if (virCondWaitUntil(&priv->job.cond, &obj->lock, then) < 0) {
+ if (errno == ETIMEDOUT)
+ qemuReportError(VIR_ERR_OPERATION_TIMEOUT,
+ "%s", _("cannot acquire state change lock"));
+ else
+ virReportSystemError(errno,
+ "%s", _("cannot acquire job mutex"));
goto error;
+ }
}
/* No job is active but a new async job could have been started while obj
* was unlocked, so we need to recheck it. */
if (!nested && !qemuDomainJobAllowed(priv, job))
- goto retry;
+ goto not_allowed;
qemuDomainObjResetJob(priv);
@@ -759,13 +763,11 @@ retry:
return 0;
+not_allowed:
+ qemuReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("incompatible job is running"));
+
error:
- if (errno == ETIMEDOUT)
- qemuReportError(VIR_ERR_OPERATION_TIMEOUT,
- "%s", _("cannot acquire state change lock"));
- else
- virReportSystemError(errno,
- "%s", _("cannot acquire job mutex"));
if (driver_locked) {
virDomainObjUnlock(obj);
qemuDriverLock(driver);
--
1.7.6
13 years, 4 months
[libvirt] [PATCH] docs: Fix spice documentation typo
by Michal Privoznik
We missed ending tag for paragraph element
---
docs/formatdomain.html.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 269fc30..a54ee6a 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -1989,7 +1989,7 @@ qemu-kvm -net nic,model=? /dev/null
the <code>copypaste</code> property
to <code>no</code>, <span class="since">since
0.9.3</span>.
- </>
+ </p>
</dd>
<dt><code>"rdp"</code></dt>
<dd>
--
1.7.5.rc3
13 years, 4 months
[libvirt] [PATCH] network: avoid memory leak on cleanup
by ajia@redhat.com
* src/network/bridge_driver.c: Fix memory leak on cleanup section from
networkGetBridgeName function.
---
src/network/bridge_driver.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 0a12bc0..59e780d 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -2474,7 +2474,8 @@ static char *networkGetBridgeName(virNetworkPtr net) {
cleanup:
if (network)
virNetworkObjUnlock(network);
- return bridge;
+ VIR_FREE(bridge);
+ return NULL;
}
static int networkGetAutostart(virNetworkPtr net,
--
1.7.1
13 years, 4 months
[libvirt] [PATCH] storage: fix volDelete return when volume still being allocated
by Matthew Booth
volDelete used to return VIR_ERR_INTERNAL_ERROR when attempting to delete a
volume which was still being allocated. It should return
VIR_ERR_OPERATION_INVALID.
* src/storage/storage_driver.c: Fix return of volDelete.
---
src/storage/storage_driver.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
index 2da2feb..d9c2137 100644
--- a/src/storage/storage_driver.c
+++ b/src/storage/storage_driver.c
@@ -1914,7 +1914,7 @@ storageVolumeDelete(virStorageVolPtr obj,
}
if (vol->building) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
+ virStorageReportError(VIR_ERR_OPERATION_INVALID,
_("volume '%s' is still being allocated."),
vol->name);
goto cleanup;
--
1.7.4.4
13 years, 4 months
[libvirt] [PATCH] virsh: Avoid undefine active interface
by ajia@redhat.com
* tools/virsh.c: libvirt should check if current interface is active before
undefine the interface, and don't allow to undefine a active interface.
---
tools/virsh.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c
index bd6fea7..899bf25 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -5675,6 +5675,16 @@ cmdInterfaceUndefine(vshControl *ctl, const vshCmd *cmd)
if (!(iface = vshCommandOptInterface(ctl, cmd, &name)))
return false;
+ if (virInterfaceIsActive(iface)) {
+ vshError(ctl,
+ _("a active interface like %s cannot be undefined;\n"
+ "to undefine, first destroy then undefine"
+ " using its name or MAC address"),
+ name);
+ virInterfaceFree(iface);
+ return false;
+ }
+
if (virInterfaceUndefine(iface) == 0) {
vshPrint(ctl, _("Interface %s undefined\n"), name);
} else {
--
1.7.1
13 years, 4 months
[libvirt] [PATCH] command: avoid fd leak on failure
by Eric Blake
virCommandTransferFD promises that the fd is no longer owned by
the caller. Normally, we want the fd to remain open until the
child runs, but in error situations, we must close it earlier.
* src/util/command.c (virCommandTransferFD): Close fd now if we
can't track it to close later.
---
src/util/command.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/util/command.c b/src/util/command.c
index 3c516ec..83d4e88 100644
--- a/src/util/command.c
+++ b/src/util/command.c
@@ -738,7 +738,7 @@ virCommandKeepFD(virCommandPtr cmd, int fd, bool transfer)
void
virCommandPreserveFD(virCommandPtr cmd, int fd)
{
- return virCommandKeepFD(cmd, fd, false);
+ virCommandKeepFD(cmd, fd, false);
}
/*
@@ -749,7 +749,13 @@ virCommandPreserveFD(virCommandPtr cmd, int fd)
void
virCommandTransferFD(virCommandPtr cmd, int fd)
{
- return virCommandKeepFD(cmd, fd, true);
+ virCommandKeepFD(cmd, fd, true);
+ if ((!cmd || cmd->has_error) && fd > STDERR_FILENO) {
+ /* We must close the fd now, instead of waiting for
+ * virCommandRun, if there was an error that prevented us from
+ * adding the fd to cmd. */
+ VIR_FORCE_CLOSE(fd);
+ }
}
--
1.7.4.4
13 years, 4 months
[libvirt] [PATCH v2] qemu: Fix a regression of attaching device
by Osier Yang
The regression is introduced by Commit da1eba6b, the new
codes with this commit doesn't reset "ret" to "-1" when
it fails on parsing the device XML (live device attachment)
This patch changes the codes to reset the "ret" and "-1",
and also changes the codes so that it don't modify "ret"
for condition checking.
How to reproduce:
<disk type='oops' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/var/lib/libvirt/images/test.img'/>
<target dev='vda' bus='virtio'/>
</disk>
Device attached successfully
---
src/qemu/qemu_driver.c | 23 +++++++++++++++++------
1 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 3d4207e..73118fd 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -4903,16 +4903,20 @@ qemuDomainModifyDeviceFlags(virDomainPtr dom, const char *xml,
_("unknown domain modify action %d"), action);
break;
}
- } else
- ret = 0;
- if (!ret && (flags & VIR_DOMAIN_AFFECT_LIVE)) {
+ if (ret == -1)
+ goto endjob;
+ }
+
+ if (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,
VIR_DOMAIN_XML_INACTIVE);
- if (dev == NULL)
+ if (dev == NULL) {
+ ret = -1;
goto endjob;
+ }
switch (action) {
case QEMU_DEVICE_ATTACH:
@@ -4927,18 +4931,25 @@ qemuDomainModifyDeviceFlags(virDomainPtr dom, const char *xml,
default:
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("unknown domain modify action %d"), action);
+ ret = -1;
break;
}
+
+ if (ret == -1)
+ goto endjob;
/*
* update domain status forcibly because the domain status may be
* changed even if we attach the device failed. For example, a
* For example, a new controller may be created.
*/
- if (virDomainSaveStatus(driver->caps, driver->stateDir, vm) < 0)
+ if (virDomainSaveStatus(driver->caps, driver->stateDir, vm) < 0) {
ret = -1;
+ goto endjob;
+ }
}
+
/* Finally, if no error until here, we can save config. */
- if (!ret && (flags & VIR_DOMAIN_AFFECT_CONFIG)) {
+ if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
ret = virDomainSaveConfig(driver->configDir, vmdef);
if (!ret) {
virDomainObjAssignDef(vm, vmdef, false);
--
1.7.6
13 years, 4 months
[libvirt] [PATCH 0/4] support the listenNetwork attribute in <graphics>
by Laine Stump
This patch series resolves the following bug:
https://bugzilla.redhat.com/show_bug.cgi?id=703851
In short, it implements support for a new "listenNetwork" attribute in
the domain's <graphics> element. When listenNetwork is specified,
libvirt will look for a network of that name (from the networks that
can be created within libvirt), and derive a listen address from the
physical interface used to connect that network to the outside
world. (More details are given in each commit message).
This patch series is meant to be applied on top of the series I sent
on Tuesday:
network: physical device abstraction aka 'virtual switch'
https://www.redhat.com/archives/libvir-list/2011-July/msg00149.html
Don't attempt to apply it by itself!
Note that I'm not particularly fond of the attribute name (it's too
long and has the ugly capital letter in the middle). If anyone has a
suggestion for something better, please give your opinion now, before
it's pushed and becomes permanent!
13 years, 4 months
[libvirt] [PATCH] build: also track RPC on-wire enum values
by Eric Blake
As long as we guarantee RPC struct layout stability, we might as
well also guarantee RPC enum value constancy.
* src/Makefile.am (r1, r2, PDWTAGS): Adjust rule to pick up named
and anonymous enums.
* src/remote_protocol-structs: Add enum values.
* src/qemu_protocol-structs: Likewise.
* src/virnetprotocol-structs: Likewise.
---
src/Makefile.am | 12 ++-
src/qemu_protocol-structs | 4 +
src/remote_protocol-structs | 245 +++++++++++++++++++++++++++++++++++++++++++
src/virnetprotocol-structs | 11 ++
4 files changed, 267 insertions(+), 5 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index d19d1ca..f528860 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -206,18 +206,20 @@ EXTRA_DIST += $(REMOTE_DRIVER_PROTOCOL) \
# With pdwtags 1.8, --verbose output includes separators like these:
# /* 93 */
# /* <0> (null):0 */
-# whereas with pdwtags 1.3, they look like this:
+# with the second line omitted for intrinsic types.
+# Whereas with pdwtags 1.3, they look like this:
# /* <2d2> /usr/include/libio.h:180 */
# The concatenation of the following regexps matches both cases.
-r1 = (?:/\* \d+ \*/\n)?
-r2 = /\* <[[:xdigit:]]+> \S+:\d+ \*/
+r1 = (?:/\* \d+ \*/)
+r2 = (?:/\* <[[:xdigit:]]+> \S+:\d+ \*/)
PDWTAGS = \
$(AM_V_GEN)if (pdwtags --help) > /dev/null 2>&1; then \
pdwtags --verbose $(<:.lo=.$(OBJEXT)) \
| perl -0777 -n \
- -e 'foreach my $$p (split m!\n\n$(r1)$(r2)\n!) {' \
- -e ' if ($$p =~ /^struct (remote_|qemu_|virNet)/) {' \
+ -e 'foreach my $$p (split m!\n*($(r1)|$(r2))\n!) {' \
+ -e ' if ($$p =~ /^(struct|enum) (remote_|qemu_|virNet)/ ||' \
+ -e ' $$p =~ /^enum {/) {' \
-e ' $$p =~ s!\t*/\*.*?\*/!!sg;' \
-e ' $$p =~ s!\s+\n!\n!sg;' \
-e ' $$p =~ s!\s+$$!!;' \
diff --git a/src/qemu_protocol-structs b/src/qemu_protocol-structs
index e284b59..0397471 100644
--- a/src/qemu_protocol-structs
+++ b/src/qemu_protocol-structs
@@ -19,3 +19,7 @@ struct qemu_domain_attach_args {
struct qemu_domain_attach_ret {
remote_nonnull_domain dom;
};
+enum qemu_procedure {
+ QEMU_PROC_MONITOR_COMMAND = 1,
+ QEMU_PROC_DOMAIN_ATTACH = 2,
+};
diff --git a/src/remote_protocol-structs b/src/remote_protocol-structs
index b2de8e9..221562d 100644
--- a/src/remote_protocol-structs
+++ b/src/remote_protocol-structs
@@ -1,4 +1,12 @@
/* -*- c -*- */
+enum {
+ VIR_TYPED_PARAM_INT = 1,
+ VIR_TYPED_PARAM_UINT = 2,
+ VIR_TYPED_PARAM_LLONG = 3,
+ VIR_TYPED_PARAM_ULLONG = 4,
+ VIR_TYPED_PARAM_DOUBLE = 5,
+ VIR_TYPED_PARAM_BOOLEAN = 6,
+};
struct remote_nonnull_domain {
remote_nonnull_string name;
remote_uuid uuid;
@@ -50,6 +58,11 @@ struct remote_error {
int int2;
remote_network net;
};
+enum remote_auth_type {
+ REMOTE_AUTH_NONE = 0,
+ REMOTE_AUTH_SASL = 1,
+ REMOTE_AUTH_POLKIT = 2,
+};
struct remote_vcpu_info {
u_int number;
int state;
@@ -1615,3 +1628,235 @@ struct remote_domain_get_control_info_ret {
u_int details;
uint64_t stateTime;
};
+enum remote_procedure {
+ REMOTE_PROC_OPEN = 1,
+ REMOTE_PROC_CLOSE = 2,
+ REMOTE_PROC_GET_TYPE = 3,
+ REMOTE_PROC_GET_VERSION = 4,
+ REMOTE_PROC_GET_MAX_VCPUS = 5,
+ REMOTE_PROC_NODE_GET_INFO = 6,
+ REMOTE_PROC_GET_CAPABILITIES = 7,
+ REMOTE_PROC_DOMAIN_ATTACH_DEVICE = 8,
+ REMOTE_PROC_DOMAIN_CREATE = 9,
+ REMOTE_PROC_DOMAIN_CREATE_XML = 10,
+ REMOTE_PROC_DOMAIN_DEFINE_XML = 11,
+ REMOTE_PROC_DOMAIN_DESTROY = 12,
+ REMOTE_PROC_DOMAIN_DETACH_DEVICE = 13,
+ REMOTE_PROC_DOMAIN_GET_XML_DESC = 14,
+ REMOTE_PROC_DOMAIN_GET_AUTOSTART = 15,
+ REMOTE_PROC_DOMAIN_GET_INFO = 16,
+ REMOTE_PROC_DOMAIN_GET_MAX_MEMORY = 17,
+ REMOTE_PROC_DOMAIN_GET_MAX_VCPUS = 18,
+ REMOTE_PROC_DOMAIN_GET_OS_TYPE = 19,
+ REMOTE_PROC_DOMAIN_GET_VCPUS = 20,
+ REMOTE_PROC_LIST_DEFINED_DOMAINS = 21,
+ REMOTE_PROC_DOMAIN_LOOKUP_BY_ID = 22,
+ REMOTE_PROC_DOMAIN_LOOKUP_BY_NAME = 23,
+ REMOTE_PROC_DOMAIN_LOOKUP_BY_UUID = 24,
+ REMOTE_PROC_NUM_OF_DEFINED_DOMAINS = 25,
+ REMOTE_PROC_DOMAIN_PIN_VCPU = 26,
+ REMOTE_PROC_DOMAIN_REBOOT = 27,
+ REMOTE_PROC_DOMAIN_RESUME = 28,
+ REMOTE_PROC_DOMAIN_SET_AUTOSTART = 29,
+ REMOTE_PROC_DOMAIN_SET_MAX_MEMORY = 30,
+ REMOTE_PROC_DOMAIN_SET_MEMORY = 31,
+ REMOTE_PROC_DOMAIN_SET_VCPUS = 32,
+ REMOTE_PROC_DOMAIN_SHUTDOWN = 33,
+ REMOTE_PROC_DOMAIN_SUSPEND = 34,
+ REMOTE_PROC_DOMAIN_UNDEFINE = 35,
+ REMOTE_PROC_LIST_DEFINED_NETWORKS = 36,
+ REMOTE_PROC_LIST_DOMAINS = 37,
+ REMOTE_PROC_LIST_NETWORKS = 38,
+ REMOTE_PROC_NETWORK_CREATE = 39,
+ REMOTE_PROC_NETWORK_CREATE_XML = 40,
+ REMOTE_PROC_NETWORK_DEFINE_XML = 41,
+ REMOTE_PROC_NETWORK_DESTROY = 42,
+ REMOTE_PROC_NETWORK_GET_XML_DESC = 43,
+ REMOTE_PROC_NETWORK_GET_AUTOSTART = 44,
+ REMOTE_PROC_NETWORK_GET_BRIDGE_NAME = 45,
+ REMOTE_PROC_NETWORK_LOOKUP_BY_NAME = 46,
+ REMOTE_PROC_NETWORK_LOOKUP_BY_UUID = 47,
+ REMOTE_PROC_NETWORK_SET_AUTOSTART = 48,
+ REMOTE_PROC_NETWORK_UNDEFINE = 49,
+ REMOTE_PROC_NUM_OF_DEFINED_NETWORKS = 50,
+ REMOTE_PROC_NUM_OF_DOMAINS = 51,
+ REMOTE_PROC_NUM_OF_NETWORKS = 52,
+ REMOTE_PROC_DOMAIN_CORE_DUMP = 53,
+ REMOTE_PROC_DOMAIN_RESTORE = 54,
+ REMOTE_PROC_DOMAIN_SAVE = 55,
+ REMOTE_PROC_DOMAIN_GET_SCHEDULER_TYPE = 56,
+ REMOTE_PROC_DOMAIN_GET_SCHEDULER_PARAMETERS = 57,
+ REMOTE_PROC_DOMAIN_SET_SCHEDULER_PARAMETERS = 58,
+ REMOTE_PROC_GET_HOSTNAME = 59,
+ REMOTE_PROC_SUPPORTS_FEATURE = 60,
+ REMOTE_PROC_DOMAIN_MIGRATE_PREPARE = 61,
+ REMOTE_PROC_DOMAIN_MIGRATE_PERFORM = 62,
+ REMOTE_PROC_DOMAIN_MIGRATE_FINISH = 63,
+ REMOTE_PROC_DOMAIN_BLOCK_STATS = 64,
+ REMOTE_PROC_DOMAIN_INTERFACE_STATS = 65,
+ REMOTE_PROC_AUTH_LIST = 66,
+ REMOTE_PROC_AUTH_SASL_INIT = 67,
+ REMOTE_PROC_AUTH_SASL_START = 68,
+ REMOTE_PROC_AUTH_SASL_STEP = 69,
+ REMOTE_PROC_AUTH_POLKIT = 70,
+ REMOTE_PROC_NUM_OF_STORAGE_POOLS = 71,
+ REMOTE_PROC_LIST_STORAGE_POOLS = 72,
+ REMOTE_PROC_NUM_OF_DEFINED_STORAGE_POOLS = 73,
+ REMOTE_PROC_LIST_DEFINED_STORAGE_POOLS = 74,
+ REMOTE_PROC_FIND_STORAGE_POOL_SOURCES = 75,
+ REMOTE_PROC_STORAGE_POOL_CREATE_XML = 76,
+ REMOTE_PROC_STORAGE_POOL_DEFINE_XML = 77,
+ REMOTE_PROC_STORAGE_POOL_CREATE = 78,
+ REMOTE_PROC_STORAGE_POOL_BUILD = 79,
+ REMOTE_PROC_STORAGE_POOL_DESTROY = 80,
+ REMOTE_PROC_STORAGE_POOL_DELETE = 81,
+ REMOTE_PROC_STORAGE_POOL_UNDEFINE = 82,
+ REMOTE_PROC_STORAGE_POOL_REFRESH = 83,
+ REMOTE_PROC_STORAGE_POOL_LOOKUP_BY_NAME = 84,
+ REMOTE_PROC_STORAGE_POOL_LOOKUP_BY_UUID = 85,
+ REMOTE_PROC_STORAGE_POOL_LOOKUP_BY_VOLUME = 86,
+ REMOTE_PROC_STORAGE_POOL_GET_INFO = 87,
+ REMOTE_PROC_STORAGE_POOL_GET_XML_DESC = 88,
+ REMOTE_PROC_STORAGE_POOL_GET_AUTOSTART = 89,
+ REMOTE_PROC_STORAGE_POOL_SET_AUTOSTART = 90,
+ REMOTE_PROC_STORAGE_POOL_NUM_OF_VOLUMES = 91,
+ REMOTE_PROC_STORAGE_POOL_LIST_VOLUMES = 92,
+ REMOTE_PROC_STORAGE_VOL_CREATE_XML = 93,
+ REMOTE_PROC_STORAGE_VOL_DELETE = 94,
+ REMOTE_PROC_STORAGE_VOL_LOOKUP_BY_NAME = 95,
+ REMOTE_PROC_STORAGE_VOL_LOOKUP_BY_KEY = 96,
+ REMOTE_PROC_STORAGE_VOL_LOOKUP_BY_PATH = 97,
+ REMOTE_PROC_STORAGE_VOL_GET_INFO = 98,
+ REMOTE_PROC_STORAGE_VOL_GET_XML_DESC = 99,
+ REMOTE_PROC_STORAGE_VOL_GET_PATH = 100,
+ REMOTE_PROC_NODE_GET_CELLS_FREE_MEMORY = 101,
+ REMOTE_PROC_NODE_GET_FREE_MEMORY = 102,
+ REMOTE_PROC_DOMAIN_BLOCK_PEEK = 103,
+ REMOTE_PROC_DOMAIN_MEMORY_PEEK = 104,
+ REMOTE_PROC_DOMAIN_EVENTS_REGISTER = 105,
+ REMOTE_PROC_DOMAIN_EVENTS_DEREGISTER = 106,
+ REMOTE_PROC_DOMAIN_EVENT_LIFECYCLE = 107,
+ REMOTE_PROC_DOMAIN_MIGRATE_PREPARE2 = 108,
+ REMOTE_PROC_DOMAIN_MIGRATE_FINISH2 = 109,
+ REMOTE_PROC_GET_URI = 110,
+ REMOTE_PROC_NODE_NUM_OF_DEVICES = 111,
+ REMOTE_PROC_NODE_LIST_DEVICES = 112,
+ REMOTE_PROC_NODE_DEVICE_LOOKUP_BY_NAME = 113,
+ REMOTE_PROC_NODE_DEVICE_GET_XML_DESC = 114,
+ REMOTE_PROC_NODE_DEVICE_GET_PARENT = 115,
+ REMOTE_PROC_NODE_DEVICE_NUM_OF_CAPS = 116,
+ REMOTE_PROC_NODE_DEVICE_LIST_CAPS = 117,
+ REMOTE_PROC_NODE_DEVICE_DETTACH = 118,
+ REMOTE_PROC_NODE_DEVICE_RE_ATTACH = 119,
+ REMOTE_PROC_NODE_DEVICE_RESET = 120,
+ REMOTE_PROC_DOMAIN_GET_SECURITY_LABEL = 121,
+ REMOTE_PROC_NODE_GET_SECURITY_MODEL = 122,
+ REMOTE_PROC_NODE_DEVICE_CREATE_XML = 123,
+ REMOTE_PROC_NODE_DEVICE_DESTROY = 124,
+ REMOTE_PROC_STORAGE_VOL_CREATE_XML_FROM = 125,
+ REMOTE_PROC_NUM_OF_INTERFACES = 126,
+ REMOTE_PROC_LIST_INTERFACES = 127,
+ REMOTE_PROC_INTERFACE_LOOKUP_BY_NAME = 128,
+ REMOTE_PROC_INTERFACE_LOOKUP_BY_MAC_STRING = 129,
+ REMOTE_PROC_INTERFACE_GET_XML_DESC = 130,
+ REMOTE_PROC_INTERFACE_DEFINE_XML = 131,
+ REMOTE_PROC_INTERFACE_UNDEFINE = 132,
+ REMOTE_PROC_INTERFACE_CREATE = 133,
+ REMOTE_PROC_INTERFACE_DESTROY = 134,
+ REMOTE_PROC_DOMAIN_XML_FROM_NATIVE = 135,
+ REMOTE_PROC_DOMAIN_XML_TO_NATIVE = 136,
+ REMOTE_PROC_NUM_OF_DEFINED_INTERFACES = 137,
+ REMOTE_PROC_LIST_DEFINED_INTERFACES = 138,
+ REMOTE_PROC_NUM_OF_SECRETS = 139,
+ REMOTE_PROC_LIST_SECRETS = 140,
+ REMOTE_PROC_SECRET_LOOKUP_BY_UUID = 141,
+ REMOTE_PROC_SECRET_DEFINE_XML = 142,
+ REMOTE_PROC_SECRET_GET_XML_DESC = 143,
+ REMOTE_PROC_SECRET_SET_VALUE = 144,
+ REMOTE_PROC_SECRET_GET_VALUE = 145,
+ REMOTE_PROC_SECRET_UNDEFINE = 146,
+ REMOTE_PROC_SECRET_LOOKUP_BY_USAGE = 147,
+ REMOTE_PROC_DOMAIN_MIGRATE_PREPARE_TUNNEL = 148,
+ REMOTE_PROC_IS_SECURE = 149,
+ REMOTE_PROC_DOMAIN_IS_ACTIVE = 150,
+ REMOTE_PROC_DOMAIN_IS_PERSISTENT = 151,
+ REMOTE_PROC_NETWORK_IS_ACTIVE = 152,
+ REMOTE_PROC_NETWORK_IS_PERSISTENT = 153,
+ REMOTE_PROC_STORAGE_POOL_IS_ACTIVE = 154,
+ REMOTE_PROC_STORAGE_POOL_IS_PERSISTENT = 155,
+ REMOTE_PROC_INTERFACE_IS_ACTIVE = 156,
+ REMOTE_PROC_GET_LIB_VERSION = 157,
+ REMOTE_PROC_CPU_COMPARE = 158,
+ REMOTE_PROC_DOMAIN_MEMORY_STATS = 159,
+ REMOTE_PROC_DOMAIN_ATTACH_DEVICE_FLAGS = 160,
+ REMOTE_PROC_DOMAIN_DETACH_DEVICE_FLAGS = 161,
+ REMOTE_PROC_CPU_BASELINE = 162,
+ REMOTE_PROC_DOMAIN_GET_JOB_INFO = 163,
+ REMOTE_PROC_DOMAIN_ABORT_JOB = 164,
+ REMOTE_PROC_STORAGE_VOL_WIPE = 165,
+ REMOTE_PROC_DOMAIN_MIGRATE_SET_MAX_DOWNTIME = 166,
+ REMOTE_PROC_DOMAIN_EVENTS_REGISTER_ANY = 167,
+ REMOTE_PROC_DOMAIN_EVENTS_DEREGISTER_ANY = 168,
+ REMOTE_PROC_DOMAIN_EVENT_REBOOT = 169,
+ REMOTE_PROC_DOMAIN_EVENT_RTC_CHANGE = 170,
+ REMOTE_PROC_DOMAIN_EVENT_WATCHDOG = 171,
+ REMOTE_PROC_DOMAIN_EVENT_IO_ERROR = 172,
+ REMOTE_PROC_DOMAIN_EVENT_GRAPHICS = 173,
+ REMOTE_PROC_DOMAIN_UPDATE_DEVICE_FLAGS = 174,
+ REMOTE_PROC_NWFILTER_LOOKUP_BY_NAME = 175,
+ REMOTE_PROC_NWFILTER_LOOKUP_BY_UUID = 176,
+ REMOTE_PROC_NWFILTER_GET_XML_DESC = 177,
+ REMOTE_PROC_NUM_OF_NWFILTERS = 178,
+ REMOTE_PROC_LIST_NWFILTERS = 179,
+ REMOTE_PROC_NWFILTER_DEFINE_XML = 180,
+ REMOTE_PROC_NWFILTER_UNDEFINE = 181,
+ REMOTE_PROC_DOMAIN_MANAGED_SAVE = 182,
+ REMOTE_PROC_DOMAIN_HAS_MANAGED_SAVE_IMAGE = 183,
+ REMOTE_PROC_DOMAIN_MANAGED_SAVE_REMOVE = 184,
+ REMOTE_PROC_DOMAIN_SNAPSHOT_CREATE_XML = 185,
+ REMOTE_PROC_DOMAIN_SNAPSHOT_GET_XML_DESC = 186,
+ REMOTE_PROC_DOMAIN_SNAPSHOT_NUM = 187,
+ REMOTE_PROC_DOMAIN_SNAPSHOT_LIST_NAMES = 188,
+ REMOTE_PROC_DOMAIN_SNAPSHOT_LOOKUP_BY_NAME = 189,
+ REMOTE_PROC_DOMAIN_HAS_CURRENT_SNAPSHOT = 190,
+ REMOTE_PROC_DOMAIN_SNAPSHOT_CURRENT = 191,
+ REMOTE_PROC_DOMAIN_REVERT_TO_SNAPSHOT = 192,
+ REMOTE_PROC_DOMAIN_SNAPSHOT_DELETE = 193,
+ REMOTE_PROC_DOMAIN_GET_BLOCK_INFO = 194,
+ REMOTE_PROC_DOMAIN_EVENT_IO_ERROR_REASON = 195,
+ REMOTE_PROC_DOMAIN_CREATE_WITH_FLAGS = 196,
+ REMOTE_PROC_DOMAIN_SET_MEMORY_PARAMETERS = 197,
+ REMOTE_PROC_DOMAIN_GET_MEMORY_PARAMETERS = 198,
+ REMOTE_PROC_DOMAIN_SET_VCPUS_FLAGS = 199,
+ REMOTE_PROC_DOMAIN_GET_VCPUS_FLAGS = 200,
+ REMOTE_PROC_DOMAIN_OPEN_CONSOLE = 201,
+ REMOTE_PROC_DOMAIN_IS_UPDATED = 202,
+ REMOTE_PROC_GET_SYSINFO = 203,
+ REMOTE_PROC_DOMAIN_SET_MEMORY_FLAGS = 204,
+ REMOTE_PROC_DOMAIN_SET_BLKIO_PARAMETERS = 205,
+ REMOTE_PROC_DOMAIN_GET_BLKIO_PARAMETERS = 206,
+ REMOTE_PROC_DOMAIN_MIGRATE_SET_MAX_SPEED = 207,
+ REMOTE_PROC_STORAGE_VOL_UPLOAD = 208,
+ REMOTE_PROC_STORAGE_VOL_DOWNLOAD = 209,
+ REMOTE_PROC_DOMAIN_INJECT_NMI = 210,
+ REMOTE_PROC_DOMAIN_SCREENSHOT = 211,
+ REMOTE_PROC_DOMAIN_GET_STATE = 212,
+ REMOTE_PROC_DOMAIN_MIGRATE_BEGIN3 = 213,
+ REMOTE_PROC_DOMAIN_MIGRATE_PREPARE3 = 214,
+ REMOTE_PROC_DOMAIN_MIGRATE_PREPARE_TUNNEL3 = 215,
+ REMOTE_PROC_DOMAIN_MIGRATE_PERFORM3 = 216,
+ REMOTE_PROC_DOMAIN_MIGRATE_FINISH3 = 217,
+ REMOTE_PROC_DOMAIN_MIGRATE_CONFIRM3 = 218,
+ REMOTE_PROC_DOMAIN_SET_SCHEDULER_PARAMETERS_FLAGS = 219,
+ REMOTE_PROC_INTERFACE_CHANGE_BEGIN = 220,
+ REMOTE_PROC_INTERFACE_CHANGE_COMMIT = 221,
+ REMOTE_PROC_INTERFACE_CHANGE_ROLLBACK = 222,
+ REMOTE_PROC_DOMAIN_GET_SCHEDULER_PARAMETERS_FLAGS = 223,
+ REMOTE_PROC_DOMAIN_EVENT_CONTROL_ERROR = 224,
+ REMOTE_PROC_DOMAIN_PIN_VCPU_FLAGS = 225,
+ REMOTE_PROC_DOMAIN_SEND_KEY = 226,
+ REMOTE_PROC_NODE_GET_CPU_STATS = 227,
+ REMOTE_PROC_NODE_GET_MEMORY_STATS = 228,
+ REMOTE_PROC_DOMAIN_GET_CONTROL_INFO = 229,
+ REMOTE_PROC_DOMAIN_GET_VCPU_PIN_INFO = 230,
+};
diff --git a/src/virnetprotocol-structs b/src/virnetprotocol-structs
index 1ee2c6d..4d97e9c 100644
--- a/src/virnetprotocol-structs
+++ b/src/virnetprotocol-structs
@@ -1,4 +1,15 @@
/* -*- c -*- */
+enum virNetMessageType {
+ VIR_NET_CALL = 0,
+ VIR_NET_REPLY = 1,
+ VIR_NET_MESSAGE = 2,
+ VIR_NET_STREAM = 3,
+};
+enum virNetMessageStatus {
+ VIR_NET_OK = 0,
+ VIR_NET_ERROR = 1,
+ VIR_NET_CONTINUE = 2,
+};
struct virNetMessageHeader {
u_int prog;
u_int vers;
--
1.7.4.4
13 years, 4 months
[libvirt] [PATCH] docs: document dxml argument to migrate2
by Eric Blake
Commit 135554166 introduced a nice feature without documenting it.
* src/libvirt.c (virDomainMigrate2): Add paragraph.
---
src/libvirt.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/src/libvirt.c b/src/libvirt.c
index fc17f2b..13da214 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -4297,6 +4297,15 @@ error:
* different processors even with the same architecture, or between
* different types of hypervisor.
*
+ * If the hypervisor supports it, @dxml can be used to alter
+ * host-specific portions of the domain XML that will be used on
+ * the destination. For example, it is possible to alter the
+ * backing filename that is associated with a disk device, in order
+ * to account for naming differences between source and destination
+ * in accessing the underlying storage. The migration will fail
+ * if @dxml would cause any guest-visible changes. Pass NULL
+ * if no changes are needed to the XML between source and destination.
+ *
* Returns the new domain object if the migration was successful,
* or NULL in case of error. Note that the new domain object
* exists in the scope of the destination connection (dconn).
--
1.7.4.4
13 years, 4 months