[libvirt] [PATCH 1/2 v2] node_memory: Do not fail if there is parameter unsupported
by Osier Yang
It makes no sense to fail the whole getting command if there is
parameter unsupported by the kernel. This patch fixes it by
omitting the unsupported parameter for getMemoryParameters.
And For setMemoryParameters, this checks if there is unsupported
parameter up front of the setting, and just returns failure if not
all parameters are supported.
---
v1 - v2:
* Change the behaviour of APIs with regard to the agreement in
https://www.redhat.com/archives/libvir-list/2012-November/msg01164.html
---
src/libvirt.c | 11 +++--
src/nodeinfo.c | 127 ++++++++++++++++++++++++++++++++++++-------------------
2 files changed, 89 insertions(+), 49 deletions(-)
diff --git a/src/libvirt.c b/src/libvirt.c
index 4af6089..e851049 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -6746,10 +6746,10 @@ error:
* @nparams: pointer to number of memory parameters; input and output
* @flags: extra flags; not used yet, so callers should always pass 0
*
- * Get all node memory parameters. On input, @nparams gives the size
- * of the @params array; on output, @nparams gives how many slots were
- * filled with parameter information, which might be less but will
- * not exceed the input value.
+ * Get all node memory parameters (parameter unsupported by OS will be
+ * omitted). On input, @nparams gives the size of the @params array;
+ * on output, @nparams gives how many slots were filled with parameter
+ * information, which might be less but will not exceed the input value.
*
* As a special case, calling with @params as NULL and @nparams as 0 on
* input will cause @nparams on output to contain the number of parameters
@@ -6811,7 +6811,8 @@ error:
* value nparams of virDomainGetSchedulerType)
* @flags: extra flags; not used yet, so callers should always pass 0
*
- * Change all or a subset of the node memory tunables.
+ * Change all or a subset of the node memory tunables. The function
+ * fails if not all of the tunables are supported.
*
* Note that it's not recommended to use this function while the
* outside tuning program is running (such as ksmtuned under Linux),
diff --git a/src/nodeinfo.c b/src/nodeinfo.c
index 75d6524..096000b 100644
--- a/src/nodeinfo.c
+++ b/src/nodeinfo.c
@@ -1058,14 +1058,15 @@ nodeGetCPUBitmap(int *max_id ATTRIBUTE_UNUSED)
#ifdef __linux__
static int
-nodeSetMemoryParameterValue(const char *field,
- virTypedParameterPtr param)
+nodeSetMemoryParameterValue(virTypedParameterPtr param)
{
char *path = NULL;
char *strval = NULL;
int ret = -1;
int rc = -1;
+ char *field = strchr(param->field, '_');
+ field++;
if (virAsprintf(&path, "%s/%s",
SYSFS_MEMORY_SHARED_PATH, field) < 0) {
virReportOOMError();
@@ -1080,7 +1081,7 @@ nodeSetMemoryParameterValue(const char *field,
}
if ((rc = virFileWriteStr(path, strval, 0)) < 0) {
- virReportSystemError(-rc, _("failed to set %s"), field);
+ virReportSystemError(-rc, _("failed to set %s"), param->field);
goto cleanup;
}
@@ -1090,6 +1091,38 @@ cleanup:
VIR_FREE(strval);
return ret;
}
+
+static bool
+nodeMemoryParametersIsAllSupported(virTypedParameterPtr params,
+ int nparams)
+{
+ char *path = NULL;
+ int i;
+
+ for (i = 0; i < nparams; i++) {
+ virTypedParameterPtr param = ¶ms[i];
+
+ char *field = strchr(param->field, '_');
+ field++;
+ if (virAsprintf(&path, "%s/%s",
+ SYSFS_MEMORY_SHARED_PATH, field) < 0) {
+ virReportOOMError();
+ return false;
+ }
+
+ if (!virFileExists(path)) {
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ _("Parameter '%s' is not supported by "
+ "this kernel"), param->field);
+ VIR_FREE(path);
+ return false;
+ }
+
+ VIR_FREE(path);
+ }
+
+ return true;
+}
#endif
int
@@ -1101,8 +1134,8 @@ nodeSetMemoryParameters(virConnectPtr conn ATTRIBUTE_UNUSED,
virCheckFlags(0, -1);
#ifdef __linux__
- int ret = 0;
int i;
+ int rc;
if (virTypedParameterArrayValidate(params, nparams,
VIR_NODE_MEMORY_SHARED_PAGES_TO_SCAN,
@@ -1114,34 +1147,18 @@ nodeSetMemoryParameters(virConnectPtr conn ATTRIBUTE_UNUSED,
NULL) < 0)
return -1;
- for (i = 0; i < nparams; i++) {
- virTypedParameterPtr param = ¶ms[i];
-
- if (STREQ(param->field,
- VIR_NODE_MEMORY_SHARED_PAGES_TO_SCAN)) {
- ret = nodeSetMemoryParameterValue("pages_to_scan", param);
-
- /* Out of memory */
- if (ret == -2)
- return -1;
- } else if (STREQ(param->field,
- VIR_NODE_MEMORY_SHARED_SLEEP_MILLISECS)) {
- ret = nodeSetMemoryParameterValue("sleep_millisecs", param);
+ if (!nodeMemoryParametersIsAllSupported(params, nparams))
+ return -1;
- /* Out of memory */
- if (ret == -2)
- return -1;
- } else if (STREQ(param->field,
- VIR_NODE_MEMORY_SHARED_MERGE_ACROSS_NODES)) {
- ret = nodeSetMemoryParameterValue("merge_across_nodes", param);
+ for (i = 0; i < nparams; i++) {
+ rc = nodeSetMemoryParameterValue(¶ms[i]);
- /* Out of memory */
- if (ret == -2)
- return -1;
- }
+ /* Out of memory */
+ if (rc == -2)
+ return -1;
}
- return ret;
+ return 0;
#else
virReportError(VIR_ERR_NO_SUPPORT, "%s",
_("node set memory parameters not implemented"
@@ -1167,6 +1184,11 @@ nodeGetMemoryParameterValue(const char *field,
goto cleanup;
}
+ if (!virFileExists(path)) {
+ ret = -2;
+ goto cleanup;
+ }
+
if (virFileReadAll(path, 1024, &buf) < 0)
goto cleanup;
@@ -1217,6 +1239,7 @@ nodeGetMemoryParameters(virConnectPtr conn ATTRIBUTE_UNUSED,
unsigned long long pages_volatile;
unsigned long long full_scans = 0;
int i;
+ int ret;
if ((*nparams) == 0) {
*nparams = NODE_MEMORY_PARAMETERS_NUM;
@@ -1228,8 +1251,10 @@ nodeGetMemoryParameters(virConnectPtr conn ATTRIBUTE_UNUSED,
switch (i) {
case 0:
- if (nodeGetMemoryParameterValue("pages_to_scan",
- &pages_to_scan) < 0)
+ ret = nodeGetMemoryParameterValue("pages_to_scan", &pages_to_scan);
+ if (ret == -2)
+ continue;
+ else if (ret == -1)
return -1;
if (virTypedParameterAssign(param, VIR_NODE_MEMORY_SHARED_PAGES_TO_SCAN,
@@ -1239,8 +1264,10 @@ nodeGetMemoryParameters(virConnectPtr conn ATTRIBUTE_UNUSED,
break;
case 1:
- if (nodeGetMemoryParameterValue("sleep_millisecs",
- &sleep_millisecs) < 0)
+ ret = nodeGetMemoryParameterValue("sleep_millisecs", &sleep_millisecs);
+ if (ret == -2)
+ continue;
+ else if (ret == -1)
return -1;
if (virTypedParameterAssign(param, VIR_NODE_MEMORY_SHARED_SLEEP_MILLISECS,
@@ -1250,8 +1277,10 @@ nodeGetMemoryParameters(virConnectPtr conn ATTRIBUTE_UNUSED,
break;
case 2:
- if (nodeGetMemoryParameterValue("pages_shared",
- &pages_shared) < 0)
+ ret = nodeGetMemoryParameterValue("pages_shared", &pages_shared);
+ if (ret == -2)
+ continue;
+ else if (ret == -1)
return -1;
if (virTypedParameterAssign(param, VIR_NODE_MEMORY_SHARED_PAGES_SHARED,
@@ -1261,8 +1290,10 @@ nodeGetMemoryParameters(virConnectPtr conn ATTRIBUTE_UNUSED,
break;
case 3:
- if (nodeGetMemoryParameterValue("pages_sharing",
- &pages_sharing) < 0)
+ ret = nodeGetMemoryParameterValue("pages_sharing", &pages_sharing);
+ if (ret == -2)
+ continue;
+ else if (ret == -1)
return -1;
if (virTypedParameterAssign(param, VIR_NODE_MEMORY_SHARED_PAGES_SHARING,
@@ -1272,8 +1303,10 @@ nodeGetMemoryParameters(virConnectPtr conn ATTRIBUTE_UNUSED,
break;
case 4:
- if (nodeGetMemoryParameterValue("pages_unshared",
- &pages_unshared) < 0)
+ ret = nodeGetMemoryParameterValue("pages_unshared", &pages_unshared);
+ if (ret == -2)
+ continue;
+ else if (ret == -1)
return -1;
if (virTypedParameterAssign(param, VIR_NODE_MEMORY_SHARED_PAGES_UNSHARED,
@@ -1283,8 +1316,10 @@ nodeGetMemoryParameters(virConnectPtr conn ATTRIBUTE_UNUSED,
break;
case 5:
- if (nodeGetMemoryParameterValue("pages_volatile",
- &pages_volatile) < 0)
+ ret = nodeGetMemoryParameterValue("pages_volatile", &pages_volatile);
+ if (ret == -2)
+ continue;
+ else if (ret == -1)
return -1;
if (virTypedParameterAssign(param, VIR_NODE_MEMORY_SHARED_PAGES_VOLATILE,
@@ -1294,8 +1329,10 @@ nodeGetMemoryParameters(virConnectPtr conn ATTRIBUTE_UNUSED,
break;
case 6:
- if (nodeGetMemoryParameterValue("full_scans",
- &full_scans) < 0)
+ ret = nodeGetMemoryParameterValue("full_scans", &full_scans);
+ if (ret == -2)
+ continue;
+ else if (ret == -1)
return -1;
if (virTypedParameterAssign(param, VIR_NODE_MEMORY_SHARED_FULL_SCANS,
@@ -1305,8 +1342,10 @@ nodeGetMemoryParameters(virConnectPtr conn ATTRIBUTE_UNUSED,
break;
case 7:
- if (nodeGetMemoryParameterValue("merge_across_nodes",
- &merge_across_nodes) < 0)
+ ret = nodeGetMemoryParameterValue("merge_across_nodes", &merge_across_nodes);
+ if (ret == -2)
+ continue;
+ else if (ret == -1)
return -1;
if (virTypedParameterAssign(param, VIR_NODE_MEMORY_SHARED_MERGE_ACROSS_NODES,
--
1.7.7.6
11 years, 12 months
[libvirt] [PATCH] qemu: support live update of an interface's filter
by Laine Stump
Since we can't (currently) rely on the ability to provide blanket
support for all possible network changes by calling the toplevel
netdev hostside disconnect/connect functions (due to qemu only
supporting a lockstep between initialization of host side and guest
side of devices), in order to support live change of an interface's
nwfilter we need to make a special purpose function to only call the
nwfilter teardown and setup functions if the filter for an interface
(or its parameters) changes. The pattern is nearly identical to that
used to change the bridge that an interface is connected to.
This patch was inspired by a request from Guido Winkelmann
<guido(a)sagersystems.de>, who tested an earlier version, and wrote an
initial version of the nwfilterHashTable comparison function.
I didn't spend any time trying to understand the contents of the
nwfilterHashTable entries, or whether the comparison function is
fully/correctly comparing the entries. I would appreciate if someone
with better knowledge of that data structure (Stefan?) could check it
out and provide suggestions.
---
src/conf/nwfilter_params.c | 24 ++++++++++++++++++++
src/conf/nwfilter_params.h | 4 +++-
src/libvirt_private.syms | 1 +
src/qemu/qemu_hotplug.c | 55 +++++++++++++++++++++++++++++++++++++++++++---
4 files changed, 80 insertions(+), 4 deletions(-)
diff --git a/src/conf/nwfilter_params.c b/src/conf/nwfilter_params.c
index 6dc4baa..e42a54c 100644
--- a/src/conf/nwfilter_params.c
+++ b/src/conf/nwfilter_params.c
@@ -764,6 +764,30 @@ err_exit:
return -1;
}
+static int
+virNWFilterHashTableCompare(const void *a, const void *b)
+{
+ /* need to return 0 if equal */
+ return STRNEQ_NULLABLE(a, b);
+}
+
+bool
+virNWFilterHashTableEqual(virNWFilterHashTablePtr a,
+ virNWFilterHashTablePtr b)
+{
+ if (!(a || b))
+ return true;
+ if (!(a && b))
+ return false;
+ if (a->nNames != b->nNames)
+ return false;
+ if (!(a->hashTable || b->hashTable))
+ return true;
+ if (!(a->hashTable && b->hashTable))
+ return false;
+
+ return virHashEqual(a->hashTable, b->hashTable, virNWFilterHashTableCompare);
+}
static bool
isValidVarName(const char *var)
diff --git a/src/conf/nwfilter_params.h b/src/conf/nwfilter_params.h
index cedf9cd..e310bb1 100644
--- a/src/conf/nwfilter_params.h
+++ b/src/conf/nwfilter_params.h
@@ -1,7 +1,7 @@
/*
* nwfilter_params.h: parsing and data maintenance of filter parameters
*
- * Copyright (C) 2011 Red Hat, Inc.
+ * Copyright (C) 2011-2012 Red Hat, Inc.
* Copyright (C) 2010 IBM Corporation
*
* This library is free software; you can redistribute it and/or
@@ -85,6 +85,8 @@ void *virNWFilterHashTableRemoveEntry(virNWFilterHashTablePtr table,
const char *name);
int virNWFilterHashTablePutAll(virNWFilterHashTablePtr src,
virNWFilterHashTablePtr dest);
+bool virNWFilterHashTableEqual(virNWFilterHashTablePtr a,
+ virNWFilterHashTablePtr b);
# define VALID_VARNAME \
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 756d7bd..d637142 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -946,6 +946,7 @@ virNWFilterIPAddrMapShutdown;
# nwfilter_params.h
virNWFilterHashTableCreate;
+virNWFilterHashTableEqual;
virNWFilterHashTableFree;
virNWFilterHashTablePut;
virNWFilterHashTablePutAll;
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index ae8381e..581204a 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -1330,6 +1330,43 @@ cleanup:
return ret;
}
+static int
+qemuDomainChangeNetFilter(virConnectPtr conn,
+ virDomainObjPtr vm,
+ virDomainNetDefPtr olddev,
+ virDomainNetDefPtr newdev)
+{
+ /* make sure this type of device supports filters. */
+ switch (virDomainNetGetActualType(newdev)) {
+ case VIR_DOMAIN_NET_TYPE_ETHERNET:
+ case VIR_DOMAIN_NET_TYPE_BRIDGE:
+ case VIR_DOMAIN_NET_TYPE_NETWORK:
+ break;
+ default:
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("filters not supported on interfaces of type %s"),
+ virDomainNetTypeToString(virDomainNetGetActualType(newdev)));
+ return -1;
+ }
+
+ virDomainConfNWFilterTeardown(olddev);
+
+ if (virDomainConfNWFilterInstantiate(conn, vm->def->uuid, newdev) < 0) {
+ virErrorPtr errobj;
+
+ virReportError(VIR_ERR_OPERATION_FAILED,
+ _("failed to add new filter rules to '%s' "
+ "- attempting to restore old rules"),
+ olddev->ifname);
+ errobj = virSaveLastError();
+ ignore_value(virDomainConfNWFilterInstantiate(conn, vm->def->uuid, olddev));
+ virSetError(errobj);
+ virFreeError(errobj);
+ return -1;
+ }
+ return 0;
+}
+
int qemuDomainChangeNetLinkState(struct qemud_driver *driver,
virDomainObjPtr vm,
virDomainNetDefPtr dev,
@@ -1373,6 +1410,7 @@ qemuDomainChangeNet(struct qemud_driver *driver,
int oldType, newType;
bool needReconnect = false;
bool needBridgeChange = false;
+ bool needFilterChange = false;
bool needLinkStateChange = false;
bool needReplaceDevDef = false;
int ret = -1;
@@ -1506,8 +1544,10 @@ qemuDomainChangeNet(struct qemud_driver *driver,
}
/* (end of device info checks) */
- if (STRNEQ_NULLABLE(olddev->filter, newdev->filter))
- needReconnect = true;
+ if (STRNEQ_NULLABLE(olddev->filter, newdev->filter) ||
+ !virNWFilterHashTableEqual(olddev->filterparams, newdev->filterparams)) {
+ needFilterChange = true;
+ }
/* bandwidth can be modified, and will be checked later */
/* vlan can be modified, and will be checked later */
@@ -1665,7 +1705,16 @@ qemuDomainChangeNet(struct qemud_driver *driver,
goto cleanup;
/* we successfully switched to the new bridge, and we've
* determined that the rest of newdev is equivalent to olddev,
- * so move newdev into place, so that the */
+ * so move newdev into place */
+ needReplaceDevDef = true;
+ }
+
+ if (needFilterChange) {
+ if (qemuDomainChangeNetFilter(dom->conn, vm, olddev, newdev) < 0)
+ goto cleanup;
+ /* we successfully switched to the new filter, and we've
+ * determined that the rest of newdev is equivalent to olddev,
+ * so move newdev into place */
needReplaceDevDef = true;
}
--
1.7.11.7
11 years, 12 months
[libvirt] [PATCH V8 1/6] add a configure option --with-fuse to prepare introduction of fuse support for libvirt lxc
by Gao feng
add a configure option --with-fuse to prepare introduction
of fuse support for libvirt lxc.
With help from Daniel and Richard.
Signed-off-by: Gao feng <gaofeng(a)cn.fujitsu.com>
---
configure.ac | 29 +++++++++++++++++++++++++++++
libvirt.spec.in | 9 +++++++++
2 files changed, 38 insertions(+), 0 deletions(-)
diff --git a/configure.ac b/configure.ac
index 9108ea8..495cbfa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -115,6 +115,7 @@ LIBSSH2_REQUIRED="1.0"
LIBSSH2_TRANSPORT_REQUIRED="1.3"
LIBBLKID_REQUIRED="2.17"
DBUS_REQUIRED="1.0.0"
+FUSE_REQUIRED="2.8.6"
dnl Checks for C compiler.
AC_PROG_CC
@@ -1859,6 +1860,29 @@ AC_SUBST([CAPNG_CFLAGS])
AC_SUBST([CAPNG_LIBS])
+dnl libfuse
+AC_ARG_WITH([fuse],
+ AC_HELP_STRING([--with-fuse], [use libfuse to proivde fuse filesystem support for libvirt lxc]),
+ [],
+ [with_fuse=check])
+dnl
+dnl This check looks for 'fuse'
+dnl
+AS_IF([test "x$with_fuse" != "xno"],
+ [PKG_CHECK_MODULES([FUSE], [fuse >= $FUSE_REQUIRED],
+ [with_fuse=yes
+ AC_SUBST([FUSE_CFLAGS])
+ AC_SUBST([FUSE_LIBS])
+ AC_DEFINE_UNQUOTED([HAVE_FUSE], 1, [whether fuse is available for libvirt lxc])
+ ],
+ [if test "x$with_fuse" = "xyes" ; then
+ AC_MSG_ERROR([You must install fuse library to compile libvirt])
+ else
+ with_fuse=no
+ fi
+ ])
+ ])
+AM_CONDITIONAL([HAVE_FUSE], [test "x$with_fuse" = "xyes"])
dnl virsh libraries
AC_CHECK_HEADERS([readline/readline.h])
@@ -3163,6 +3187,11 @@ AC_MSG_NOTICE([ capng: $CAPNG_CFLAGS $CAPNG_LIBS])
else
AC_MSG_NOTICE([ capng: no])
fi
+if test "$with_fuse" = "yes" ; then
+AC_MSG_NOTICE([ fuse: $FUSE_CFLAGS $FUSE_LIBS])
+else
+AC_MSG_NOTICE([ fuse: no])
+fi
if test "$with_xen" = "yes" ; then
AC_MSG_NOTICE([ xen: $XEN_CFLAGS $XEN_LIBS])
else
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 9aa2fb2..2c2c77c 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -93,6 +93,7 @@
# A few optional bits off by default, we enable later
%define with_polkit 0%{!?_without_polkit:0}
%define with_capng 0%{!?_without_capng:0}
+%define with_fuse 0%{!?_without_fuse:0}
%define with_netcf 0%{!?_without_netcf:0}
%define with_udev 0%{!?_without_udev:0}
%define with_hal 0%{!?_without_hal:0}
@@ -510,6 +511,9 @@ BuildRequires: numactl-devel
%if %{with_capng}
BuildRequires: libcap-ng-devel >= 0.5.0
%endif
+%if %{with_fuse}
+BuildRequires: fuse-devel >= 2.8.6
+%endif
%if %{with_phyp} || %{with_libssh2_transport}
%if %{with_libssh2_transport}
BuildRequires: libssh2-devel >= 1.3.0
@@ -1193,6 +1197,10 @@ of recent versions of Linux (and other OSes).
%define _without_capng --without-capng
%endif
+%if ! %{with_fuse}
+%define _without_fuse --without-fuse
+%endif
+
%if ! %{with_netcf}
%define _without_netcf --without-netcf
%endif
@@ -1296,6 +1304,7 @@ autoreconf -if
%{?_without_numactl} \
%{?_without_numad} \
%{?_without_capng} \
+ %{?_without_fuse} \
%{?_without_netcf} \
%{?_without_selinux} \
%{?_with_selinux_mount} \
--
1.7.7.6
11 years, 12 months
[libvirt] [PATCH 0/4] Support for sending signals to guest processes
by Daniel P. Berrange
One of the things people want to be able todo with LXC is to send
arbitrary signals to processes inside the container. This series
introduces a virDomainSendProcessSignal API for that purpose. The
LXC driver impl is limited to sending signals to the "init" pid
(ie pid == 1), but in the future we'll extend this to arbitrary
container PIDs (via /proc/$PID/ns/pid + setns()).
If the QEMU guest agent had a suitable command we could support
this for QEMU too.
11 years, 12 months
[libvirt] [PATCH] Rename misc QEMU structs/enums to use normal naming style
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
Replace the following names
* struct qemu_snap_remove with virQEMUSnapRemovePtr
* struct qemu_snap_reparent with virQEMUSnapReparentPtr
* struct qemu_save_header with virQEMUSaveHeaderPtr
* enum qemu_save_formats with virQEMUSaveFormat
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
src/qemu/qemu_domain.c | 4 ++--
src/qemu/qemu_domain.h | 4 +++-
src/qemu/qemu_driver.c | 47 ++++++++++++++++++++++++++---------------------
3 files changed, 31 insertions(+), 24 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 4b8e52b..ccad1b3 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -1809,7 +1809,7 @@ void qemuDomainSnapshotDiscardAll(void *payload,
void *data)
{
virDomainSnapshotObjPtr snap = payload;
- struct qemu_snap_remove *curr = data;
+ virQEMUSnapRemovePtr curr = data;
int err;
if (snap->def->current)
@@ -1824,7 +1824,7 @@ int
qemuDomainSnapshotDiscardAllMetadata(virQEMUDriverPtr driver,
virDomainObjPtr vm)
{
- struct qemu_snap_remove rem;
+ virQEMUSnapRemove rem;
rem.driver = driver;
rem.vm = vm;
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index 4a70362..11670b9 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -318,7 +318,9 @@ int qemuDomainSnapshotDiscard(virQEMUDriverPtr driver,
bool update_current,
bool metadata_only);
-struct qemu_snap_remove {
+typedef struct _virQEMUSnapRemove virQEMUSnapRemove;
+typedef virQEMUSnapRemove *virQEMUSnapRemovePtr;
+struct _virQEMUSnapRemove {
virQEMUDriverPtr driver;
virDomainObjPtr vm;
int err;
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 7bccd25..cd5531f 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -2596,7 +2596,7 @@ cleanup:
verify(sizeof(QEMU_SAVE_MAGIC) == sizeof(QEMU_SAVE_PARTIAL));
-enum qemu_save_formats {
+typedef enum {
QEMU_SAVE_FORMAT_RAW = 0,
QEMU_SAVE_FORMAT_GZIP = 1,
QEMU_SAVE_FORMAT_BZIP2 = 2,
@@ -2611,7 +2611,7 @@ enum qemu_save_formats {
Do not change or re-use numbers. */
QEMU_SAVE_FORMAT_LAST
-};
+} virQEMUSaveFormat;
VIR_ENUM_DECL(qemuSaveCompression)
VIR_ENUM_IMPL(qemuSaveCompression, QEMU_SAVE_FORMAT_LAST,
@@ -2621,7 +2621,9 @@ VIR_ENUM_IMPL(qemuSaveCompression, QEMU_SAVE_FORMAT_LAST,
"xz",
"lzop")
-struct qemu_save_header {
+typedef struct _virQEMUSaveHeader virQEMUSaveHeader;
+typedef virQEMUSaveHeader *virQEMUSaveHeaderPtr;
+struct _virQEMUSaveHeader {
char magic[sizeof(QEMU_SAVE_MAGIC)-1];
uint32_t version;
uint32_t xml_len;
@@ -2631,7 +2633,7 @@ struct qemu_save_header {
};
static inline void
-bswap_header(struct qemu_save_header *hdr) {
+bswap_header(virQEMUSaveHeaderPtr hdr) {
hdr->version = bswap_32(hdr->version);
hdr->xml_len = bswap_32(hdr->xml_len);
hdr->was_running = bswap_32(hdr->was_running);
@@ -2642,7 +2644,7 @@ bswap_header(struct qemu_save_header *hdr) {
/* return -errno on failure, or 0 on success */
static int
qemuDomainSaveHeader(int fd, const char *path, const char *xml,
- struct qemu_save_header *header)
+ virQEMUSaveHeaderPtr header)
{
int ret = 0;
@@ -2664,7 +2666,7 @@ endjob:
return ret;
}
-/* Given a enum qemu_save_formats compression level, return the name
+/* Given a virQEMUSaveFormat compression level, return the name
* of the program to run, or NULL if no program is needed. */
static const char *
qemuCompressProgramName(int compress)
@@ -2801,7 +2803,7 @@ qemuDomainSaveMemory(virQEMUDriverPtr driver,
unsigned int flags,
enum qemuDomainAsyncJob asyncJob)
{
- struct qemu_save_header header;
+ virQEMUSaveHeader header;
bool bypassSecurityDriver = false;
bool needUnlink = false;
int ret = -1;
@@ -3044,7 +3046,7 @@ cleanup:
}
/* Returns true if a compression program is available in PATH */
-static bool qemuCompressProgramAvailable(enum qemu_save_formats compress)
+static bool qemuCompressProgramAvailable(virQEMUSaveFormat compress)
{
const char *prog;
char *c;
@@ -3308,7 +3310,7 @@ static int
doCoreDump(virQEMUDriverPtr driver,
virDomainObjPtr vm,
const char *path,
- enum qemu_save_formats compress,
+ virQEMUSaveFormat compress,
unsigned int dump_flags)
{
int fd = -1;
@@ -3371,7 +3373,7 @@ cleanup:
return ret;
}
-static enum qemu_save_formats
+static virQEMUSaveFormat
getCompressionType(virQEMUDriverPtr driver)
{
int compress = QEMU_SAVE_FORMAT_RAW;
@@ -4817,14 +4819,14 @@ static int ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4)
qemuDomainSaveImageOpen(virQEMUDriverPtr driver,
const char *path,
virDomainDefPtr *ret_def,
- struct qemu_save_header *ret_header,
+ virQEMUSaveHeaderPtr ret_header,
bool bypass_cache,
virFileWrapperFdPtr *wrapperFd,
const char *xmlin, int state, bool edit,
bool unlink_corrupt)
{
int fd = -1;
- struct qemu_save_header header;
+ virQEMUSaveHeader header;
char *xml = NULL;
virDomainDefPtr def = NULL;
int oflags = edit ? O_RDWR : O_RDONLY;
@@ -4962,7 +4964,7 @@ qemuDomainSaveImageStartVM(virConnectPtr conn,
virQEMUDriverPtr driver,
virDomainObjPtr vm,
int *fd,
- const struct qemu_save_header *header,
+ const virQEMUSaveHeaderPtr header,
const char *path,
bool start_paused)
{
@@ -5082,7 +5084,7 @@ qemuDomainRestoreFlags(virConnectPtr conn,
virDomainObjPtr vm = NULL;
int fd = -1;
int ret = -1;
- struct qemu_save_header header;
+ virQEMUSaveHeader header;
virFileWrapperFdPtr wrapperFd = NULL;
int state = -1;
@@ -5154,7 +5156,7 @@ qemuDomainSaveImageGetXMLDesc(virConnectPtr conn, const char *path,
char *ret = NULL;
virDomainDefPtr def = NULL;
int fd = -1;
- struct qemu_save_header header;
+ virQEMUSaveHeader header;
/* We only take subset of virDomainDefFormat flags. */
virCheckFlags(VIR_DOMAIN_XML_SECURE, NULL);
@@ -5184,7 +5186,7 @@ qemuDomainSaveImageDefineXML(virConnectPtr conn, const char *path,
int ret = -1;
virDomainDefPtr def = NULL;
int fd = -1;
- struct qemu_save_header header;
+ virQEMUSaveHeader header;
char *xml = NULL;
size_t len;
int state = -1;
@@ -5261,7 +5263,7 @@ qemuDomainObjRestore(virConnectPtr conn,
virDomainDefPtr def = NULL;
int fd = -1;
int ret = -1;
- struct qemu_save_header header;
+ virQEMUSaveHeader header;
virFileWrapperFdPtr wrapperFd = NULL;
fd = qemuDomainSaveImageOpen(driver, path, &def, &header,
@@ -12432,7 +12434,10 @@ cleanup:
return ret;
}
-struct snap_reparent {
+
+typedef struct _virQEMUSnapReparent virQEMUSnapReparent;
+typedef virQEMUSnapReparent *virQEMUSnapReparentPtr;
+struct _virQEMUSnapReparent {
virQEMUDriverPtr driver;
virDomainSnapshotObjPtr parent;
virDomainObjPtr vm;
@@ -12446,7 +12451,7 @@ qemuDomainSnapshotReparentChildren(void *payload,
void *data)
{
virDomainSnapshotObjPtr snap = payload;
- struct snap_reparent *rep = data;
+ virQEMUSnapReparentPtr rep = data;
if (rep->err < 0) {
return;
@@ -12480,8 +12485,8 @@ static int qemuDomainSnapshotDelete(virDomainSnapshotPtr snapshot,
int ret = -1;
virDomainSnapshotObjPtr snap = NULL;
char uuidstr[VIR_UUID_STRING_BUFLEN];
- struct qemu_snap_remove rem;
- struct snap_reparent rep;
+ virQEMUSnapRemove rem;
+ virQEMUSnapReparent rep;
bool metadata_only = !!(flags & VIR_DOMAIN_SNAPSHOT_DELETE_METADATA_ONLY);
int external = 0;
--
1.7.11.7
11 years, 12 months
[libvirt] [PATCH] Replace 'struct qemud_driver *' with virQEMUDriverPtr
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
Remove the obsolete 'qemud' naming prefix and underscore
based type name. Introduce virQEMUDriverPtr as the replacement,
in common with LXC driver naming style
---
src/qemu/qemu_bridge_filter.c | 8 +-
src/qemu/qemu_bridge_filter.h | 8 +-
src/qemu/qemu_cgroup.c | 12 +-
src/qemu/qemu_cgroup.h | 12 +-
src/qemu/qemu_command.c | 12 +-
src/qemu/qemu_command.h | 8 +-
src/qemu/qemu_conf.c | 20 +--
src/qemu/qemu_conf.h | 25 ++--
src/qemu/qemu_domain.c | 96 ++++++-------
src/qemu/qemu_domain.h | 84 +++++------
src/qemu/qemu_driver.c | 322 +++++++++++++++++++++---------------------
src/qemu/qemu_hostdev.c | 24 ++--
src/qemu/qemu_hostdev.h | 16 +--
src/qemu/qemu_hotplug.c | 52 +++----
src/qemu/qemu_hotplug.h | 44 +++---
src/qemu/qemu_migration.c | 80 +++++------
src/qemu/qemu_migration.h | 26 ++--
src/qemu/qemu_process.c | 100 ++++++-------
src/qemu/qemu_process.h | 30 ++--
19 files changed, 491 insertions(+), 488 deletions(-)
diff --git a/src/qemu/qemu_bridge_filter.c b/src/qemu/qemu_bridge_filter.c
index cadc630..a34a92e 100644
--- a/src/qemu/qemu_bridge_filter.c
+++ b/src/qemu/qemu_bridge_filter.c
@@ -34,7 +34,7 @@
#define VIR_FROM_THIS VIR_FROM_QEMU
int
-networkAddEbtablesRules(struct qemud_driver *driver) {
+networkAddEbtablesRules(virQEMUDriverPtr driver) {
int err;
/* Set forward policy to DROP */
@@ -50,7 +50,7 @@ networkAddEbtablesRules(struct qemud_driver *driver) {
int
-networkDisableAllFrames(struct qemud_driver *driver) {
+networkDisableAllFrames(virQEMUDriverPtr driver) {
int err;
/* add default rules */
@@ -64,7 +64,7 @@ networkDisableAllFrames(struct qemud_driver *driver) {
}
int
-networkAllowMacOnPort(struct qemud_driver *driver,
+networkAllowMacOnPort(virQEMUDriverPtr driver,
const char * ifname,
const virMacAddrPtr mac) {
@@ -85,7 +85,7 @@ networkAllowMacOnPort(struct qemud_driver *driver,
int
-networkDisallowMacOnPort(struct qemud_driver *driver,
+networkDisallowMacOnPort(virQEMUDriverPtr driver,
const char * ifname,
const virMacAddrPtr mac) {
diff --git a/src/qemu/qemu_bridge_filter.h b/src/qemu/qemu_bridge_filter.h
index d88c085..ea8e0fa 100644
--- a/src/qemu/qemu_bridge_filter.h
+++ b/src/qemu/qemu_bridge_filter.h
@@ -24,14 +24,14 @@
# define __QEMUD_BRIDGE_FILTER_H__
-int networkAllowMacOnPort(struct qemud_driver *driver,
+int networkAllowMacOnPort(virQEMUDriverPtr driver,
const char * ifname,
const virMacAddrPtr mac);
-int networkDisallowMacOnPort(struct qemud_driver *driver,
+int networkDisallowMacOnPort(virQEMUDriverPtr driver,
const char * ifname,
const virMacAddrPtr mac);
-int networkDisableAllFrames(struct qemud_driver *driver);
-int networkAddEbtablesRules(struct qemud_driver *driver);
+int networkDisableAllFrames(virQEMUDriverPtr driver);
+int networkAddEbtablesRules(virQEMUDriverPtr driver);
#endif /* __QEMUD_BRIDGE_FILTER_H__ */
diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
index 288187c..30cd1d6 100644
--- a/src/qemu/qemu_cgroup.c
+++ b/src/qemu/qemu_cgroup.c
@@ -45,7 +45,7 @@ static const char *const defaultDeviceACL[] = {
#define DEVICE_PTY_MAJOR 136
#define DEVICE_SND_MAJOR 116
-bool qemuCgroupControllerActive(struct qemud_driver *driver,
+bool qemuCgroupControllerActive(virQEMUDriverPtr driver,
int controller)
{
if (driver->cgroup == NULL)
@@ -188,7 +188,7 @@ int qemuSetupHostUsbDeviceCgroup(usbDevice *dev ATTRIBUTE_UNUSED,
return 0;
}
-int qemuSetupCgroup(struct qemud_driver *driver,
+int qemuSetupCgroup(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virBitmapPtr nodemask)
{
@@ -532,7 +532,7 @@ cleanup:
return rc;
}
-int qemuSetupCgroupForVcpu(struct qemud_driver *driver, virDomainObjPtr vm)
+int qemuSetupCgroupForVcpu(virQEMUDriverPtr driver, virDomainObjPtr vm)
{
virCgroupPtr cgroup = NULL;
virCgroupPtr cgroup_vcpu = NULL;
@@ -637,7 +637,7 @@ cleanup:
return -1;
}
-int qemuSetupCgroupForEmulator(struct qemud_driver *driver,
+int qemuSetupCgroupForEmulator(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virBitmapPtr nodemask)
{
@@ -738,7 +738,7 @@ cleanup:
return rc;
}
-int qemuRemoveCgroup(struct qemud_driver *driver,
+int qemuRemoveCgroup(virQEMUDriverPtr driver,
virDomainObjPtr vm,
int quiet)
{
@@ -762,7 +762,7 @@ int qemuRemoveCgroup(struct qemud_driver *driver,
return rc;
}
-int qemuAddToCgroup(struct qemud_driver *driver,
+int qemuAddToCgroup(virQEMUDriverPtr driver,
virDomainDefPtr def)
{
virCgroupPtr cgroup = NULL;
diff --git a/src/qemu/qemu_cgroup.h b/src/qemu/qemu_cgroup.h
index 50ee092..e212581 100644
--- a/src/qemu/qemu_cgroup.h
+++ b/src/qemu/qemu_cgroup.h
@@ -34,7 +34,7 @@ struct _qemuCgroupData {
};
typedef struct _qemuCgroupData qemuCgroupData;
-bool qemuCgroupControllerActive(struct qemud_driver *driver,
+bool qemuCgroupControllerActive(virQEMUDriverPtr driver,
int controller);
int qemuSetupDiskCgroup(virDomainObjPtr vm,
virCgroupPtr cgroup,
@@ -45,7 +45,7 @@ int qemuTeardownDiskCgroup(virDomainObjPtr vm,
int qemuSetupHostUsbDeviceCgroup(usbDevice *dev,
const char *path,
void *opaque);
-int qemuSetupCgroup(struct qemud_driver *driver,
+int qemuSetupCgroup(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virBitmapPtr nodemask);
int qemuSetupCgroupVcpuBW(virCgroupPtr cgroup,
@@ -56,14 +56,14 @@ int qemuSetupCgroupVcpuPin(virCgroupPtr cgroup,
int nvcpupin,
int vcpuid);
int qemuSetupCgroupEmulatorPin(virCgroupPtr cgroup, virBitmapPtr cpumask);
-int qemuSetupCgroupForVcpu(struct qemud_driver *driver, virDomainObjPtr vm);
-int qemuSetupCgroupForEmulator(struct qemud_driver *driver,
+int qemuSetupCgroupForVcpu(virQEMUDriverPtr driver, virDomainObjPtr vm);
+int qemuSetupCgroupForEmulator(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virBitmapPtr nodemask);
-int qemuRemoveCgroup(struct qemud_driver *driver,
+int qemuRemoveCgroup(virQEMUDriverPtr driver,
virDomainObjPtr vm,
int quiet);
-int qemuAddToCgroup(struct qemud_driver *driver,
+int qemuAddToCgroup(virQEMUDriverPtr driver,
virDomainDefPtr def);
#endif /* __QEMU_CGROUP_H__ */
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 7736575..94b3029 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -148,7 +148,7 @@ uname_normalize(struct utsname *ut)
*/
int
qemuPhysIfaceConnect(virDomainDefPtr def,
- struct qemud_driver *driver,
+ virQEMUDriverPtr driver,
virDomainNetDefPtr net,
qemuCapsPtr caps,
enum virNetDevVPortProfileOp vmop)
@@ -197,7 +197,7 @@ error:
int
qemuNetworkIfaceConnect(virDomainDefPtr def,
virConnectPtr conn,
- struct qemud_driver *driver,
+ virQEMUDriverPtr driver,
virDomainNetDefPtr net,
qemuCapsPtr caps)
{
@@ -3197,7 +3197,7 @@ error:
char *
qemuBuildHostNetStr(virDomainNetDefPtr net,
- struct qemud_driver *driver,
+ virQEMUDriverPtr driver,
qemuCapsPtr caps,
char type_sep,
int vlan,
@@ -4242,7 +4242,7 @@ error:
static int
-qemuBuildCpuArgStr(const struct qemud_driver *driver,
+qemuBuildCpuArgStr(const virQEMUDriverPtr driver,
const virDomainDefPtr def,
const char *emulator,
qemuCapsPtr caps,
@@ -4571,7 +4571,7 @@ error:
}
static int
-qemuBuildGraphicsCommandLine(struct qemud_driver *driver,
+qemuBuildGraphicsCommandLine(virQEMUDriverPtr driver,
virCommandPtr cmd,
virDomainDefPtr def,
qemuCapsPtr caps,
@@ -4913,7 +4913,7 @@ error:
*/
virCommandPtr
qemuBuildCommandLine(virConnectPtr conn,
- struct qemud_driver *driver,
+ virQEMUDriverPtr driver,
virDomainDefPtr def,
virDomainChrSourceDefPtr monitor_chr,
bool monitor_json,
diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h
index 953fa72..6556e6e 100644
--- a/src/qemu/qemu_command.h
+++ b/src/qemu/qemu_command.h
@@ -50,7 +50,7 @@
virCommandPtr qemuBuildCommandLine(virConnectPtr conn,
- struct qemud_driver *driver,
+ virQEMUDriverPtr driver,
virDomainDefPtr def,
virDomainChrSourceDefPtr monitor_chr,
bool monitor_json,
@@ -70,7 +70,7 @@ qemuBuildChrDeviceStr (virDomainChrDefPtr serial,
/* With vlan == -1, use netdev syntax, else old hostnet */
char * qemuBuildHostNetStr(virDomainNetDefPtr net,
- struct qemud_driver *driver,
+ virQEMUDriverPtr driver,
qemuCapsPtr caps,
char type_sep,
int vlan,
@@ -146,13 +146,13 @@ char * qemuBuildRedirdevDevStr(virDomainDefPtr def,
int qemuNetworkIfaceConnect(virDomainDefPtr def,
virConnectPtr conn,
- struct qemud_driver *driver,
+ virQEMUDriverPtr driver,
virDomainNetDefPtr net,
qemuCapsPtr caps)
ATTRIBUTE_NONNULL(2);
int qemuPhysIfaceConnect(virDomainDefPtr def,
- struct qemud_driver *driver,
+ virQEMUDriverPtr driver,
virDomainNetDefPtr net,
qemuCapsPtr caps,
enum virNetDevVPortProfileOp vmop);
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index ce3fa67..b7f249d 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -62,17 +62,17 @@ struct _qemuDriverCloseDef {
qemuDriverCloseCallback cb;
};
-void qemuDriverLock(struct qemud_driver *driver)
+void qemuDriverLock(virQEMUDriverPtr driver)
{
virMutexLock(&driver->lock);
}
-void qemuDriverUnlock(struct qemud_driver *driver)
+void qemuDriverUnlock(virQEMUDriverPtr driver)
{
virMutexUnlock(&driver->lock);
}
-int qemuLoadDriverConfig(struct qemud_driver *driver,
+int qemuLoadDriverConfig(virQEMUDriverPtr driver,
const char *filename) {
virConfPtr conf;
virConfValuePtr p;
@@ -587,7 +587,7 @@ qemuDriverCloseCallbackFree(void *payload,
}
int
-qemuDriverCloseCallbackInit(struct qemud_driver *driver)
+qemuDriverCloseCallbackInit(virQEMUDriverPtr driver)
{
driver->closeCallbacks = virHashCreate(5, qemuDriverCloseCallbackFree);
if (!driver->closeCallbacks)
@@ -597,13 +597,13 @@ qemuDriverCloseCallbackInit(struct qemud_driver *driver)
}
void
-qemuDriverCloseCallbackShutdown(struct qemud_driver *driver)
+qemuDriverCloseCallbackShutdown(virQEMUDriverPtr driver)
{
virHashFree(driver->closeCallbacks);
}
int
-qemuDriverCloseCallbackSet(struct qemud_driver *driver,
+qemuDriverCloseCallbackSet(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virConnectPtr conn,
qemuDriverCloseCallback cb)
@@ -649,7 +649,7 @@ qemuDriverCloseCallbackSet(struct qemud_driver *driver,
}
int
-qemuDriverCloseCallbackUnset(struct qemud_driver *driver,
+qemuDriverCloseCallbackUnset(virQEMUDriverPtr driver,
virDomainObjPtr vm,
qemuDriverCloseCallback cb)
{
@@ -675,7 +675,7 @@ qemuDriverCloseCallbackUnset(struct qemud_driver *driver,
}
qemuDriverCloseCallback
-qemuDriverCloseCallbackGet(struct qemud_driver *driver,
+qemuDriverCloseCallbackGet(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virConnectPtr conn)
{
@@ -696,7 +696,7 @@ qemuDriverCloseCallbackGet(struct qemud_driver *driver,
}
struct qemuDriverCloseCallbackData {
- struct qemud_driver *driver;
+ virQEMUDriverPtr driver;
virConnectPtr conn;
};
@@ -735,7 +735,7 @@ qemuDriverCloseCallbackRun(void *payload,
}
void
-qemuDriverCloseCallbackRunAll(struct qemud_driver *driver,
+qemuDriverCloseCallbackRunAll(virQEMUDriverPtr driver,
virConnectPtr conn)
{
struct qemuDriverCloseCallbackData data = {
diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h
index 4c729e4..bcacf25 100644
--- a/src/qemu/qemu_conf.h
+++ b/src/qemu/qemu_conf.h
@@ -50,8 +50,11 @@
typedef struct _qemuDriverCloseDef qemuDriverCloseDef;
typedef qemuDriverCloseDef *qemuDriverCloseDefPtr;
+typedef struct _virQEMUDriver virQEMUDriver;
+typedef virQEMUDriver *virQEMUDriverPtr;
+
/* Main driver state */
-struct qemud_driver {
+struct _virQEMUDriver {
virMutex lock;
virThreadPoolPtr workerPool;
@@ -174,9 +177,9 @@ struct _qemuDomainCmdlineDef {
# define QEMUD_MIGRATION_NUM_PORTS 64
-void qemuDriverLock(struct qemud_driver *driver);
-void qemuDriverUnlock(struct qemud_driver *driver);
-int qemuLoadDriverConfig(struct qemud_driver *driver,
+void qemuDriverLock(virQEMUDriverPtr driver);
+void qemuDriverUnlock(virQEMUDriverPtr driver);
+int qemuLoadDriverConfig(virQEMUDriverPtr driver,
const char *filename);
struct qemuDomainDiskInfo {
@@ -186,22 +189,22 @@ struct qemuDomainDiskInfo {
int io_status;
};
-typedef virDomainObjPtr (*qemuDriverCloseCallback)(struct qemud_driver *driver,
+typedef virDomainObjPtr (*qemuDriverCloseCallback)(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virConnectPtr conn);
-int qemuDriverCloseCallbackInit(struct qemud_driver *driver);
-void qemuDriverCloseCallbackShutdown(struct qemud_driver *driver);
-int qemuDriverCloseCallbackSet(struct qemud_driver *driver,
+int qemuDriverCloseCallbackInit(virQEMUDriverPtr driver);
+void qemuDriverCloseCallbackShutdown(virQEMUDriverPtr driver);
+int qemuDriverCloseCallbackSet(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virConnectPtr conn,
qemuDriverCloseCallback cb);
-int qemuDriverCloseCallbackUnset(struct qemud_driver *driver,
+int qemuDriverCloseCallbackUnset(virQEMUDriverPtr driver,
virDomainObjPtr vm,
qemuDriverCloseCallback cb);
-qemuDriverCloseCallback qemuDriverCloseCallbackGet(struct qemud_driver *driver,
+qemuDriverCloseCallback qemuDriverCloseCallbackGet(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virConnectPtr conn);
-void qemuDriverCloseCallbackRunAll(struct qemud_driver *driver,
+void qemuDriverCloseCallbackRunAll(virQEMUDriverPtr driver,
virConnectPtr conn);
#endif /* __QEMUD_CONF_H */
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 92f4a3e..4b8e52b 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -117,7 +117,7 @@ qemuDomainAsyncJobPhaseFromString(enum qemuDomainAsyncJob job,
/* driver must be locked before calling */
-void qemuDomainEventQueue(struct qemud_driver *driver,
+void qemuDomainEventQueue(virQEMUDriverPtr driver,
virDomainEventPtr event)
{
virDomainEventStateQueue(driver->domainEventState, event);
@@ -661,7 +661,7 @@ void qemuDomainSetNamespaceHooks(virCapsPtr caps)
}
static void
-qemuDomainObjSaveJob(struct qemud_driver *driver, virDomainObjPtr obj)
+qemuDomainObjSaveJob(virQEMUDriverPtr driver, virDomainObjPtr obj)
{
if (!virDomainObjIsActive(obj)) {
/* don't write the state file yet, it will be written once the domain
@@ -674,7 +674,7 @@ qemuDomainObjSaveJob(struct qemud_driver *driver, virDomainObjPtr obj)
}
void
-qemuDomainObjSetJobPhase(struct qemud_driver *driver,
+qemuDomainObjSetJobPhase(virQEMUDriverPtr driver,
virDomainObjPtr obj,
int phase)
{
@@ -712,7 +712,7 @@ qemuDomainObjSetAsyncJobMask(virDomainObjPtr obj,
}
void
-qemuDomainObjDiscardAsyncJob(struct qemud_driver *driver, virDomainObjPtr obj)
+qemuDomainObjDiscardAsyncJob(virQEMUDriverPtr driver, virDomainObjPtr obj)
{
qemuDomainObjPrivatePtr priv = obj->privateData;
@@ -758,7 +758,7 @@ qemuDomainJobAllowed(qemuDomainObjPrivatePtr priv, enum qemuDomainJob job)
* locked or not.
*/
static int ATTRIBUTE_NONNULL(1)
-qemuDomainObjBeginJobInternal(struct qemud_driver *driver,
+qemuDomainObjBeginJobInternal(virQEMUDriverPtr driver,
bool driver_locked,
virDomainObjPtr obj,
enum qemuDomainJob job,
@@ -868,7 +868,7 @@ error:
* Upon successful return, the object will have its ref count increased,
* successful calls must be followed by EndJob eventually
*/
-int qemuDomainObjBeginJob(struct qemud_driver *driver,
+int qemuDomainObjBeginJob(virQEMUDriverPtr driver,
virDomainObjPtr obj,
enum qemuDomainJob job)
{
@@ -876,7 +876,7 @@ int qemuDomainObjBeginJob(struct qemud_driver *driver,
QEMU_ASYNC_JOB_NONE);
}
-int qemuDomainObjBeginAsyncJob(struct qemud_driver *driver,
+int qemuDomainObjBeginAsyncJob(virQEMUDriverPtr driver,
virDomainObjPtr obj,
enum qemuDomainAsyncJob asyncJob)
{
@@ -893,7 +893,7 @@ int qemuDomainObjBeginAsyncJob(struct qemud_driver *driver,
* Upon successful return, the object will have its ref count increased,
* successful calls must be followed by EndJob eventually
*/
-int qemuDomainObjBeginJobWithDriver(struct qemud_driver *driver,
+int qemuDomainObjBeginJobWithDriver(virQEMUDriverPtr driver,
virDomainObjPtr obj,
enum qemuDomainJob job)
{
@@ -907,7 +907,7 @@ int qemuDomainObjBeginJobWithDriver(struct qemud_driver *driver,
QEMU_ASYNC_JOB_NONE);
}
-int qemuDomainObjBeginAsyncJobWithDriver(struct qemud_driver *driver,
+int qemuDomainObjBeginAsyncJobWithDriver(virQEMUDriverPtr driver,
virDomainObjPtr obj,
enum qemuDomainAsyncJob asyncJob)
{
@@ -924,7 +924,7 @@ int qemuDomainObjBeginAsyncJobWithDriver(struct qemud_driver *driver,
* Returns true if @obj was still referenced, false if it was
* disposed of.
*/
-bool qemuDomainObjEndJob(struct qemud_driver *driver, virDomainObjPtr obj)
+bool qemuDomainObjEndJob(virQEMUDriverPtr driver, virDomainObjPtr obj)
{
qemuDomainObjPrivatePtr priv = obj->privateData;
enum qemuDomainJob job = priv->job.active;
@@ -944,7 +944,7 @@ bool qemuDomainObjEndJob(struct qemud_driver *driver, virDomainObjPtr obj)
}
bool
-qemuDomainObjEndAsyncJob(struct qemud_driver *driver, virDomainObjPtr obj)
+qemuDomainObjEndAsyncJob(virQEMUDriverPtr driver, virDomainObjPtr obj)
{
qemuDomainObjPrivatePtr priv = obj->privateData;
@@ -972,7 +972,7 @@ qemuDomainObjAbortAsyncJob(virDomainObjPtr obj)
}
static int
-qemuDomainObjEnterMonitorInternal(struct qemud_driver *driver,
+qemuDomainObjEnterMonitorInternal(virQEMUDriverPtr driver,
bool driver_locked,
virDomainObjPtr obj,
enum qemuDomainAsyncJob asyncJob)
@@ -1015,7 +1015,7 @@ qemuDomainObjEnterMonitorInternal(struct qemud_driver *driver,
}
static void ATTRIBUTE_NONNULL(1)
-qemuDomainObjExitMonitorInternal(struct qemud_driver *driver,
+qemuDomainObjExitMonitorInternal(virQEMUDriverPtr driver,
bool driver_locked,
virDomainObjPtr obj)
{
@@ -1053,7 +1053,7 @@ qemuDomainObjExitMonitorInternal(struct qemud_driver *driver,
*
* To be followed with qemuDomainObjExitMonitor() once complete
*/
-void qemuDomainObjEnterMonitor(struct qemud_driver *driver,
+void qemuDomainObjEnterMonitor(virQEMUDriverPtr driver,
virDomainObjPtr obj)
{
ignore_value(qemuDomainObjEnterMonitorInternal(driver, false, obj,
@@ -1064,7 +1064,7 @@ void qemuDomainObjEnterMonitor(struct qemud_driver *driver,
*
* Should be paired with an earlier qemuDomainObjEnterMonitor() call
*/
-void qemuDomainObjExitMonitor(struct qemud_driver *driver,
+void qemuDomainObjExitMonitor(virQEMUDriverPtr driver,
virDomainObjPtr obj)
{
qemuDomainObjExitMonitorInternal(driver, false, obj);
@@ -1079,7 +1079,7 @@ void qemuDomainObjExitMonitor(struct qemud_driver *driver,
*
* To be followed with qemuDomainObjExitMonitorWithDriver() once complete
*/
-void qemuDomainObjEnterMonitorWithDriver(struct qemud_driver *driver,
+void qemuDomainObjEnterMonitorWithDriver(virQEMUDriverPtr driver,
virDomainObjPtr obj)
{
ignore_value(qemuDomainObjEnterMonitorInternal(driver, true, obj,
@@ -1100,7 +1100,7 @@ void qemuDomainObjEnterMonitorWithDriver(struct qemud_driver *driver,
* started (probably because the vm exited in the meantime).
*/
int
-qemuDomainObjEnterMonitorAsync(struct qemud_driver *driver,
+qemuDomainObjEnterMonitorAsync(virQEMUDriverPtr driver,
virDomainObjPtr obj,
enum qemuDomainAsyncJob asyncJob)
{
@@ -1112,7 +1112,7 @@ qemuDomainObjEnterMonitorAsync(struct qemud_driver *driver,
*
* Should be paired with an earlier qemuDomainObjEnterMonitorWithDriver() call
*/
-void qemuDomainObjExitMonitorWithDriver(struct qemud_driver *driver,
+void qemuDomainObjExitMonitorWithDriver(virQEMUDriverPtr driver,
virDomainObjPtr obj)
{
qemuDomainObjExitMonitorInternal(driver, true, obj);
@@ -1121,7 +1121,7 @@ void qemuDomainObjExitMonitorWithDriver(struct qemud_driver *driver,
static int
-qemuDomainObjEnterAgentInternal(struct qemud_driver *driver,
+qemuDomainObjEnterAgentInternal(virQEMUDriverPtr driver,
bool driver_locked,
virDomainObjPtr obj)
{
@@ -1138,7 +1138,7 @@ qemuDomainObjEnterAgentInternal(struct qemud_driver *driver,
}
static void ATTRIBUTE_NONNULL(1)
-qemuDomainObjExitAgentInternal(struct qemud_driver *driver,
+qemuDomainObjExitAgentInternal(virQEMUDriverPtr driver,
bool driver_locked,
virDomainObjPtr obj)
{
@@ -1168,7 +1168,7 @@ qemuDomainObjExitAgentInternal(struct qemud_driver *driver,
*
* To be followed with qemuDomainObjExitAgent() once complete
*/
-void qemuDomainObjEnterAgent(struct qemud_driver *driver,
+void qemuDomainObjEnterAgent(virQEMUDriverPtr driver,
virDomainObjPtr obj)
{
ignore_value(qemuDomainObjEnterAgentInternal(driver, false, obj));
@@ -1178,7 +1178,7 @@ void qemuDomainObjEnterAgent(struct qemud_driver *driver,
*
* Should be paired with an earlier qemuDomainObjEnterAgent() call
*/
-void qemuDomainObjExitAgent(struct qemud_driver *driver,
+void qemuDomainObjExitAgent(virQEMUDriverPtr driver,
virDomainObjPtr obj)
{
qemuDomainObjExitAgentInternal(driver, false, obj);
@@ -1193,7 +1193,7 @@ void qemuDomainObjExitAgent(struct qemud_driver *driver,
*
* To be followed with qemuDomainObjExitAgentWithDriver() once complete
*/
-void qemuDomainObjEnterAgentWithDriver(struct qemud_driver *driver,
+void qemuDomainObjEnterAgentWithDriver(virQEMUDriverPtr driver,
virDomainObjPtr obj)
{
ignore_value(qemuDomainObjEnterAgentInternal(driver, true, obj));
@@ -1204,13 +1204,13 @@ void qemuDomainObjEnterAgentWithDriver(struct qemud_driver *driver,
*
* Should be paired with an earlier qemuDomainObjEnterAgentWithDriver() call
*/
-void qemuDomainObjExitAgentWithDriver(struct qemud_driver *driver,
+void qemuDomainObjExitAgentWithDriver(virQEMUDriverPtr driver,
virDomainObjPtr obj)
{
qemuDomainObjExitAgentInternal(driver, true, obj);
}
-void qemuDomainObjEnterRemoteWithDriver(struct qemud_driver *driver,
+void qemuDomainObjEnterRemoteWithDriver(virQEMUDriverPtr driver,
virDomainObjPtr obj)
{
virObjectRef(obj);
@@ -1218,7 +1218,7 @@ void qemuDomainObjEnterRemoteWithDriver(struct qemud_driver *driver,
qemuDriverUnlock(driver);
}
-void qemuDomainObjExitRemoteWithDriver(struct qemud_driver *driver,
+void qemuDomainObjExitRemoteWithDriver(virQEMUDriverPtr driver,
virDomainObjPtr obj)
{
qemuDriverLock(driver);
@@ -1228,7 +1228,7 @@ void qemuDomainObjExitRemoteWithDriver(struct qemud_driver *driver,
int
-qemuDomainDefFormatBuf(struct qemud_driver *driver,
+qemuDomainDefFormatBuf(virQEMUDriverPtr driver,
virDomainDefPtr def,
unsigned int flags,
virBuffer *buf)
@@ -1307,7 +1307,7 @@ cleanup:
return ret;
}
-char *qemuDomainDefFormatXML(struct qemud_driver *driver,
+char *qemuDomainDefFormatXML(virQEMUDriverPtr driver,
virDomainDefPtr def,
unsigned int flags)
{
@@ -1327,7 +1327,7 @@ char *qemuDomainDefFormatXML(struct qemud_driver *driver,
return virBufferContentAndReset(&buf);
}
-char *qemuDomainFormatXML(struct qemud_driver *driver,
+char *qemuDomainFormatXML(virQEMUDriverPtr driver,
virDomainObjPtr vm,
unsigned int flags)
{
@@ -1342,7 +1342,7 @@ char *qemuDomainFormatXML(struct qemud_driver *driver,
}
char *
-qemuDomainDefFormatLive(struct qemud_driver *driver,
+qemuDomainDefFormatLive(virQEMUDriverPtr driver,
virDomainDefPtr def,
bool inactive,
bool compatible)
@@ -1358,7 +1358,7 @@ qemuDomainDefFormatLive(struct qemud_driver *driver,
}
-void qemuDomainObjTaint(struct qemud_driver *driver,
+void qemuDomainObjTaint(virQEMUDriverPtr driver,
virDomainObjPtr obj,
enum virDomainTaintFlags taint,
int logFD)
@@ -1392,7 +1392,7 @@ void qemuDomainObjTaint(struct qemud_driver *driver,
}
-void qemuDomainObjCheckTaint(struct qemud_driver *driver,
+void qemuDomainObjCheckTaint(virQEMUDriverPtr driver,
virDomainObjPtr obj,
int logFD)
{
@@ -1421,7 +1421,7 @@ void qemuDomainObjCheckTaint(struct qemud_driver *driver,
}
-void qemuDomainObjCheckDiskTaint(struct qemud_driver *driver,
+void qemuDomainObjCheckDiskTaint(virQEMUDriverPtr driver,
virDomainObjPtr obj,
virDomainDiskDefPtr disk,
int logFD)
@@ -1435,7 +1435,7 @@ void qemuDomainObjCheckDiskTaint(struct qemud_driver *driver,
}
-void qemuDomainObjCheckNetTaint(struct qemud_driver *driver,
+void qemuDomainObjCheckNetTaint(virQEMUDriverPtr driver,
virDomainObjPtr obj,
virDomainNetDefPtr net,
int logFD)
@@ -1451,7 +1451,7 @@ void qemuDomainObjCheckNetTaint(struct qemud_driver *driver,
static int
-qemuDomainOpenLogHelper(struct qemud_driver *driver,
+qemuDomainOpenLogHelper(virQEMUDriverPtr driver,
virDomainObjPtr vm,
int oflags,
mode_t mode)
@@ -1500,7 +1500,7 @@ cleanup:
int
-qemuDomainCreateLog(struct qemud_driver *driver, virDomainObjPtr vm,
+qemuDomainCreateLog(virQEMUDriverPtr driver, virDomainObjPtr vm,
bool append)
{
int oflags;
@@ -1517,7 +1517,7 @@ qemuDomainCreateLog(struct qemud_driver *driver, virDomainObjPtr vm,
int
-qemuDomainOpenLog(struct qemud_driver *driver, virDomainObjPtr vm, off_t pos)
+qemuDomainOpenLog(virQEMUDriverPtr driver, virDomainObjPtr vm, off_t pos)
{
int fd;
off_t off;
@@ -1550,7 +1550,7 @@ qemuDomainOpenLog(struct qemud_driver *driver, virDomainObjPtr vm, off_t pos)
}
-int qemuDomainAppendLog(struct qemud_driver *driver,
+int qemuDomainAppendLog(virQEMUDriverPtr driver,
virDomainObjPtr obj,
int logFD,
const char *fmt, ...)
@@ -1590,7 +1590,7 @@ cleanup:
/* Locate an appropriate 'qemu-img' binary. */
const char *
-qemuFindQemuImgBinary(struct qemud_driver *driver)
+qemuFindQemuImgBinary(virQEMUDriverPtr driver)
{
if (!driver->qemuImgBinary) {
driver->qemuImgBinary = virFindFileInPath("kvm-img");
@@ -1648,7 +1648,7 @@ cleanup:
/* The domain is expected to be locked and inactive. Return -1 on normal
* failure, 1 if we skipped a disk due to try_all. */
static int
-qemuDomainSnapshotForEachQcow2Raw(struct qemud_driver *driver,
+qemuDomainSnapshotForEachQcow2Raw(virQEMUDriverPtr driver,
virDomainDefPtr def,
const char *name,
const char *op,
@@ -1719,7 +1719,7 @@ qemuDomainSnapshotForEachQcow2Raw(struct qemud_driver *driver,
/* The domain is expected to be locked and inactive. Return -1 on normal
* failure, 1 if we skipped a disk due to try_all. */
int
-qemuDomainSnapshotForEachQcow2(struct qemud_driver *driver,
+qemuDomainSnapshotForEachQcow2(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainSnapshotObjPtr snap,
const char *op,
@@ -1738,7 +1738,7 @@ qemuDomainSnapshotForEachQcow2(struct qemud_driver *driver,
/* Discard one snapshot (or its metadata), without reparenting any children. */
int
-qemuDomainSnapshotDiscard(struct qemud_driver *driver,
+qemuDomainSnapshotDiscard(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainSnapshotObjPtr snap,
bool update_current,
@@ -1821,7 +1821,7 @@ void qemuDomainSnapshotDiscardAll(void *payload,
}
int
-qemuDomainSnapshotDiscardAllMetadata(struct qemud_driver *driver,
+qemuDomainSnapshotDiscardAllMetadata(virQEMUDriverPtr driver,
virDomainObjPtr vm)
{
struct qemu_snap_remove rem;
@@ -1841,7 +1841,7 @@ qemuDomainSnapshotDiscardAllMetadata(struct qemud_driver *driver,
* be no remaining references to vm.
*/
void
-qemuDomainRemoveInactive(struct qemud_driver *driver,
+qemuDomainRemoveInactive(virQEMUDriverPtr driver,
virDomainObjPtr vm)
{
char *snapDir;
@@ -1864,7 +1864,7 @@ qemuDomainRemoveInactive(struct qemud_driver *driver,
}
void
-qemuDomainSetFakeReboot(struct qemud_driver *driver,
+qemuDomainSetFakeReboot(virQEMUDriverPtr driver,
virDomainObjPtr vm,
bool value)
{
@@ -1880,7 +1880,7 @@ qemuDomainSetFakeReboot(struct qemud_driver *driver,
}
int
-qemuDomainCheckDiskPresence(struct qemud_driver *driver,
+qemuDomainCheckDiskPresence(virQEMUDriverPtr driver,
virDomainObjPtr vm,
bool cold_boot)
{
@@ -2002,7 +2002,7 @@ qemuDomainCleanupRemove(virDomainObjPtr vm,
}
void
-qemuDomainCleanupRun(struct qemud_driver *driver,
+qemuDomainCleanupRun(virQEMUDriverPtr driver,
virDomainObjPtr vm)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
@@ -2022,7 +2022,7 @@ qemuDomainCleanupRun(struct qemud_driver *driver,
}
int
-qemuDomainDetermineDiskChain(struct qemud_driver *driver,
+qemuDomainDetermineDiskChain(virQEMUDriverPtr driver,
virDomainDiskDefPtr disk,
bool force)
{
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index a2acc0a..4a70362 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -117,7 +117,7 @@ struct qemuDomainJobObj {
typedef struct _qemuDomainPCIAddressSet qemuDomainPCIAddressSet;
typedef qemuDomainPCIAddressSet *qemuDomainPCIAddressSetPtr;
-typedef void (*qemuDomainCleanupCallback)(struct qemud_driver *driver,
+typedef void (*qemuDomainCleanupCallback)(virQEMUDriverPtr driver,
virDomainObjPtr vm);
typedef struct _qemuDomainObjPrivate qemuDomainObjPrivate;
@@ -176,37 +176,37 @@ int qemuDomainAsyncJobPhaseFromString(enum qemuDomainAsyncJob job,
void qemuDomainEventFlush(int timer, void *opaque);
/* driver must be locked before calling */
-void qemuDomainEventQueue(struct qemud_driver *driver,
+void qemuDomainEventQueue(virQEMUDriverPtr driver,
virDomainEventPtr event);
void qemuDomainSetPrivateDataHooks(virCapsPtr caps);
void qemuDomainSetNamespaceHooks(virCapsPtr caps);
-int qemuDomainObjBeginJob(struct qemud_driver *driver,
+int qemuDomainObjBeginJob(virQEMUDriverPtr driver,
virDomainObjPtr obj,
enum qemuDomainJob job)
ATTRIBUTE_RETURN_CHECK;
-int qemuDomainObjBeginAsyncJob(struct qemud_driver *driver,
+int qemuDomainObjBeginAsyncJob(virQEMUDriverPtr driver,
virDomainObjPtr obj,
enum qemuDomainAsyncJob asyncJob)
ATTRIBUTE_RETURN_CHECK;
-int qemuDomainObjBeginJobWithDriver(struct qemud_driver *driver,
+int qemuDomainObjBeginJobWithDriver(virQEMUDriverPtr driver,
virDomainObjPtr obj,
enum qemuDomainJob job)
ATTRIBUTE_RETURN_CHECK;
-int qemuDomainObjBeginAsyncJobWithDriver(struct qemud_driver *driver,
+int qemuDomainObjBeginAsyncJobWithDriver(virQEMUDriverPtr driver,
virDomainObjPtr obj,
enum qemuDomainAsyncJob asyncJob)
ATTRIBUTE_RETURN_CHECK;
-bool qemuDomainObjEndJob(struct qemud_driver *driver,
+bool qemuDomainObjEndJob(virQEMUDriverPtr driver,
virDomainObjPtr obj)
ATTRIBUTE_RETURN_CHECK;
-bool qemuDomainObjEndAsyncJob(struct qemud_driver *driver,
+bool qemuDomainObjEndAsyncJob(virQEMUDriverPtr driver,
virDomainObjPtr obj)
ATTRIBUTE_RETURN_CHECK;
void qemuDomainObjAbortAsyncJob(virDomainObjPtr obj);
-void qemuDomainObjSetJobPhase(struct qemud_driver *driver,
+void qemuDomainObjSetJobPhase(virQEMUDriverPtr driver,
virDomainObjPtr obj,
int phase);
void qemuDomainObjSetAsyncJobMask(virDomainObjPtr obj,
@@ -214,112 +214,112 @@ void qemuDomainObjSetAsyncJobMask(virDomainObjPtr obj,
void qemuDomainObjRestoreJob(virDomainObjPtr obj,
struct qemuDomainJobObj *job);
void qemuDomainObjTransferJob(virDomainObjPtr obj);
-void qemuDomainObjDiscardAsyncJob(struct qemud_driver *driver,
+void qemuDomainObjDiscardAsyncJob(virQEMUDriverPtr driver,
virDomainObjPtr obj);
void qemuDomainObjReleaseAsyncJob(virDomainObjPtr obj);
-void qemuDomainObjEnterMonitor(struct qemud_driver *driver,
+void qemuDomainObjEnterMonitor(virQEMUDriverPtr driver,
virDomainObjPtr obj)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
-void qemuDomainObjExitMonitor(struct qemud_driver *driver,
+void qemuDomainObjExitMonitor(virQEMUDriverPtr driver,
virDomainObjPtr obj)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
-void qemuDomainObjEnterMonitorWithDriver(struct qemud_driver *driver,
+void qemuDomainObjEnterMonitorWithDriver(virQEMUDriverPtr driver,
virDomainObjPtr obj)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
-int qemuDomainObjEnterMonitorAsync(struct qemud_driver *driver,
+int qemuDomainObjEnterMonitorAsync(virQEMUDriverPtr driver,
virDomainObjPtr obj,
enum qemuDomainAsyncJob asyncJob)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
-void qemuDomainObjExitMonitorWithDriver(struct qemud_driver *driver,
+void qemuDomainObjExitMonitorWithDriver(virQEMUDriverPtr driver,
virDomainObjPtr obj)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
-void qemuDomainObjEnterAgent(struct qemud_driver *driver,
+void qemuDomainObjEnterAgent(virQEMUDriverPtr driver,
virDomainObjPtr obj)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
-void qemuDomainObjExitAgent(struct qemud_driver *driver,
+void qemuDomainObjExitAgent(virQEMUDriverPtr driver,
virDomainObjPtr obj)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
-void qemuDomainObjEnterAgentWithDriver(struct qemud_driver *driver,
+void qemuDomainObjEnterAgentWithDriver(virQEMUDriverPtr driver,
virDomainObjPtr obj)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
-void qemuDomainObjExitAgentWithDriver(struct qemud_driver *driver,
+void qemuDomainObjExitAgentWithDriver(virQEMUDriverPtr driver,
virDomainObjPtr obj)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
-void qemuDomainObjEnterRemoteWithDriver(struct qemud_driver *driver,
+void qemuDomainObjEnterRemoteWithDriver(virQEMUDriverPtr driver,
virDomainObjPtr obj)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
-void qemuDomainObjExitRemoteWithDriver(struct qemud_driver *driver,
+void qemuDomainObjExitRemoteWithDriver(virQEMUDriverPtr driver,
virDomainObjPtr obj)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
-int qemuDomainDefFormatBuf(struct qemud_driver *driver,
+int qemuDomainDefFormatBuf(virQEMUDriverPtr driver,
virDomainDefPtr vm,
unsigned int flags,
virBuffer *buf);
-char *qemuDomainDefFormatXML(struct qemud_driver *driver,
+char *qemuDomainDefFormatXML(virQEMUDriverPtr driver,
virDomainDefPtr vm,
unsigned int flags);
-char *qemuDomainFormatXML(struct qemud_driver *driver,
+char *qemuDomainFormatXML(virQEMUDriverPtr driver,
virDomainObjPtr vm,
unsigned int flags);
-char *qemuDomainDefFormatLive(struct qemud_driver *driver,
+char *qemuDomainDefFormatLive(virQEMUDriverPtr driver,
virDomainDefPtr def,
bool inactive,
bool compatible);
-void qemuDomainObjTaint(struct qemud_driver *driver,
+void qemuDomainObjTaint(virQEMUDriverPtr driver,
virDomainObjPtr obj,
enum virDomainTaintFlags taint,
int logFD);
-void qemuDomainObjCheckTaint(struct qemud_driver *driver,
+void qemuDomainObjCheckTaint(virQEMUDriverPtr driver,
virDomainObjPtr obj,
int logFD);
-void qemuDomainObjCheckDiskTaint(struct qemud_driver *driver,
+void qemuDomainObjCheckDiskTaint(virQEMUDriverPtr driver,
virDomainObjPtr obj,
virDomainDiskDefPtr disk,
int logFD);
-void qemuDomainObjCheckNetTaint(struct qemud_driver *driver,
+void qemuDomainObjCheckNetTaint(virQEMUDriverPtr driver,
virDomainObjPtr obj,
virDomainNetDefPtr net,
int logFD);
-int qemuDomainCreateLog(struct qemud_driver *driver, virDomainObjPtr vm, bool append);
-int qemuDomainOpenLog(struct qemud_driver *driver, virDomainObjPtr vm, off_t pos);
-int qemuDomainAppendLog(struct qemud_driver *driver,
+int qemuDomainCreateLog(virQEMUDriverPtr driver, virDomainObjPtr vm, bool append);
+int qemuDomainOpenLog(virQEMUDriverPtr driver, virDomainObjPtr vm, off_t pos);
+int qemuDomainAppendLog(virQEMUDriverPtr driver,
virDomainObjPtr vm,
int logFD,
const char *fmt, ...) ATTRIBUTE_FMT_PRINTF(4, 5);
-const char *qemuFindQemuImgBinary(struct qemud_driver *driver);
+const char *qemuFindQemuImgBinary(virQEMUDriverPtr driver);
int qemuDomainSnapshotWriteMetadata(virDomainObjPtr vm,
virDomainSnapshotObjPtr snapshot,
char *snapshotDir);
-int qemuDomainSnapshotForEachQcow2(struct qemud_driver *driver,
+int qemuDomainSnapshotForEachQcow2(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainSnapshotObjPtr snap,
const char *op,
bool try_all);
-int qemuDomainSnapshotDiscard(struct qemud_driver *driver,
+int qemuDomainSnapshotDiscard(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainSnapshotObjPtr snap,
bool update_current,
bool metadata_only);
struct qemu_snap_remove {
- struct qemud_driver *driver;
+ virQEMUDriverPtr driver;
virDomainObjPtr vm;
int err;
bool metadata_only;
@@ -330,23 +330,23 @@ void qemuDomainSnapshotDiscardAll(void *payload,
const void *name,
void *data);
-int qemuDomainSnapshotDiscardAllMetadata(struct qemud_driver *driver,
+int qemuDomainSnapshotDiscardAllMetadata(virQEMUDriverPtr driver,
virDomainObjPtr vm);
-void qemuDomainRemoveInactive(struct qemud_driver *driver,
+void qemuDomainRemoveInactive(virQEMUDriverPtr driver,
virDomainObjPtr vm);
-void qemuDomainSetFakeReboot(struct qemud_driver *driver,
+void qemuDomainSetFakeReboot(virQEMUDriverPtr driver,
virDomainObjPtr vm,
bool value);
bool qemuDomainJobAllowed(qemuDomainObjPrivatePtr priv,
enum qemuDomainJob job);
-int qemuDomainCheckDiskPresence(struct qemud_driver *driver,
+int qemuDomainCheckDiskPresence(virQEMUDriverPtr driver,
virDomainObjPtr vm,
bool start_with_state);
-int qemuDomainDetermineDiskChain(struct qemud_driver *driver,
+int qemuDomainDetermineDiskChain(virQEMUDriverPtr driver,
virDomainDiskDefPtr disk,
bool force);
@@ -354,7 +354,7 @@ int qemuDomainCleanupAdd(virDomainObjPtr vm,
qemuDomainCleanupCallback cb);
void qemuDomainCleanupRemove(virDomainObjPtr vm,
qemuDomainCleanupCallback cb);
-void qemuDomainCleanupRun(struct qemud_driver *driver,
+void qemuDomainCleanupRun(virQEMUDriverPtr driver,
virDomainObjPtr vm);
#endif /* __QEMU_DOMAIN_H__ */
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 7892293..7bccd25 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -139,7 +139,7 @@ static void processWatchdogEvent(void *data, void *opaque);
static int qemuShutdown(void);
static int qemuDomainObjStart(virConnectPtr conn,
- struct qemud_driver *driver,
+ virQEMUDriverPtr driver,
virDomainObjPtr vm,
unsigned int flags);
@@ -150,7 +150,7 @@ static void qemuDomainManagedSaveLoad(void *payload,
void *opaque);
-struct qemud_driver *qemu_driver = NULL;
+virQEMUDriverPtr qemu_driver = NULL;
static void
@@ -183,7 +183,7 @@ static virNWFilterCallbackDriver qemuCallbackDriver = {
struct qemuAutostartData {
- struct qemud_driver *driver;
+ virQEMUDriverPtr driver;
virConnectPtr conn;
};
@@ -193,7 +193,7 @@ struct qemuAutostartData {
static virDomainObjPtr
qemuDomObjFromDomain(virDomainPtr domain)
{
- struct qemud_driver *driver = domain->conn->privateData;
+ virQEMUDriverPtr driver = domain->conn->privateData;
virDomainObjPtr vm;
char uuidstr[VIR_UUID_STRING_BUFLEN];
@@ -287,7 +287,7 @@ cleanup:
static void
-qemuAutostartDomains(struct qemud_driver *driver)
+qemuAutostartDomains(virQEMUDriverPtr driver)
{
/* XXX: Figure out a better way todo this. The domain
* startup code needs a connection handle in order
@@ -309,7 +309,7 @@ qemuAutostartDomains(struct qemud_driver *driver)
}
static int
-qemuSecurityInit(struct qemud_driver *driver)
+qemuSecurityInit(virQEMUDriverPtr driver)
{
char **names;
virSecurityManagerPtr mgr = NULL;
@@ -378,7 +378,7 @@ error:
static virCapsPtr
-qemuCreateCapabilities(struct qemud_driver *driver)
+qemuCreateCapabilities(virQEMUDriverPtr driver)
{
size_t i;
virCapsPtr caps;
@@ -937,7 +937,7 @@ error:
static void qemuNotifyLoadDomain(virDomainObjPtr vm, int newVM, void *opaque)
{
- struct qemud_driver *driver = opaque;
+ virQEMUDriverPtr driver = opaque;
if (newVM) {
virDomainEventPtr event =
@@ -1131,7 +1131,7 @@ static virDrvOpenStatus qemuOpen(virConnectPtr conn,
}
static int qemuClose(virConnectPtr conn) {
- struct qemud_driver *driver = conn->privateData;
+ virQEMUDriverPtr driver = conn->privateData;
/* Get rid of callbacks registered for this conn */
qemuDriverLock(driver);
@@ -1207,7 +1207,7 @@ static int kvmGetMaxVCPUs(void) {
static char *
qemuGetSysinfo(virConnectPtr conn, unsigned int flags)
{
- struct qemud_driver *driver = conn->privateData;
+ virQEMUDriverPtr driver = conn->privateData;
virBuffer buf = VIR_BUFFER_INITIALIZER;
virCheckFlags(0, NULL);
@@ -1247,7 +1247,7 @@ static int qemuGetMaxVCPUs(virConnectPtr conn ATTRIBUTE_UNUSED, const char *type
static char *qemuGetCapabilities(virConnectPtr conn) {
- struct qemud_driver *driver = conn->privateData;
+ virQEMUDriverPtr driver = conn->privateData;
virCapsPtr caps = NULL;
char *xml = NULL;
@@ -1349,7 +1349,7 @@ qemuGetProcessInfo(unsigned long long *cpuTime, int *lastCpu, long *vm_rss,
static virDomainPtr qemuDomainLookupByID(virConnectPtr conn,
int id) {
- struct qemud_driver *driver = conn->privateData;
+ virQEMUDriverPtr driver = conn->privateData;
virDomainObjPtr vm;
virDomainPtr dom = NULL;
@@ -1374,7 +1374,7 @@ cleanup:
static virDomainPtr qemuDomainLookupByUUID(virConnectPtr conn,
const unsigned char *uuid) {
- struct qemud_driver *driver = conn->privateData;
+ virQEMUDriverPtr driver = conn->privateData;
virDomainObjPtr vm;
virDomainPtr dom = NULL;
@@ -1401,7 +1401,7 @@ cleanup:
static virDomainPtr qemuDomainLookupByName(virConnectPtr conn,
const char *name) {
- struct qemud_driver *driver = conn->privateData;
+ virQEMUDriverPtr driver = conn->privateData;
virDomainObjPtr vm;
virDomainPtr dom = NULL;
@@ -1427,7 +1427,7 @@ cleanup:
static int qemuDomainIsActive(virDomainPtr dom)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr obj;
int ret = -1;
@@ -1451,7 +1451,7 @@ cleanup:
static int qemuDomainIsPersistent(virDomainPtr dom)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr obj;
int ret = -1;
@@ -1475,7 +1475,7 @@ cleanup:
static int qemuDomainIsUpdated(virDomainPtr dom)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr obj;
int ret = -1;
@@ -1498,7 +1498,7 @@ cleanup:
}
static int qemuGetVersion(virConnectPtr conn, unsigned long *version) {
- struct qemud_driver *driver = conn->privateData;
+ virQEMUDriverPtr driver = conn->privateData;
int ret = -1;
qemuDriverLock(driver);
@@ -1516,7 +1516,7 @@ cleanup:
}
static int qemuListDomains(virConnectPtr conn, int *ids, int nids) {
- struct qemud_driver *driver = conn->privateData;
+ virQEMUDriverPtr driver = conn->privateData;
int n;
qemuDriverLock(driver);
@@ -1527,7 +1527,7 @@ static int qemuListDomains(virConnectPtr conn, int *ids, int nids) {
}
static int qemuNumDomains(virConnectPtr conn) {
- struct qemud_driver *driver = conn->privateData;
+ virQEMUDriverPtr driver = conn->privateData;
int n;
qemuDriverLock(driver);
@@ -1562,7 +1562,7 @@ qemuCanonicalizeMachine(virDomainDefPtr def, qemuCapsPtr caps)
static virDomainPtr qemuDomainCreate(virConnectPtr conn, const char *xml,
unsigned int flags) {
- struct qemud_driver *driver = conn->privateData;
+ virQEMUDriverPtr driver = conn->privateData;
virDomainDefPtr def;
virDomainObjPtr vm = NULL;
virDomainPtr dom = NULL;
@@ -1658,7 +1658,7 @@ cleanup:
static int qemuDomainSuspend(virDomainPtr dom) {
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
int ret = -1;
virDomainEventPtr event = NULL;
@@ -1741,7 +1741,7 @@ cleanup:
static int qemuDomainResume(virDomainPtr dom) {
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
int ret = -1;
virDomainEventPtr event = NULL;
@@ -1803,7 +1803,7 @@ cleanup:
}
static int qemuDomainShutdownFlags(virDomainPtr dom, unsigned int flags) {
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
int ret = -1;
qemuDomainObjPrivatePtr priv;
@@ -1885,7 +1885,7 @@ static int qemuDomainShutdown(virDomainPtr dom)
static int
qemuDomainReboot(virDomainPtr dom, unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
int ret = -1;
qemuDomainObjPrivatePtr priv;
@@ -1979,7 +1979,7 @@ cleanup:
static int
qemuDomainReset(virDomainPtr dom, unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
int ret = -1;
qemuDomainObjPrivatePtr priv;
@@ -2042,7 +2042,7 @@ static int
qemuDomainDestroyFlags(virDomainPtr dom,
unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
int ret = -1;
virDomainEventPtr event = NULL;
@@ -2127,7 +2127,7 @@ qemuDomainDestroy(virDomainPtr dom)
}
static char *qemuDomainGetOSType(virDomainPtr dom) {
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
char *type = NULL;
@@ -2155,7 +2155,7 @@ cleanup:
static unsigned long long
qemuDomainGetMaxMemory(virDomainPtr dom)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
unsigned long long ret = 0;
@@ -2181,7 +2181,7 @@ cleanup:
static int qemuDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
unsigned int flags) {
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
qemuDomainObjPrivatePtr priv;
virDomainObjPtr vm;
virDomainDefPtr persistentDef = NULL;
@@ -2288,7 +2288,7 @@ static int qemuDomainSetMaxMemory(virDomainPtr dom, unsigned long memory)
static int qemuDomainInjectNMI(virDomainPtr domain, unsigned int flags)
{
- struct qemud_driver *driver = domain->conn->privateData;
+ virQEMUDriverPtr driver = domain->conn->privateData;
virDomainObjPtr vm = NULL;
int ret = -1;
qemuDomainObjPrivatePtr priv;
@@ -2346,7 +2346,7 @@ static int qemuDomainSendKey(virDomainPtr domain,
int nkeycodes,
unsigned int flags)
{
- struct qemud_driver *driver = domain->conn->privateData;
+ virQEMUDriverPtr driver = domain->conn->privateData;
virDomainObjPtr vm = NULL;
int ret = -1;
qemuDomainObjPrivatePtr priv;
@@ -2411,7 +2411,7 @@ cleanup:
static int qemuDomainGetInfo(virDomainPtr dom,
virDomainInfoPtr info)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
int ret = -1;
int err;
@@ -2499,7 +2499,7 @@ qemuDomainGetState(virDomainPtr dom,
int *reason,
unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
int ret = -1;
@@ -2531,7 +2531,7 @@ qemuDomainGetControlInfo(virDomainPtr dom,
virDomainControlInfoPtr info,
unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
qemuDomainObjPrivatePtr priv;
int ret = -1;
@@ -2676,7 +2676,7 @@ qemuCompressProgramName(int compress)
/* Internal function to properly create or open existing files, with
* ownership affected by qemu driver setup. */
static int
-qemuOpenFile(struct qemud_driver *driver, const char *path, int oflags,
+qemuOpenFile(virQEMUDriverPtr driver, const char *path, int oflags,
bool *needUnlink, bool *bypassSecurityDriver)
{
struct stat sb;
@@ -2792,7 +2792,7 @@ cleanup:
* the caller needs to make sure that the processors are stopped and do all other
* actions besides saving memory */
static int
-qemuDomainSaveMemory(struct qemud_driver *driver,
+qemuDomainSaveMemory(virQEMUDriverPtr driver,
virDomainObjPtr vm,
const char *path,
const char *domXML,
@@ -2924,7 +2924,7 @@ cleanup:
* this returns (whether returning success or failure).
*/
static int
-qemuDomainSaveInternal(struct qemud_driver *driver, virDomainPtr dom,
+qemuDomainSaveInternal(virQEMUDriverPtr driver, virDomainPtr dom,
virDomainObjPtr vm, const char *path,
int compressed, const char *xmlin, unsigned int flags)
{
@@ -3063,7 +3063,7 @@ static int
qemuDomainSaveFlags(virDomainPtr dom, const char *path, const char *dxml,
unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
int compressed;
int ret = -1;
virDomainObjPtr vm = NULL;
@@ -3126,7 +3126,7 @@ qemuDomainSave(virDomainPtr dom, const char *path)
}
static char *
-qemuDomainManagedSavePath(struct qemud_driver *driver, virDomainObjPtr vm) {
+qemuDomainManagedSavePath(virQEMUDriverPtr driver, virDomainObjPtr vm) {
char *ret;
if (virAsprintf(&ret, "%s/%s.save", driver->saveDir, vm->def->name) < 0) {
@@ -3140,7 +3140,7 @@ qemuDomainManagedSavePath(struct qemud_driver *driver, virDomainObjPtr vm) {
static int
qemuDomainManagedSave(virDomainPtr dom, unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm = NULL;
char *name = NULL;
int ret = -1;
@@ -3199,7 +3199,7 @@ qemuDomainManagedSaveLoad(void *payload,
void *opaque)
{
virDomainObjPtr vm = payload;
- struct qemud_driver *driver = opaque;
+ virQEMUDriverPtr driver = opaque;
char *name;
virDomainObjLock(vm);
@@ -3217,7 +3217,7 @@ cleanup:
static int
qemuDomainHasManagedSaveImage(virDomainPtr dom, unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm = NULL;
int ret = -1;
@@ -3245,7 +3245,7 @@ cleanup:
static int
qemuDomainManagedSaveRemove(virDomainPtr dom, unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm = NULL;
int ret = -1;
char *name = NULL;
@@ -3277,7 +3277,7 @@ cleanup:
return ret;
}
-static int qemuDumpToFd(struct qemud_driver *driver, virDomainObjPtr vm,
+static int qemuDumpToFd(virQEMUDriverPtr driver, virDomainObjPtr vm,
int fd, enum qemuDomainAsyncJob asyncJob)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
@@ -3305,7 +3305,7 @@ static int qemuDumpToFd(struct qemud_driver *driver, virDomainObjPtr vm,
}
static int
-doCoreDump(struct qemud_driver *driver,
+doCoreDump(virQEMUDriverPtr driver,
virDomainObjPtr vm,
const char *path,
enum qemu_save_formats compress,
@@ -3372,7 +3372,7 @@ cleanup:
}
static enum qemu_save_formats
-getCompressionType(struct qemud_driver *driver)
+getCompressionType(virQEMUDriverPtr driver)
{
int compress = QEMU_SAVE_FORMAT_RAW;
@@ -3404,7 +3404,7 @@ static int qemuDomainCoreDump(virDomainPtr dom,
const char *path,
unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
qemuDomainObjPrivatePtr priv;
int resume = 0, paused = 0;
@@ -3516,7 +3516,7 @@ qemuDomainScreenshot(virDomainPtr dom,
unsigned int screen,
unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
qemuDomainObjPrivatePtr priv;
char *tmp = NULL;
@@ -3610,7 +3610,7 @@ static void processWatchdogEvent(void *data, void *opaque)
{
int ret;
struct qemuDomainWatchdogEvent *wdEvent = data;
- struct qemud_driver *driver = opaque;
+ virQEMUDriverPtr driver = opaque;
qemuDriverLock(driver);
virDomainObjLock(wdEvent->vm);
@@ -3677,7 +3677,7 @@ unlock:
VIR_FREE(wdEvent);
}
-static int qemuDomainHotplugVcpus(struct qemud_driver *driver,
+static int qemuDomainHotplugVcpus(virQEMUDriverPtr driver,
virDomainObjPtr vm,
unsigned int nvcpus)
{
@@ -3874,7 +3874,7 @@ static int
qemuDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
virDomainDefPtr persistentDef;
const char * type;
@@ -3989,7 +3989,7 @@ qemuDomainPinVcpuFlags(virDomainPtr dom,
int maplen,
unsigned int flags) {
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
virDomainDefPtr persistentDef = NULL;
virCgroupPtr cgroup_dom = NULL;
@@ -4173,7 +4173,7 @@ qemuDomainGetVcpuPinInfo(virDomainPtr dom,
int maplen,
unsigned int flags) {
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm = NULL;
virDomainDefPtr targetDef = NULL;
int ret = -1;
@@ -4261,7 +4261,7 @@ qemuDomainPinEmulator(virDomainPtr dom,
int maplen,
unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
virCgroupPtr cgroup_dom = NULL;
virCgroupPtr cgroup_emulator = NULL;
@@ -4423,7 +4423,7 @@ qemuDomainGetEmulatorPinInfo(virDomainPtr dom,
int maplen,
unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm = NULL;
virDomainDefPtr targetDef = NULL;
int ret = -1;
@@ -4499,7 +4499,7 @@ qemuDomainGetVcpus(virDomainPtr dom,
int maxinfo,
unsigned char *cpumaps,
int maplen) {
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
int i, v, maxcpu, hostcpus;
int ret = -1;
@@ -4596,7 +4596,7 @@ cleanup:
static int
qemuDomainGetVcpusFlags(virDomainPtr dom, unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
virDomainDefPtr def;
int ret = -1;
@@ -4641,7 +4641,7 @@ qemuDomainGetMaxVcpus(virDomainPtr dom)
static int qemuDomainGetSecurityLabel(virDomainPtr dom, virSecurityLabelPtr seclabel)
{
- struct qemud_driver *driver = (struct qemud_driver *)dom->conn->privateData;
+ virQEMUDriverPtr driver = (virQEMUDriverPtr )dom->conn->privateData;
virDomainObjPtr vm;
int ret = -1;
@@ -4700,7 +4700,7 @@ cleanup:
static int qemuDomainGetSecurityLabelList(virDomainPtr dom,
virSecurityLabelPtr* seclabels)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
int i, ret = -1;
@@ -4772,7 +4772,7 @@ cleanup:
static int qemuNodeGetSecurityModel(virConnectPtr conn,
virSecurityModelPtr secmodel)
{
- struct qemud_driver *driver = (struct qemud_driver *)conn->privateData;
+ virQEMUDriverPtr driver = (virQEMUDriverPtr )conn->privateData;
char *p;
int ret = 0;
@@ -4814,7 +4814,7 @@ cleanup:
* not represent any changes (no error raised), -3 if corrupt image was
* unlinked (no error raised), and opened fd on success. */
static int ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4)
-qemuDomainSaveImageOpen(struct qemud_driver *driver,
+qemuDomainSaveImageOpen(virQEMUDriverPtr driver,
const char *path,
virDomainDefPtr *ret_def,
struct qemu_save_header *ret_header,
@@ -4959,7 +4959,7 @@ error:
static int ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5) ATTRIBUTE_NONNULL(6)
qemuDomainSaveImageStartVM(virConnectPtr conn,
- struct qemud_driver *driver,
+ virQEMUDriverPtr driver,
virDomainObjPtr vm,
int *fd,
const struct qemu_save_header *header,
@@ -5077,7 +5077,7 @@ qemuDomainRestoreFlags(virConnectPtr conn,
const char *dxml,
unsigned int flags)
{
- struct qemud_driver *driver = conn->privateData;
+ virQEMUDriverPtr driver = conn->privateData;
virDomainDefPtr def = NULL;
virDomainObjPtr vm = NULL;
int fd = -1;
@@ -5150,7 +5150,7 @@ static char *
qemuDomainSaveImageGetXMLDesc(virConnectPtr conn, const char *path,
unsigned int flags)
{
- struct qemud_driver *driver = conn->privateData;
+ virQEMUDriverPtr driver = conn->privateData;
char *ret = NULL;
virDomainDefPtr def = NULL;
int fd = -1;
@@ -5180,7 +5180,7 @@ static int
qemuDomainSaveImageDefineXML(virConnectPtr conn, const char *path,
const char *dxml, unsigned int flags)
{
- struct qemud_driver *driver = conn->privateData;
+ virQEMUDriverPtr driver = conn->privateData;
int ret = -1;
virDomainDefPtr def = NULL;
int fd = -1;
@@ -5252,7 +5252,7 @@ cleanup:
* and -1 on failure with error raised. */
static int
qemuDomainObjRestore(virConnectPtr conn,
- struct qemud_driver *driver,
+ virQEMUDriverPtr driver,
virDomainObjPtr vm,
const char *path,
bool start_paused,
@@ -5306,7 +5306,7 @@ cleanup:
static char *qemuDomainGetXMLDesc(virDomainPtr dom,
unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
char *ret = NULL;
unsigned long long balloon;
@@ -5380,7 +5380,7 @@ static char *qemuDomainXMLFromNative(virConnectPtr conn,
const char *config,
unsigned int flags)
{
- struct qemud_driver *driver = conn->privateData;
+ virQEMUDriverPtr driver = conn->privateData;
virDomainDefPtr def = NULL;
char *xml = NULL;
@@ -5417,7 +5417,7 @@ static char *qemuDomainXMLToNative(virConnectPtr conn,
const char *xmlData,
unsigned int flags)
{
- struct qemud_driver *driver = conn->privateData;
+ virQEMUDriverPtr driver = conn->privateData;
virDomainDefPtr def = NULL;
virDomainChrSourceDef monConfig;
qemuCapsPtr caps = NULL;
@@ -5543,7 +5543,7 @@ cleanup:
static int qemuListDefinedDomains(virConnectPtr conn,
char **const names, int nnames) {
- struct qemud_driver *driver = conn->privateData;
+ virQEMUDriverPtr driver = conn->privateData;
int n;
qemuDriverLock(driver);
@@ -5553,7 +5553,7 @@ static int qemuListDefinedDomains(virConnectPtr conn,
}
static int qemuNumDefinedDomains(virConnectPtr conn) {
- struct qemud_driver *driver = conn->privateData;
+ virQEMUDriverPtr driver = conn->privateData;
int n;
qemuDriverLock(driver);
@@ -5566,7 +5566,7 @@ static int qemuNumDefinedDomains(virConnectPtr conn) {
static int
qemuDomainObjStart(virConnectPtr conn,
- struct qemud_driver *driver,
+ virQEMUDriverPtr driver,
virDomainObjPtr vm,
unsigned int flags)
{
@@ -5644,7 +5644,7 @@ cleanup:
static int
qemuDomainStartWithFlags(virDomainPtr dom, unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
int ret = -1;
@@ -5696,7 +5696,7 @@ qemuDomainStart(virDomainPtr dom)
}
static virDomainPtr qemuDomainDefine(virConnectPtr conn, const char *xml) {
- struct qemud_driver *driver = conn->privateData;
+ virQEMUDriverPtr driver = conn->privateData;
virDomainDefPtr def;
virDomainDefPtr def_backup = NULL;
virDomainObjPtr vm = NULL;
@@ -5801,7 +5801,7 @@ static int
qemuDomainUndefineFlags(virDomainPtr dom,
unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
virDomainEventPtr event = NULL;
char *name = NULL;
@@ -5901,7 +5901,7 @@ qemuDomainUndefine(virDomainPtr dom)
static int
qemuDomainAttachDeviceDiskLive(virConnectPtr conn,
- struct qemud_driver *driver,
+ virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainDeviceDefPtr dev)
{
@@ -5973,7 +5973,7 @@ end:
}
static int
-qemuDomainAttachDeviceControllerLive(struct qemud_driver *driver,
+qemuDomainAttachDeviceControllerLive(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainDeviceDefPtr dev)
{
@@ -5998,7 +5998,7 @@ qemuDomainAttachDeviceLive(virDomainObjPtr vm,
virDomainDeviceDefPtr dev,
virDomainPtr dom)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
int ret = -1;
switch (dev->type) {
@@ -6055,7 +6055,7 @@ qemuDomainAttachDeviceLive(virDomainObjPtr vm,
}
static int
-qemuDomainDetachDeviceDiskLive(struct qemud_driver *driver,
+qemuDomainDetachDeviceDiskLive(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainDeviceDefPtr dev)
{
@@ -6085,7 +6085,7 @@ qemuDomainDetachDeviceDiskLive(struct qemud_driver *driver,
}
static int
-qemuDomainDetachDeviceControllerLive(struct qemud_driver *driver,
+qemuDomainDetachDeviceControllerLive(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainDeviceDefPtr dev)
{
@@ -6109,7 +6109,7 @@ qemuDomainDetachDeviceLive(virDomainObjPtr vm,
virDomainDeviceDefPtr dev,
virDomainPtr dom)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
int ret = -1;
switch (dev->type) {
@@ -6140,7 +6140,7 @@ qemuDomainDetachDeviceLive(virDomainObjPtr vm,
static int
qemuDomainChangeDiskMediaLive(virDomainObjPtr vm,
virDomainDeviceDefPtr dev,
- struct qemud_driver *driver,
+ virQEMUDriverPtr driver,
bool force)
{
virDomainDiskDefPtr disk = dev->data.disk;
@@ -6193,7 +6193,7 @@ qemuDomainUpdateDeviceLive(virDomainObjPtr vm,
virDomainPtr dom,
bool force)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
int ret = -1;
switch (dev->type) {
@@ -6491,7 +6491,7 @@ static int
qemuDomainModifyDeviceFlags(virDomainPtr dom, const char *xml,
unsigned int flags, int action)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm = NULL;
virDomainDefPtr vmdef = NULL;
virDomainDeviceDefPtr dev = NULL, dev_copy = NULL;
@@ -6685,7 +6685,7 @@ static int qemuDomainDetachDevice(virDomainPtr dom, const char *xml)
static int qemuDomainGetAutostart(virDomainPtr dom,
int *autostart) {
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
int ret = -1;
@@ -6712,7 +6712,7 @@ cleanup:
static int qemuDomainSetAutostart(virDomainPtr dom,
int autostart) {
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
char *configFile = NULL, *autostartLink = NULL;
int ret = -1;
@@ -6815,7 +6815,7 @@ cleanup:
static char *qemuGetSchedulerType(virDomainPtr dom,
int *nparams)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
char *ret = NULL;
int rc;
@@ -6979,7 +6979,7 @@ qemuDomainSetBlkioParameters(virDomainPtr dom,
int nparams,
unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
int i;
virCgroupPtr group = NULL;
virDomainObjPtr vm = NULL;
@@ -7132,7 +7132,7 @@ qemuDomainGetBlkioParameters(virDomainPtr dom,
int *nparams,
unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
int i, j;
virCgroupPtr group = NULL;
virDomainObjPtr vm = NULL;
@@ -7318,7 +7318,7 @@ qemuDomainSetMemoryParameters(virDomainPtr dom,
int nparams,
unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
int i;
virDomainDefPtr persistentDef = NULL;
virCgroupPtr group = NULL;
@@ -7487,7 +7487,7 @@ qemuDomainGetMemoryParameters(virDomainPtr dom,
int *nparams,
unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
int i;
virCgroupPtr group = NULL;
virDomainObjPtr vm = NULL;
@@ -7647,7 +7647,7 @@ qemuDomainSetNumaParameters(virDomainPtr dom,
int nparams,
unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
int i;
virDomainDefPtr persistentDef = NULL;
virCgroupPtr group = NULL;
@@ -7796,7 +7796,7 @@ qemuDomainGetNumaParameters(virDomainPtr dom,
int *nparams,
unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
int i;
virCgroupPtr group = NULL;
virDomainObjPtr vm = NULL;
@@ -7993,7 +7993,7 @@ qemuSetSchedulerParametersFlags(virDomainPtr dom,
int nparams,
unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
int i;
virCgroupPtr group = NULL;
virDomainObjPtr vm = NULL;
@@ -8274,7 +8274,7 @@ qemuGetSchedulerParametersFlags(virDomainPtr dom,
int *nparams,
unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virCgroupPtr group = NULL;
virDomainObjPtr vm = NULL;
unsigned long long shares;
@@ -8434,7 +8434,7 @@ qemuDomainBlockResize(virDomainPtr dom,
unsigned long long size,
unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
qemuDomainObjPrivatePtr priv;
int ret = -1, i;
@@ -8525,7 +8525,7 @@ qemuDomainBlockStats(virDomainPtr dom,
const char *path,
struct _virDomainBlockStats *stats)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
int i, ret = -1;
virDomainObjPtr vm;
virDomainDiskDefPtr disk = NULL;
@@ -8602,7 +8602,7 @@ qemuDomainBlockStatsFlags(virDomainPtr dom,
int *nparams,
unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
int i, tmp, ret = -1;
virDomainObjPtr vm;
virDomainDiskDefPtr disk = NULL;
@@ -8779,7 +8779,7 @@ qemuDomainInterfaceStats(virDomainPtr dom,
const char *path,
struct _virDomainInterfaceStats *stats)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
int i;
int ret = -1;
@@ -8841,7 +8841,7 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom,
int nparams,
unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
int i;
virCgroupPtr group = NULL;
virDomainObjPtr vm = NULL;
@@ -9015,7 +9015,7 @@ qemuDomainGetInterfaceParameters(virDomainPtr dom,
int *nparams,
unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
int i;
virCgroupPtr group = NULL;
virDomainObjPtr vm = NULL;
@@ -9136,7 +9136,7 @@ qemuDomainMemoryStats(virDomainPtr dom,
unsigned int nr_stats,
unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
int ret = -1;
@@ -9196,7 +9196,7 @@ qemuDomainBlockPeek(virDomainPtr dom,
void *buffer,
unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
int fd = -1, ret = -1;
const char *actual;
@@ -9263,7 +9263,7 @@ qemuDomainMemoryPeek(virDomainPtr dom,
void *buffer,
unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
char *tmp = NULL;
int fd = -1, ret = -1;
@@ -9356,7 +9356,7 @@ static int qemuDomainGetBlockInfo(virDomainPtr dom,
const char *path,
virDomainBlockInfoPtr info,
unsigned int flags) {
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
int ret = -1;
int fd = -1;
@@ -9511,7 +9511,7 @@ qemuDomainEventRegister(virConnectPtr conn,
void *opaque,
virFreeCallback freecb)
{
- struct qemud_driver *driver = conn->privateData;
+ virQEMUDriverPtr driver = conn->privateData;
int ret;
qemuDriverLock(driver);
@@ -9528,7 +9528,7 @@ static int
qemuDomainEventDeregister(virConnectPtr conn,
virConnectDomainEventCallback callback)
{
- struct qemud_driver *driver = conn->privateData;
+ virQEMUDriverPtr driver = conn->privateData;
int ret;
qemuDriverLock(driver);
@@ -9549,7 +9549,7 @@ qemuDomainEventRegisterAny(virConnectPtr conn,
void *opaque,
virFreeCallback freecb)
{
- struct qemud_driver *driver = conn->privateData;
+ virQEMUDriverPtr driver = conn->privateData;
int ret;
qemuDriverLock(driver);
@@ -9568,7 +9568,7 @@ static int
qemuDomainEventDeregisterAny(virConnectPtr conn,
int callbackID)
{
- struct qemud_driver *driver = conn->privateData;
+ virQEMUDriverPtr driver = conn->privateData;
int ret;
qemuDriverLock(driver);
@@ -9598,7 +9598,7 @@ qemuDomainMigratePrepareTunnel(virConnectPtr dconn,
unsigned long resource ATTRIBUTE_UNUSED,
const char *dom_xml)
{
- struct qemud_driver *driver = dconn->privateData;
+ virQEMUDriverPtr driver = dconn->privateData;
int ret = -1;
virCheckFlags(QEMU_MIGRATION_FLAGS, -1);
@@ -9652,7 +9652,7 @@ qemuDomainMigratePrepare2(virConnectPtr dconn,
unsigned long resource ATTRIBUTE_UNUSED,
const char *dom_xml)
{
- struct qemud_driver *driver = dconn->privateData;
+ virQEMUDriverPtr driver = dconn->privateData;
int ret = -1;
virCheckFlags(QEMU_MIGRATION_FLAGS, -1);
@@ -9708,7 +9708,7 @@ qemuDomainMigratePerform(virDomainPtr dom,
const char *dname,
unsigned long resource)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
int ret = -1;
const char *dconnuri = NULL;
@@ -9764,7 +9764,7 @@ qemuDomainMigrateFinish2(virConnectPtr dconn,
unsigned long flags,
int retcode)
{
- struct qemud_driver *driver = dconn->privateData;
+ virQEMUDriverPtr driver = dconn->privateData;
virDomainObjPtr vm;
virDomainPtr dom = NULL;
@@ -9805,7 +9805,7 @@ qemuDomainMigrateBegin3(virDomainPtr domain,
const char *dname,
unsigned long resource ATTRIBUTE_UNUSED)
{
- struct qemud_driver *driver = domain->conn->privateData;
+ virQEMUDriverPtr driver = domain->conn->privateData;
virDomainObjPtr vm;
char *xml = NULL;
enum qemuDomainAsyncJob asyncJob;
@@ -9900,7 +9900,7 @@ qemuDomainMigratePrepare3(virConnectPtr dconn,
unsigned long resource ATTRIBUTE_UNUSED,
const char *dom_xml)
{
- struct qemud_driver *driver = dconn->privateData;
+ virQEMUDriverPtr driver = dconn->privateData;
int ret = -1;
virCheckFlags(QEMU_MIGRATION_FLAGS, -1);
@@ -9947,7 +9947,7 @@ qemuDomainMigratePrepareTunnel3(virConnectPtr dconn,
unsigned long resource ATTRIBUTE_UNUSED,
const char *dom_xml)
{
- struct qemud_driver *driver = dconn->privateData;
+ virQEMUDriverPtr driver = dconn->privateData;
int ret = -1;
virCheckFlags(QEMU_MIGRATION_FLAGS, -1);
@@ -9993,7 +9993,7 @@ qemuDomainMigratePerform3(virDomainPtr dom,
const char *dname,
unsigned long resource)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
int ret = -1;
@@ -10032,7 +10032,7 @@ qemuDomainMigrateFinish3(virConnectPtr dconn,
unsigned long flags,
int cancelled)
{
- struct qemud_driver *driver = dconn->privateData;
+ virQEMUDriverPtr driver = dconn->privateData;
virDomainObjPtr vm;
virDomainPtr dom = NULL;
@@ -10063,7 +10063,7 @@ qemuDomainMigrateConfirm3(virDomainPtr domain,
unsigned long flags,
int cancelled)
{
- struct qemud_driver *driver = domain->conn->privateData;
+ virQEMUDriverPtr driver = domain->conn->privateData;
virDomainObjPtr vm;
int ret = -1;
enum qemuMigrationJobPhase phase;
@@ -10162,7 +10162,7 @@ out:
static int
qemuNodeDeviceDettach(virNodeDevicePtr dev)
{
- struct qemud_driver *driver = dev->conn->privateData;
+ virQEMUDriverPtr driver = dev->conn->privateData;
pciDevice *pci;
unsigned domain, bus, slot, function;
int ret = -1;
@@ -10193,7 +10193,7 @@ out:
static int
qemuNodeDeviceReAttach(virNodeDevicePtr dev)
{
- struct qemud_driver *driver = dev->conn->privateData;
+ virQEMUDriverPtr driver = dev->conn->privateData;
pciDevice *pci;
pciDevice *other;
unsigned domain, bus, slot, function;
@@ -10237,7 +10237,7 @@ out:
static int
qemuNodeDeviceReset(virNodeDevicePtr dev)
{
- struct qemud_driver *driver = dev->conn->privateData;
+ virQEMUDriverPtr driver = dev->conn->privateData;
pciDevice *pci;
unsigned domain, bus, slot, function;
int ret = -1;
@@ -10267,7 +10267,7 @@ qemuCPUCompare(virConnectPtr conn,
const char *xmlDesc,
unsigned int flags)
{
- struct qemud_driver *driver = conn->privateData;
+ virQEMUDriverPtr driver = conn->privateData;
int ret = VIR_CPU_COMPARE_ERROR;
virCheckFlags(0, VIR_CPU_COMPARE_ERROR);
@@ -10309,7 +10309,7 @@ qemuCPUBaseline(virConnectPtr conn ATTRIBUTE_UNUSED,
static int qemuDomainGetJobInfo(virDomainPtr dom,
virDomainJobInfoPtr info) {
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
int ret = -1;
qemuDomainObjPrivatePtr priv;
@@ -10359,7 +10359,7 @@ cleanup:
static int qemuDomainAbortJob(virDomainPtr dom) {
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
int ret = -1;
qemuDomainObjPrivatePtr priv;
@@ -10419,7 +10419,7 @@ qemuDomainMigrateSetMaxDowntime(virDomainPtr dom,
unsigned long long downtime,
unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
qemuDomainObjPrivatePtr priv;
int ret = -1;
@@ -10475,7 +10475,7 @@ qemuDomainMigrateSetMaxSpeed(virDomainPtr dom,
unsigned long bandwidth,
unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
qemuDomainObjPrivatePtr priv;
int ret = -1;
@@ -10532,7 +10532,7 @@ qemuDomainMigrateGetMaxSpeed(virDomainPtr dom,
unsigned long *bandwidth,
unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
qemuDomainObjPrivatePtr priv;
int ret = -1;
@@ -10573,7 +10573,7 @@ typedef enum {
* are all aware of each new file before it is added to a chain, and
* can revoke access to a file no longer needed in a chain. */
static int
-qemuDomainPrepareDiskChainElement(struct qemud_driver *driver,
+qemuDomainPrepareDiskChainElement(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virCgroupPtr cgroup,
virDomainDiskDefPtr disk,
@@ -10624,7 +10624,7 @@ cleanup:
/* this function expects the driver lock to be held by the caller */
static int
-qemuDomainSnapshotFSFreeze(struct qemud_driver *driver,
+qemuDomainSnapshotFSFreeze(virQEMUDriverPtr driver,
virDomainObjPtr vm) {
qemuDomainObjPrivatePtr priv = vm->privateData;
int freezed;
@@ -10649,7 +10649,7 @@ qemuDomainSnapshotFSFreeze(struct qemud_driver *driver,
}
static int
-qemuDomainSnapshotFSThaw(struct qemud_driver *driver,
+qemuDomainSnapshotFSThaw(virQEMUDriverPtr driver,
virDomainObjPtr vm, bool report)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
@@ -10684,7 +10684,7 @@ qemuDomainSnapshotFSThaw(struct qemud_driver *driver,
/* The domain is expected to be locked and inactive. */
static int
-qemuDomainSnapshotCreateInactiveInternal(struct qemud_driver *driver,
+qemuDomainSnapshotCreateInactiveInternal(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainSnapshotObjPtr snap)
{
@@ -10693,7 +10693,7 @@ qemuDomainSnapshotCreateInactiveInternal(struct qemud_driver *driver,
/* The domain is expected to be locked and inactive. */
static int
-qemuDomainSnapshotCreateInactiveExternal(struct qemud_driver *driver,
+qemuDomainSnapshotCreateInactiveExternal(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainSnapshotObjPtr snap,
bool reuse)
@@ -10808,7 +10808,7 @@ cleanup:
/* The domain is expected to be locked and active. */
static int
qemuDomainSnapshotCreateActiveInternal(virConnectPtr conn,
- struct qemud_driver *driver,
+ virQEMUDriverPtr driver,
virDomainObjPtr *vmptr,
virDomainSnapshotObjPtr snap,
unsigned int flags)
@@ -11040,7 +11040,7 @@ cleanup:
/* The domain is expected to hold monitor lock. */
static int
-qemuDomainSnapshotCreateSingleDiskActive(struct qemud_driver *driver,
+qemuDomainSnapshotCreateSingleDiskActive(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virCgroupPtr cgroup,
virDomainSnapshotDiskDefPtr snap,
@@ -11134,7 +11134,7 @@ cleanup:
* counterpart to qemuDomainSnapshotCreateSingleDiskActive, called
* only on a failed transaction. */
static void
-qemuDomainSnapshotUndoSingleDiskActive(struct qemud_driver *driver,
+qemuDomainSnapshotUndoSingleDiskActive(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virCgroupPtr cgroup,
virDomainDiskDefPtr origdisk,
@@ -11178,7 +11178,7 @@ cleanup:
/* The domain is expected to be locked and active. */
static int
-qemuDomainSnapshotCreateDiskActive(struct qemud_driver *driver,
+qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainSnapshotObjPtr snap,
unsigned int flags,
@@ -11291,7 +11291,7 @@ cleanup:
static int
qemuDomainSnapshotCreateActiveExternal(virConnectPtr conn,
- struct qemud_driver *driver,
+ virQEMUDriverPtr driver,
virDomainObjPtr *vmptr,
virDomainSnapshotObjPtr snap,
unsigned int flags)
@@ -11448,7 +11448,7 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain,
const char *xmlDesc,
unsigned int flags)
{
- struct qemud_driver *driver = domain->conn->privateData;
+ virQEMUDriverPtr driver = domain->conn->privateData;
virDomainObjPtr vm = NULL;
char *xml = NULL;
virDomainSnapshotObjPtr snap = NULL;
@@ -12089,7 +12089,7 @@ cleanup:
/* The domain is expected to be locked and inactive. */
static int
-qemuDomainSnapshotRevertInactive(struct qemud_driver *driver,
+qemuDomainSnapshotRevertInactive(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainSnapshotObjPtr snap)
{
@@ -12101,7 +12101,7 @@ qemuDomainSnapshotRevertInactive(struct qemud_driver *driver,
static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
unsigned int flags)
{
- struct qemud_driver *driver = snapshot->domain->conn->privateData;
+ virQEMUDriverPtr driver = snapshot->domain->conn->privateData;
virDomainObjPtr vm = NULL;
int ret = -1;
virDomainSnapshotObjPtr snap = NULL;
@@ -12433,7 +12433,7 @@ cleanup:
}
struct snap_reparent {
- struct qemud_driver *driver;
+ virQEMUDriverPtr driver;
virDomainSnapshotObjPtr parent;
virDomainObjPtr vm;
int err;
@@ -12475,7 +12475,7 @@ qemuDomainSnapshotReparentChildren(void *payload,
static int qemuDomainSnapshotDelete(virDomainSnapshotPtr snapshot,
unsigned int flags)
{
- struct qemud_driver *driver = snapshot->domain->conn->privateData;
+ virQEMUDriverPtr driver = snapshot->domain->conn->privateData;
virDomainObjPtr vm = NULL;
int ret = -1;
virDomainSnapshotObjPtr snap = NULL;
@@ -12586,7 +12586,7 @@ cleanup:
static int qemuDomainMonitorCommand(virDomainPtr domain, const char *cmd,
char **result, unsigned int flags)
{
- struct qemud_driver *driver = domain->conn->privateData;
+ virQEMUDriverPtr driver = domain->conn->privateData;
virDomainObjPtr vm = NULL;
int ret = -1;
qemuDomainObjPrivatePtr priv;
@@ -12646,7 +12646,7 @@ static virDomainPtr qemuDomainAttach(virConnectPtr conn,
unsigned int pid_value,
unsigned int flags)
{
- struct qemud_driver *driver = conn->privateData;
+ virQEMUDriverPtr driver = conn->privateData;
virDomainObjPtr vm = NULL;
virDomainDefPtr def = NULL;
virDomainPtr dom = NULL;
@@ -12853,7 +12853,7 @@ cleanup:
* either success or failure. */
static int
qemuDomainBlockPivot(virConnectPtr conn,
- struct qemud_driver *driver, virDomainObjPtr vm,
+ virQEMUDriverPtr driver, virDomainObjPtr vm,
const char *device, virDomainDiskDefPtr disk)
{
int ret = -1;
@@ -13012,7 +13012,7 @@ qemuDomainBlockJobImpl(virDomainPtr dom, const char *path, const char *base,
unsigned long bandwidth, virDomainBlockJobInfoPtr info,
int mode, unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm = NULL;
qemuDomainObjPrivatePtr priv;
char uuidstr[VIR_UUID_STRING_BUFLEN];
@@ -13209,7 +13209,7 @@ qemuDomainBlockCopy(virDomainPtr dom, const char *path,
const char *dest, const char *format,
unsigned long bandwidth, unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
qemuDomainObjPrivatePtr priv;
char *device = NULL;
@@ -13423,7 +13423,7 @@ qemuDomainBlockCommit(virDomainPtr dom, const char *path, const char *base,
const char *top, unsigned long bandwidth,
unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
qemuDomainObjPrivatePtr priv;
virDomainObjPtr vm = NULL;
char *device = NULL;
@@ -13570,7 +13570,7 @@ qemuDomainOpenGraphics(virDomainPtr dom,
int fd,
unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm = NULL;
char uuidstr[VIR_UUID_STRING_BUFLEN];
int ret = -1;
@@ -13640,7 +13640,7 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
int nparams,
unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm = NULL;
qemuDomainObjPrivatePtr priv;
virDomainDefPtr persistentDef = NULL;
@@ -13812,7 +13812,7 @@ qemuDomainGetBlockIoTune(virDomainPtr dom,
int *nparams,
unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm = NULL;
qemuDomainObjPrivatePtr priv;
virDomainDefPtr persistentDef = NULL;
@@ -13947,7 +13947,7 @@ qemuDomainGetDiskErrors(virDomainPtr dom,
unsigned int nerrors,
unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm = NULL;
qemuDomainObjPrivatePtr priv;
char uuidstr[VIR_UUID_STRING_BUFLEN];
@@ -14034,7 +14034,7 @@ qemuDomainSetMetadata(virDomainPtr dom,
const char *uri ATTRIBUTE_UNUSED,
unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
virDomainDefPtr persistentDef;
int ret = -1;
@@ -14133,7 +14133,7 @@ qemuDomainGetMetadata(virDomainPtr dom,
const char *uri ATTRIBUTE_UNUSED,
unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
virDomainDefPtr def;
char *ret = NULL;
@@ -14421,7 +14421,7 @@ qemuDomainGetCPUStats(virDomainPtr domain,
unsigned int ncpus,
unsigned int flags)
{
- struct qemud_driver *driver = domain->conn->privateData;
+ virQEMUDriverPtr driver = domain->conn->privateData;
virCgroupPtr group = NULL;
virDomainObjPtr vm = NULL;
int ret = -1;
@@ -14476,7 +14476,7 @@ qemuDomainPMSuspendForDuration(virDomainPtr dom,
unsigned long long duration,
unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
qemuDomainObjPrivatePtr priv;
virDomainObjPtr vm;
int ret = -1;
@@ -14584,7 +14584,7 @@ static int
qemuDomainPMWakeup(virDomainPtr dom,
unsigned int flags)
{
- struct qemud_driver *driver = dom->conn->privateData;
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
int ret = -1;
qemuDomainObjPrivatePtr priv;
@@ -14640,7 +14640,7 @@ qemuListAllDomains(virConnectPtr conn,
virDomainPtr **domains,
unsigned int flags)
{
- struct qemud_driver *driver = conn->privateData;
+ virQEMUDriverPtr driver = conn->privateData;
int ret = -1;
virCheckFlags(VIR_CONNECT_LIST_DOMAINS_FILTERS_ALL, -1);
@@ -14658,7 +14658,7 @@ qemuDomainAgentCommand(virDomainPtr domain,
int timeout,
unsigned int flags)
{
- struct qemud_driver *driver = domain->conn->privateData;
+ virQEMUDriverPtr driver = domain->conn->privateData;
virDomainObjPtr vm;
int ret = -1;
char *result = NULL;
diff --git a/src/qemu/qemu_hostdev.c b/src/qemu/qemu_hostdev.c
index 94ba241..ab0f173 100644
--- a/src/qemu/qemu_hostdev.c
+++ b/src/qemu/qemu_hostdev.c
@@ -73,7 +73,7 @@ qemuGetPciHostDeviceList(virDomainHostdevDefPtr *hostdevs, int nhostdevs)
}
static pciDeviceList *
-qemuGetActivePciHostDeviceList(struct qemud_driver *driver,
+qemuGetActivePciHostDeviceList(virQEMUDriverPtr driver,
virDomainHostdevDefPtr *hostdevs,
int nhostdevs)
{
@@ -116,7 +116,7 @@ qemuGetActivePciHostDeviceList(struct qemud_driver *driver,
return list;
}
-int qemuUpdateActivePciHostdevs(struct qemud_driver *driver,
+int qemuUpdateActivePciHostdevs(virQEMUDriverPtr driver,
virDomainDefPtr def)
{
virDomainHostdevDefPtr hostdev = NULL;
@@ -160,7 +160,7 @@ int qemuUpdateActivePciHostdevs(struct qemud_driver *driver,
}
int
-qemuUpdateActiveUsbHostdevs(struct qemud_driver *driver,
+qemuUpdateActiveUsbHostdevs(virQEMUDriverPtr driver,
virDomainDefPtr def)
{
virDomainHostdevDefPtr hostdev = NULL;
@@ -399,7 +399,7 @@ qemuDomainHostdevNetConfigRestore(virDomainHostdevDefPtr hostdev,
return ret;
}
-int qemuPrepareHostdevPCIDevices(struct qemud_driver *driver,
+int qemuPrepareHostdevPCIDevices(virQEMUDriverPtr driver,
const char *name,
const unsigned char *uuid,
virDomainHostdevDefPtr *hostdevs,
@@ -586,7 +586,7 @@ cleanup:
}
static int
-qemuPrepareHostPCIDevices(struct qemud_driver *driver,
+qemuPrepareHostPCIDevices(virQEMUDriverPtr driver,
virDomainDefPtr def)
{
return qemuPrepareHostdevPCIDevices(driver, def->name, def->uuid,
@@ -594,7 +594,7 @@ qemuPrepareHostPCIDevices(struct qemud_driver *driver,
}
int
-qemuPrepareHostdevUSBDevices(struct qemud_driver *driver,
+qemuPrepareHostdevUSBDevices(virQEMUDriverPtr driver,
const char *name,
usbDeviceList *list)
{
@@ -728,7 +728,7 @@ out:
}
static int
-qemuPrepareHostUSBDevices(struct qemud_driver *driver,
+qemuPrepareHostUSBDevices(virQEMUDriverPtr driver,
virDomainDefPtr def,
bool coldBoot)
{
@@ -795,7 +795,7 @@ cleanup:
return ret;
}
-int qemuPrepareHostDevices(struct qemud_driver *driver,
+int qemuPrepareHostDevices(virQEMUDriverPtr driver,
virDomainDefPtr def,
bool coldBoot)
{
@@ -812,7 +812,7 @@ int qemuPrepareHostDevices(struct qemud_driver *driver,
}
-void qemuReattachPciDevice(pciDevice *dev, struct qemud_driver *driver)
+void qemuReattachPciDevice(pciDevice *dev, virQEMUDriverPtr driver)
{
int retries = 100;
@@ -840,7 +840,7 @@ void qemuReattachPciDevice(pciDevice *dev, struct qemud_driver *driver)
}
-void qemuDomainReAttachHostdevDevices(struct qemud_driver *driver,
+void qemuDomainReAttachHostdevDevices(virQEMUDriverPtr driver,
const char *name,
virDomainHostdevDefPtr *hostdevs,
int nhostdevs)
@@ -916,7 +916,7 @@ void qemuDomainReAttachHostdevDevices(struct qemud_driver *driver,
}
static void
-qemuDomainReAttachHostUsbDevices(struct qemud_driver *driver,
+qemuDomainReAttachHostUsbDevices(virQEMUDriverPtr driver,
const char *name,
virDomainHostdevDefPtr *hostdevs,
int nhostdevs)
@@ -975,7 +975,7 @@ qemuDomainReAttachHostUsbDevices(struct qemud_driver *driver,
}
}
-void qemuDomainReAttachHostDevices(struct qemud_driver *driver,
+void qemuDomainReAttachHostDevices(virQEMUDriverPtr driver,
virDomainDefPtr def)
{
if (!def->nhostdevs)
diff --git a/src/qemu/qemu_hostdev.h b/src/qemu/qemu_hostdev.h
index 0da25f9..9ef2385 100644
--- a/src/qemu/qemu_hostdev.h
+++ b/src/qemu/qemu_hostdev.h
@@ -27,11 +27,11 @@
# include "qemu_conf.h"
# include "domain_conf.h"
-int qemuUpdateActivePciHostdevs(struct qemud_driver *driver,
+int qemuUpdateActivePciHostdevs(virQEMUDriverPtr driver,
virDomainDefPtr def);
-int qemuUpdateActiveUsbHostdevs(struct qemud_driver *driver,
+int qemuUpdateActiveUsbHostdevs(virQEMUDriverPtr driver,
virDomainDefPtr def);
-int qemuPrepareHostdevPCIDevices(struct qemud_driver *driver,
+int qemuPrepareHostdevPCIDevices(virQEMUDriverPtr driver,
const char *name,
const unsigned char *uuid,
virDomainHostdevDefPtr *hostdevs,
@@ -39,18 +39,18 @@ int qemuPrepareHostdevPCIDevices(struct qemud_driver *driver,
int qemuFindHostdevUSBDevice(virDomainHostdevDefPtr hostdev,
bool mandatory,
usbDevice **usb);
-int qemuPrepareHostdevUSBDevices(struct qemud_driver *driver,
+int qemuPrepareHostdevUSBDevices(virQEMUDriverPtr driver,
const char *name,
usbDeviceList *list);
-int qemuPrepareHostDevices(struct qemud_driver *driver,
+int qemuPrepareHostDevices(virQEMUDriverPtr driver,
virDomainDefPtr def,
bool coldBoot);
-void qemuReattachPciDevice(pciDevice *dev, struct qemud_driver *driver);
-void qemuDomainReAttachHostdevDevices(struct qemud_driver *driver,
+void qemuReattachPciDevice(pciDevice *dev, virQEMUDriverPtr driver);
+void qemuDomainReAttachHostdevDevices(virQEMUDriverPtr driver,
const char *name,
virDomainHostdevDefPtr *hostdevs,
int nhostdevs);
-void qemuDomainReAttachHostDevices(struct qemud_driver *driver,
+void qemuDomainReAttachHostDevices(virQEMUDriverPtr driver,
virDomainDefPtr def);
int qemuDomainHostdevIsVirtualFunction(virDomainHostdevDefPtr hostdev);
int qemuDomainHostdevNetConfigReplace(virDomainHostdevDefPtr hostdev,
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 0bc2259..cfeae68 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -49,7 +49,7 @@
#define VIR_FROM_THIS VIR_FROM_QEMU
-int qemuDomainChangeEjectableMedia(struct qemud_driver *driver,
+int qemuDomainChangeEjectableMedia(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainDiskDefPtr disk,
bool force)
@@ -158,7 +158,7 @@ error:
}
int
-qemuDomainCheckEjectableMedia(struct qemud_driver *driver,
+qemuDomainCheckEjectableMedia(virQEMUDriverPtr driver,
virDomainObjPtr vm,
enum qemuDomainAsyncJob asyncJob)
{
@@ -201,7 +201,7 @@ cleanup:
int qemuDomainAttachPciDiskDevice(virConnectPtr conn,
- struct qemud_driver *driver,
+ virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainDiskDefPtr disk)
{
@@ -315,7 +315,7 @@ error:
}
-int qemuDomainAttachPciControllerDevice(struct qemud_driver *driver,
+int qemuDomainAttachPciControllerDevice(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainControllerDefPtr controller)
{
@@ -387,7 +387,7 @@ cleanup:
static virDomainControllerDefPtr
-qemuDomainFindOrCreateSCSIDiskController(struct qemud_driver *driver,
+qemuDomainFindOrCreateSCSIDiskController(virQEMUDriverPtr driver,
virDomainObjPtr vm,
int controller)
{
@@ -434,7 +434,7 @@ qemuDomainFindOrCreateSCSIDiskController(struct qemud_driver *driver,
int qemuDomainAttachSCSIDisk(virConnectPtr conn,
- struct qemud_driver *driver,
+ virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainDiskDefPtr disk)
{
@@ -560,7 +560,7 @@ error:
int qemuDomainAttachUsbMassstorageDevice(virConnectPtr conn,
- struct qemud_driver *driver,
+ virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainDiskDefPtr disk)
{
@@ -655,7 +655,7 @@ error:
/* XXX conn required for network -> bridge resolution */
int qemuDomainAttachNetDevice(virConnectPtr conn,
- struct qemud_driver *driver,
+ virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainNetDefPtr net)
{
@@ -935,7 +935,7 @@ no_memory:
}
-int qemuDomainAttachHostPciDevice(struct qemud_driver *driver,
+int qemuDomainAttachHostPciDevice(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainHostdevDefPtr hostdev)
{
@@ -1028,7 +1028,7 @@ error:
}
-int qemuDomainAttachRedirdevDevice(struct qemud_driver *driver,
+int qemuDomainAttachRedirdevDevice(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainRedirdevDefPtr redirdev)
{
@@ -1072,7 +1072,7 @@ error:
}
-int qemuDomainAttachHostUsbDevice(struct qemud_driver *driver,
+int qemuDomainAttachHostUsbDevice(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainHostdevDefPtr hostdev)
{
@@ -1137,7 +1137,7 @@ error:
return -1;
}
-int qemuDomainAttachHostDevice(struct qemud_driver *driver,
+int qemuDomainAttachHostDevice(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainHostdevDefPtr hostdev)
{
@@ -1330,7 +1330,7 @@ cleanup:
return ret;
}
-int qemuDomainChangeNetLinkState(struct qemud_driver *driver,
+int qemuDomainChangeNetLinkState(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainNetDefPtr dev,
int linkstate)
@@ -1362,7 +1362,7 @@ cleanup:
}
int
-qemuDomainChangeNet(struct qemud_driver *driver,
+qemuDomainChangeNet(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainPtr dom,
virDomainDeviceDefPtr dev)
@@ -1732,7 +1732,7 @@ static virDomainGraphicsDefPtr qemuDomainFindGraphics(virDomainObjPtr vm,
int
-qemuDomainChangeGraphics(struct qemud_driver *driver,
+qemuDomainChangeGraphics(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainGraphicsDefPtr dev)
{
@@ -1918,7 +1918,7 @@ static bool qemuIsMultiFunctionDevice(virDomainDefPtr def,
}
-int qemuDomainDetachPciDiskDevice(struct qemud_driver *driver,
+int qemuDomainDetachPciDiskDevice(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainDeviceDefPtr dev)
{
@@ -2024,7 +2024,7 @@ cleanup:
return ret;
}
-int qemuDomainDetachDiskDevice(struct qemud_driver *driver,
+int qemuDomainDetachDiskDevice(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainDeviceDefPtr dev)
{
@@ -2164,7 +2164,7 @@ static bool qemuDomainControllerIsBusy(virDomainObjPtr vm,
}
}
-int qemuDomainDetachPciControllerDevice(struct qemud_driver *driver,
+int qemuDomainDetachPciControllerDevice(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainDeviceDefPtr dev)
{
@@ -2239,7 +2239,7 @@ cleanup:
}
static int
-qemuDomainDetachHostPciDevice(struct qemud_driver *driver,
+qemuDomainDetachHostPciDevice(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainHostdevDefPtr detach)
{
@@ -2309,7 +2309,7 @@ qemuDomainDetachHostPciDevice(struct qemud_driver *driver,
}
static int
-qemuDomainDetachHostUsbDevice(struct qemud_driver *driver,
+qemuDomainDetachHostUsbDevice(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainHostdevDefPtr detach)
{
@@ -2349,7 +2349,7 @@ qemuDomainDetachHostUsbDevice(struct qemud_driver *driver,
}
static
-int qemuDomainDetachThisHostDevice(struct qemud_driver *driver,
+int qemuDomainDetachThisHostDevice(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainHostdevDefPtr detach,
int idx)
@@ -2398,7 +2398,7 @@ int qemuDomainDetachThisHostDevice(struct qemud_driver *driver,
}
/* search for a hostdev matching dev and detach it */
-int qemuDomainDetachHostDevice(struct qemud_driver *driver,
+int qemuDomainDetachHostDevice(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainDeviceDefPtr dev)
{
@@ -2453,7 +2453,7 @@ int qemuDomainDetachHostDevice(struct qemud_driver *driver,
}
int
-qemuDomainDetachNetDevice(struct qemud_driver *driver,
+qemuDomainDetachNetDevice(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainDeviceDefPtr dev)
{
@@ -2590,7 +2590,7 @@ cleanup:
}
int
-qemuDomainChangeGraphicsPasswords(struct qemud_driver *driver,
+qemuDomainChangeGraphicsPasswords(virQEMUDriverPtr driver,
virDomainObjPtr vm,
int type,
virDomainGraphicsAuthDefPtr auth,
@@ -2656,7 +2656,7 @@ cleanup:
return ret;
}
-int qemuDomainAttachLease(struct qemud_driver *driver,
+int qemuDomainAttachLease(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainLeaseDefPtr lease)
{
@@ -2673,7 +2673,7 @@ int qemuDomainAttachLease(struct qemud_driver *driver,
return 0;
}
-int qemuDomainDetachLease(struct qemud_driver *driver,
+int qemuDomainDetachLease(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainLeaseDefPtr lease)
{
diff --git a/src/qemu/qemu_hotplug.h b/src/qemu/qemu_hotplug.h
index a7864c3..8f01d23 100644
--- a/src/qemu/qemu_hotplug.h
+++ b/src/qemu/qemu_hotplug.h
@@ -28,79 +28,79 @@
# include "qemu_domain.h"
# include "domain_conf.h"
-int qemuDomainChangeEjectableMedia(struct qemud_driver *driver,
+int qemuDomainChangeEjectableMedia(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainDiskDefPtr disk,
bool force);
-int qemuDomainCheckEjectableMedia(struct qemud_driver *driver,
+int qemuDomainCheckEjectableMedia(virQEMUDriverPtr driver,
virDomainObjPtr vm,
enum qemuDomainAsyncJob asyncJob);
int qemuDomainAttachPciDiskDevice(virConnectPtr conn,
- struct qemud_driver *driver,
+ virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainDiskDefPtr disk);
-int qemuDomainAttachPciControllerDevice(struct qemud_driver *driver,
+int qemuDomainAttachPciControllerDevice(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainControllerDefPtr controller);
int qemuDomainAttachSCSIDisk(virConnectPtr conn,
- struct qemud_driver *driver,
+ virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainDiskDefPtr disk);
int qemuDomainAttachUsbMassstorageDevice(virConnectPtr conn,
- struct qemud_driver *driver,
+ virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainDiskDefPtr disk);
int qemuDomainAttachNetDevice(virConnectPtr conn,
- struct qemud_driver *driver,
+ virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainNetDefPtr net);
-int qemuDomainAttachHostPciDevice(struct qemud_driver *driver,
+int qemuDomainAttachHostPciDevice(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainHostdevDefPtr hostdev);
-int qemuDomainAttachHostUsbDevice(struct qemud_driver *driver,
+int qemuDomainAttachHostUsbDevice(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainHostdevDefPtr hostdev);
-int qemuDomainAttachRedirdevDevice(struct qemud_driver *driver,
+int qemuDomainAttachRedirdevDevice(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainRedirdevDefPtr hostdev);
-int qemuDomainAttachHostDevice(struct qemud_driver *driver,
+int qemuDomainAttachHostDevice(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainHostdevDefPtr hostdev);
-int qemuDomainChangeGraphics(struct qemud_driver *driver,
+int qemuDomainChangeGraphics(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainGraphicsDefPtr dev);
-int qemuDomainChangeGraphicsPasswords(struct qemud_driver *driver,
+int qemuDomainChangeGraphicsPasswords(virQEMUDriverPtr driver,
virDomainObjPtr vm,
int type,
virDomainGraphicsAuthDefPtr auth,
const char *defaultPasswd);
-int qemuDomainChangeNet(struct qemud_driver *driver,
+int qemuDomainChangeNet(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainPtr dom,
virDomainDeviceDefPtr dev);
-int qemuDomainChangeNetLinkState(struct qemud_driver *driver,
+int qemuDomainChangeNetLinkState(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainNetDefPtr dev,
int linkstate);
-int qemuDomainDetachPciDiskDevice(struct qemud_driver *driver,
+int qemuDomainDetachPciDiskDevice(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainDeviceDefPtr dev);
-int qemuDomainDetachDiskDevice(struct qemud_driver *driver,
+int qemuDomainDetachDiskDevice(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainDeviceDefPtr dev);
-int qemuDomainDetachPciControllerDevice(struct qemud_driver *driver,
+int qemuDomainDetachPciControllerDevice(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainDeviceDefPtr dev);
-int qemuDomainDetachNetDevice(struct qemud_driver *driver,
+int qemuDomainDetachNetDevice(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainDeviceDefPtr dev);
-int qemuDomainDetachHostDevice(struct qemud_driver *driver,
+int qemuDomainDetachHostDevice(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainDeviceDefPtr dev);
-int qemuDomainAttachLease(struct qemud_driver *driver,
+int qemuDomainAttachLease(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainLeaseDefPtr lease);
-int qemuDomainDetachLease(struct qemud_driver *driver,
+int qemuDomainDetachLease(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainLeaseDefPtr lease);
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index d52ec59..86060dc 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -257,7 +257,7 @@ error:
static qemuMigrationCookieGraphicsPtr
-qemuMigrationCookieGraphicsAlloc(struct qemud_driver *driver,
+qemuMigrationCookieGraphicsAlloc(virQEMUDriverPtr driver,
virDomainGraphicsDefPtr def)
{
qemuMigrationCookieGraphicsPtr mig = NULL;
@@ -304,7 +304,7 @@ error:
static qemuMigrationCookieNetworkPtr
-qemuMigrationCookieNetworkAlloc(struct qemud_driver *driver ATTRIBUTE_UNUSED,
+qemuMigrationCookieNetworkAlloc(virQEMUDriverPtr driver ATTRIBUTE_UNUSED,
virDomainDefPtr def)
{
qemuMigrationCookieNetworkPtr mig;
@@ -394,7 +394,7 @@ error:
static int
qemuMigrationCookieAddGraphics(qemuMigrationCookiePtr mig,
- struct qemud_driver *driver,
+ virQEMUDriverPtr driver,
virDomainObjPtr dom)
{
if (mig->flags & QEMU_MIGRATION_COOKIE_GRAPHICS) {
@@ -418,7 +418,7 @@ qemuMigrationCookieAddGraphics(qemuMigrationCookiePtr mig,
static int
qemuMigrationCookieAddLockstate(qemuMigrationCookiePtr mig,
- struct qemud_driver *driver,
+ virQEMUDriverPtr driver,
virDomainObjPtr dom)
{
qemuDomainObjPrivatePtr priv = dom->privateData;
@@ -472,7 +472,7 @@ qemuMigrationCookieAddPersistent(qemuMigrationCookiePtr mig,
static int
qemuMigrationCookieAddNetwork(qemuMigrationCookiePtr mig,
- struct qemud_driver *driver,
+ virQEMUDriverPtr driver,
virDomainObjPtr dom)
{
if (mig->flags & QEMU_MIGRATION_COOKIE_NETWORK) {
@@ -542,7 +542,7 @@ qemuMigrationCookieNetworkXMLFormat(virBufferPtr buf,
static int
-qemuMigrationCookieXMLFormat(struct qemud_driver *driver,
+qemuMigrationCookieXMLFormat(virQEMUDriverPtr driver,
virBufferPtr buf,
qemuMigrationCookiePtr mig)
{
@@ -599,7 +599,7 @@ qemuMigrationCookieXMLFormat(struct qemud_driver *driver,
}
-static char *qemuMigrationCookieXMLFormatStr(struct qemud_driver *driver,
+static char *qemuMigrationCookieXMLFormatStr(virQEMUDriverPtr driver,
qemuMigrationCookiePtr mig)
{
virBuffer buf = VIR_BUFFER_INITIALIZER;
@@ -724,7 +724,7 @@ error:
static int
qemuMigrationCookieXMLParse(qemuMigrationCookiePtr mig,
- struct qemud_driver *driver,
+ virQEMUDriverPtr driver,
xmlDocPtr doc,
xmlXPathContextPtr ctxt,
unsigned int flags)
@@ -884,7 +884,7 @@ error:
static int
qemuMigrationCookieXMLParseStr(qemuMigrationCookiePtr mig,
- struct qemud_driver *driver,
+ virQEMUDriverPtr driver,
const char *xml,
unsigned int flags)
{
@@ -909,7 +909,7 @@ cleanup:
static int
qemuMigrationBakeCookie(qemuMigrationCookiePtr mig,
- struct qemud_driver *driver,
+ virQEMUDriverPtr driver,
virDomainObjPtr dom,
char **cookieout,
int *cookieoutlen,
@@ -949,7 +949,7 @@ qemuMigrationBakeCookie(qemuMigrationCookiePtr mig,
static qemuMigrationCookiePtr
-qemuMigrationEatCookie(struct qemud_driver *driver,
+qemuMigrationEatCookie(virQEMUDriverPtr driver,
virDomainObjPtr dom,
const char *cookiein,
int cookieinlen,
@@ -1012,7 +1012,7 @@ error:
* talking to the destination in the first place, we are stuck with
* the fact that older servers did not do checks on the source. */
static bool
-qemuMigrationIsAllowed(struct qemud_driver *driver, virDomainObjPtr vm,
+qemuMigrationIsAllowed(virQEMUDriverPtr driver, virDomainObjPtr vm,
virDomainDefPtr def)
{
int nsnapshots;
@@ -1103,7 +1103,7 @@ qemuMigrationIsSafe(virDomainDefPtr def)
* Pause domain for non-live migration.
*/
int
-qemuMigrationSetOffline(struct qemud_driver *driver,
+qemuMigrationSetOffline(virQEMUDriverPtr driver,
virDomainObjPtr vm)
{
int ret;
@@ -1125,7 +1125,7 @@ qemuMigrationSetOffline(struct qemud_driver *driver,
static int
-qemuMigrationUpdateJobStatus(struct qemud_driver *driver,
+qemuMigrationUpdateJobStatus(virQEMUDriverPtr driver,
virDomainObjPtr vm,
const char *job,
enum qemuDomainAsyncJob asyncJob)
@@ -1215,7 +1215,7 @@ qemuMigrationUpdateJobStatus(struct qemud_driver *driver,
static int
-qemuMigrationWaitForCompletion(struct qemud_driver *driver, virDomainObjPtr vm,
+qemuMigrationWaitForCompletion(virQEMUDriverPtr driver, virDomainObjPtr vm,
enum qemuDomainAsyncJob asyncJob,
virConnectPtr dconn)
{
@@ -1269,7 +1269,7 @@ cleanup:
static int
-qemuDomainMigrateGraphicsRelocate(struct qemud_driver *driver,
+qemuDomainMigrateGraphicsRelocate(virQEMUDriverPtr driver,
virDomainObjPtr vm,
qemuMigrationCookiePtr cookie)
{
@@ -1305,7 +1305,7 @@ qemuDomainMigrateGraphicsRelocate(struct qemud_driver *driver,
static int
-qemuDomainMigrateOPDRelocate(struct qemud_driver *driver ATTRIBUTE_UNUSED,
+qemuDomainMigrateOPDRelocate(virQEMUDriverPtr driver ATTRIBUTE_UNUSED,
virDomainObjPtr vm,
qemuMigrationCookiePtr cookie)
{
@@ -1348,7 +1348,7 @@ cleanup:
* qemuDomainMigratePerform3 and qemuDomainMigrateConfirm3.
*/
virDomainObjPtr
-qemuMigrationCleanup(struct qemud_driver *driver,
+qemuMigrationCleanup(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virConnectPtr conn)
{
@@ -1403,7 +1403,7 @@ cleanup:
}
/* The caller is supposed to lock the vm and start a migration job. */
-char *qemuMigrationBegin(struct qemud_driver *driver,
+char *qemuMigrationBegin(virQEMUDriverPtr driver,
virDomainObjPtr vm,
const char *xmlin,
const char *dname,
@@ -1473,7 +1473,7 @@ cleanup:
*/
static void
-qemuMigrationPrepareCleanup(struct qemud_driver *driver,
+qemuMigrationPrepareCleanup(virQEMUDriverPtr driver,
virDomainObjPtr vm)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
@@ -1490,7 +1490,7 @@ qemuMigrationPrepareCleanup(struct qemud_driver *driver,
}
static int
-qemuMigrationPrepareAny(struct qemud_driver *driver,
+qemuMigrationPrepareAny(virQEMUDriverPtr driver,
virConnectPtr dconn,
const char *cookiein,
int cookieinlen,
@@ -1700,7 +1700,7 @@ endjob:
* sets up the corresponding virStream to handle the incoming data.
*/
int
-qemuMigrationPrepareTunnel(struct qemud_driver *driver,
+qemuMigrationPrepareTunnel(virQEMUDriverPtr driver,
virConnectPtr dconn,
const char *cookiein,
int cookieinlen,
@@ -1728,7 +1728,7 @@ qemuMigrationPrepareTunnel(struct qemud_driver *driver,
int
-qemuMigrationPrepareDirect(struct qemud_driver *driver,
+qemuMigrationPrepareDirect(virQEMUDriverPtr driver,
virConnectPtr dconn,
const char *cookiein,
int cookieinlen,
@@ -2075,7 +2075,7 @@ cleanup:
}
static int
-qemuMigrationConnect(struct qemud_driver *driver,
+qemuMigrationConnect(virQEMUDriverPtr driver,
virDomainObjPtr vm,
qemuMigrationSpecPtr spec)
{
@@ -2113,7 +2113,7 @@ cleanup:
}
static int
-qemuMigrationRun(struct qemud_driver *driver,
+qemuMigrationRun(virQEMUDriverPtr driver,
virDomainObjPtr vm,
const char *cookiein,
int cookieinlen,
@@ -2327,7 +2327,7 @@ cancel:
/* Perform migration using QEMU's native TCP migrate support,
* not encrypted obviously
*/
-static int doNativeMigrate(struct qemud_driver *driver,
+static int doNativeMigrate(virQEMUDriverPtr driver,
virDomainObjPtr vm,
const char *uri,
const char *cookiein,
@@ -2383,7 +2383,7 @@ static int doNativeMigrate(struct qemud_driver *driver,
}
-static int doTunnelMigrate(struct qemud_driver *driver,
+static int doTunnelMigrate(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virStreamPtr st,
const char *cookiein,
@@ -2474,7 +2474,7 @@ cleanup:
* from libvirt.c, but running in source libvirtd context,
* instead of client app context & also adding in tunnel
* handling */
-static int doPeer2PeerMigrate2(struct qemud_driver *driver,
+static int doPeer2PeerMigrate2(virQEMUDriverPtr driver,
virConnectPtr sconn ATTRIBUTE_UNUSED,
virConnectPtr dconn,
virDomainObjPtr vm,
@@ -2612,7 +2612,7 @@ cleanup:
* from libvirt.c, but running in source libvirtd context,
* instead of client app context & also adding in tunnel
* handling */
-static int doPeer2PeerMigrate3(struct qemud_driver *driver,
+static int doPeer2PeerMigrate3(virQEMUDriverPtr driver,
virConnectPtr sconn,
virConnectPtr dconn,
virDomainObjPtr vm,
@@ -2802,7 +2802,7 @@ finish:
}
-static int doPeer2PeerMigrate(struct qemud_driver *driver,
+static int doPeer2PeerMigrate(virQEMUDriverPtr driver,
virConnectPtr sconn,
virDomainObjPtr vm,
const char *xmlin,
@@ -2898,7 +2898,7 @@ cleanup:
* perform phase of v2 non-peer2peer migration.
*/
static int
-qemuMigrationPerformJob(struct qemud_driver *driver,
+qemuMigrationPerformJob(virQEMUDriverPtr driver,
virConnectPtr conn,
virDomainObjPtr vm,
const char *xmlin,
@@ -3012,7 +3012,7 @@ cleanup:
* This implements perform phase of v3 migration protocol.
*/
static int
-qemuMigrationPerformPhase(struct qemud_driver *driver,
+qemuMigrationPerformPhase(virQEMUDriverPtr driver,
virConnectPtr conn,
virDomainObjPtr vm,
const char *uri,
@@ -3093,7 +3093,7 @@ cleanup:
}
int
-qemuMigrationPerform(struct qemud_driver *driver,
+qemuMigrationPerform(virQEMUDriverPtr driver,
virConnectPtr conn,
virDomainObjPtr vm,
const char *xmlin,
@@ -3200,7 +3200,7 @@ err_exit:
virDomainPtr
-qemuMigrationFinish(struct qemud_driver *driver,
+qemuMigrationFinish(virQEMUDriverPtr driver,
virConnectPtr dconn,
virDomainObjPtr vm,
const char *cookiein,
@@ -3404,7 +3404,7 @@ cleanup:
}
-int qemuMigrationConfirm(struct qemud_driver *driver,
+int qemuMigrationConfirm(virQEMUDriverPtr driver,
virConnectPtr conn,
virDomainObjPtr vm,
const char *cookiein,
@@ -3477,7 +3477,7 @@ cleanup:
/* Helper function called while driver lock is held and vm is active. */
int
-qemuMigrationToFile(struct qemud_driver *driver, virDomainObjPtr vm,
+qemuMigrationToFile(virQEMUDriverPtr driver, virDomainObjPtr vm,
int fd, off_t offset, const char *path,
const char *compressor,
bool bypassSecurityDriver,
@@ -3639,7 +3639,7 @@ cleanup:
}
int
-qemuMigrationJobStart(struct qemud_driver *driver,
+qemuMigrationJobStart(virQEMUDriverPtr driver,
virDomainObjPtr vm,
enum qemuDomainAsyncJob job)
{
@@ -3662,7 +3662,7 @@ qemuMigrationJobStart(struct qemud_driver *driver,
}
void
-qemuMigrationJobSetPhase(struct qemud_driver *driver,
+qemuMigrationJobSetPhase(virQEMUDriverPtr driver,
virDomainObjPtr vm,
enum qemuMigrationJobPhase phase)
{
@@ -3679,7 +3679,7 @@ qemuMigrationJobSetPhase(struct qemud_driver *driver,
}
void
-qemuMigrationJobStartPhase(struct qemud_driver *driver,
+qemuMigrationJobStartPhase(virQEMUDriverPtr driver,
virDomainObjPtr vm,
enum qemuMigrationJobPhase phase)
{
@@ -3715,7 +3715,7 @@ qemuMigrationJobIsActive(virDomainObjPtr vm,
}
bool
-qemuMigrationJobFinish(struct qemud_driver *driver, virDomainObjPtr vm)
+qemuMigrationJobFinish(virQEMUDriverPtr driver, virDomainObjPtr vm)
{
return qemuDomainObjEndAsyncJob(driver, vm);
}
diff --git a/src/qemu/qemu_migration.h b/src/qemu/qemu_migration.h
index 7a2269a..62e39a0 100644
--- a/src/qemu/qemu_migration.h
+++ b/src/qemu/qemu_migration.h
@@ -54,15 +54,15 @@ enum qemuMigrationJobPhase {
};
VIR_ENUM_DECL(qemuMigrationJobPhase)
-int qemuMigrationJobStart(struct qemud_driver *driver,
+int qemuMigrationJobStart(virQEMUDriverPtr driver,
virDomainObjPtr vm,
enum qemuDomainAsyncJob job)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
-void qemuMigrationJobSetPhase(struct qemud_driver *driver,
+void qemuMigrationJobSetPhase(virQEMUDriverPtr driver,
virDomainObjPtr vm,
enum qemuMigrationJobPhase phase)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
-void qemuMigrationJobStartPhase(struct qemud_driver *driver,
+void qemuMigrationJobStartPhase(virQEMUDriverPtr driver,
virDomainObjPtr vm,
enum qemuMigrationJobPhase phase)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
@@ -71,17 +71,17 @@ bool qemuMigrationJobContinue(virDomainObjPtr obj)
bool qemuMigrationJobIsActive(virDomainObjPtr vm,
enum qemuDomainAsyncJob job)
ATTRIBUTE_NONNULL(1);
-bool qemuMigrationJobFinish(struct qemud_driver *driver, virDomainObjPtr obj)
+bool qemuMigrationJobFinish(virQEMUDriverPtr driver, virDomainObjPtr obj)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
-int qemuMigrationSetOffline(struct qemud_driver *driver,
+int qemuMigrationSetOffline(virQEMUDriverPtr driver,
virDomainObjPtr vm);
-virDomainObjPtr qemuMigrationCleanup(struct qemud_driver *driver,
+virDomainObjPtr qemuMigrationCleanup(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virConnectPtr conn);
-char *qemuMigrationBegin(struct qemud_driver *driver,
+char *qemuMigrationBegin(virQEMUDriverPtr driver,
virDomainObjPtr vm,
const char *xmlin,
const char *dname,
@@ -89,7 +89,7 @@ char *qemuMigrationBegin(struct qemud_driver *driver,
int *cookieoutlen,
unsigned long flags);
-int qemuMigrationPrepareTunnel(struct qemud_driver *driver,
+int qemuMigrationPrepareTunnel(virQEMUDriverPtr driver,
virConnectPtr dconn,
const char *cookiein,
int cookieinlen,
@@ -99,7 +99,7 @@ int qemuMigrationPrepareTunnel(struct qemud_driver *driver,
const char *dname,
const char *dom_xml);
-int qemuMigrationPrepareDirect(struct qemud_driver *driver,
+int qemuMigrationPrepareDirect(virQEMUDriverPtr driver,
virConnectPtr dconn,
const char *cookiein,
int cookieinlen,
@@ -110,7 +110,7 @@ int qemuMigrationPrepareDirect(struct qemud_driver *driver,
const char *dname,
const char *dom_xml);
-int qemuMigrationPerform(struct qemud_driver *driver,
+int qemuMigrationPerform(virQEMUDriverPtr driver,
virConnectPtr conn,
virDomainObjPtr vm,
const char *xmlin,
@@ -125,7 +125,7 @@ int qemuMigrationPerform(struct qemud_driver *driver,
unsigned long resource,
bool v3proto);
-virDomainPtr qemuMigrationFinish(struct qemud_driver *driver,
+virDomainPtr qemuMigrationFinish(virQEMUDriverPtr driver,
virConnectPtr dconn,
virDomainObjPtr vm,
const char *cookiein,
@@ -136,7 +136,7 @@ virDomainPtr qemuMigrationFinish(struct qemud_driver *driver,
int retcode,
bool v3proto);
-int qemuMigrationConfirm(struct qemud_driver *driver,
+int qemuMigrationConfirm(virQEMUDriverPtr driver,
virConnectPtr conn,
virDomainObjPtr vm,
const char *cookiein,
@@ -145,7 +145,7 @@ int qemuMigrationConfirm(struct qemud_driver *driver,
int retcode);
-int qemuMigrationToFile(struct qemud_driver *driver, virDomainObjPtr vm,
+int qemuMigrationToFile(virQEMUDriverPtr driver, virDomainObjPtr vm,
int fd, off_t offset, const char *path,
const char *compressor,
bool bypassSecurityDriver,
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index cdaa2df..d4dad1f 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -80,7 +80,7 @@
* Returns 0 on success
*/
static int
-qemuProcessRemoveDomainStatus(struct qemud_driver *driver,
+qemuProcessRemoveDomainStatus(virQEMUDriverPtr driver,
virDomainObjPtr vm)
{
char ebuf[1024];
@@ -108,7 +108,7 @@ qemuProcessRemoveDomainStatus(struct qemud_driver *driver,
/* XXX figure out how to remove this */
-extern struct qemud_driver *qemu_driver;
+extern virQEMUDriverPtr qemu_driver;
/*
* This is a callback registered with a qemuAgentPtr instance,
@@ -120,7 +120,7 @@ static void
qemuProcessHandleAgentEOF(qemuAgentPtr agent,
virDomainObjPtr vm)
{
- struct qemud_driver *driver = qemu_driver;
+ virQEMUDriverPtr driver = qemu_driver;
qemuDomainObjPrivatePtr priv;
VIR_DEBUG("Received EOF from agent on %p '%s'", vm, vm->def->name);
@@ -149,7 +149,7 @@ static void
qemuProcessHandleAgentError(qemuAgentPtr agent ATTRIBUTE_UNUSED,
virDomainObjPtr vm)
{
- struct qemud_driver *driver = qemu_driver;
+ virQEMUDriverPtr driver = qemu_driver;
qemuDomainObjPrivatePtr priv;
VIR_DEBUG("Received error from agent on %p '%s'", vm, vm->def->name);
@@ -202,7 +202,7 @@ qemuFindAgentConfig(virDomainDefPtr def)
}
static int
-qemuConnectAgent(struct qemud_driver *driver, virDomainObjPtr vm)
+qemuConnectAgent(virQEMUDriverPtr driver, virDomainObjPtr vm)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
int ret = -1;
@@ -273,7 +273,7 @@ static void
qemuProcessHandleMonitorEOF(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
virDomainObjPtr vm)
{
- struct qemud_driver *driver = qemu_driver;
+ virQEMUDriverPtr driver = qemu_driver;
virDomainEventPtr event = NULL;
qemuDomainObjPrivatePtr priv;
int eventReason = VIR_DOMAIN_EVENT_STOPPED_SHUTDOWN;
@@ -336,7 +336,7 @@ static void
qemuProcessHandleMonitorError(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
virDomainObjPtr vm)
{
- struct qemud_driver *driver = qemu_driver;
+ virQEMUDriverPtr driver = qemu_driver;
virDomainEventPtr event = NULL;
VIR_DEBUG("Received error on %p '%s'", vm, vm->def->name);
@@ -505,7 +505,7 @@ static int
qemuProcessHandleReset(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
virDomainObjPtr vm)
{
- struct qemud_driver *driver = qemu_driver;
+ virQEMUDriverPtr driver = qemu_driver;
virDomainEventPtr event;
qemuDomainObjPrivatePtr priv;
@@ -539,7 +539,7 @@ qemuProcessHandleReset(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
static void
qemuProcessFakeReboot(void *opaque)
{
- struct qemud_driver *driver = qemu_driver;
+ virQEMUDriverPtr driver = qemu_driver;
virDomainObjPtr vm = opaque;
qemuDomainObjPrivatePtr priv = vm->privateData;
virDomainEventPtr event = NULL;
@@ -604,7 +604,7 @@ cleanup:
static void
-qemuProcessShutdownOrReboot(struct qemud_driver *driver,
+qemuProcessShutdownOrReboot(virQEMUDriverPtr driver,
virDomainObjPtr vm)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
@@ -631,7 +631,7 @@ static int
qemuProcessHandleShutdown(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
virDomainObjPtr vm)
{
- struct qemud_driver *driver = qemu_driver;
+ virQEMUDriverPtr driver = qemu_driver;
qemuDomainObjPrivatePtr priv;
virDomainEventPtr event = NULL;
@@ -687,7 +687,7 @@ static int
qemuProcessHandleStop(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
virDomainObjPtr vm)
{
- struct qemud_driver *driver = qemu_driver;
+ virQEMUDriverPtr driver = qemu_driver;
virDomainEventPtr event = NULL;
virDomainObjLock(vm);
@@ -736,7 +736,7 @@ qemuProcessHandleRTCChange(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
virDomainObjPtr vm,
long long offset)
{
- struct qemud_driver *driver = qemu_driver;
+ virQEMUDriverPtr driver = qemu_driver;
virDomainEventPtr event;
virDomainObjLock(vm);
@@ -765,7 +765,7 @@ qemuProcessHandleWatchdog(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
virDomainObjPtr vm,
int action)
{
- struct qemud_driver *driver = qemu_driver;
+ virQEMUDriverPtr driver = qemu_driver;
virDomainEventPtr watchdogEvent = NULL;
virDomainEventPtr lifecycleEvent = NULL;
@@ -835,7 +835,7 @@ qemuProcessHandleIOError(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
int action,
const char *reason)
{
- struct qemud_driver *driver = qemu_driver;
+ virQEMUDriverPtr driver = qemu_driver;
virDomainEventPtr ioErrorEvent = NULL;
virDomainEventPtr ioErrorEvent2 = NULL;
virDomainEventPtr lifecycleEvent = NULL;
@@ -898,7 +898,7 @@ qemuProcessHandleBlockJob(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
int type,
int status)
{
- struct qemud_driver *driver = qemu_driver;
+ virQEMUDriverPtr driver = qemu_driver;
virDomainEventPtr event = NULL;
const char *path;
virDomainDiskDefPtr disk;
@@ -950,7 +950,7 @@ qemuProcessHandleGraphics(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
const char *x509dname,
const char *saslUsername)
{
- struct qemud_driver *driver = qemu_driver;
+ virQEMUDriverPtr driver = qemu_driver;
virDomainEventPtr event;
virDomainEventGraphicsAddressPtr localAddr = NULL;
virDomainEventGraphicsAddressPtr remoteAddr = NULL;
@@ -1039,7 +1039,7 @@ qemuProcessHandleTrayChange(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
const char *devAlias,
int reason)
{
- struct qemud_driver *driver = qemu_driver;
+ virQEMUDriverPtr driver = qemu_driver;
virDomainEventPtr event = NULL;
virDomainDiskDefPtr disk;
@@ -1077,7 +1077,7 @@ static int
qemuProcessHandlePMWakeup(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
virDomainObjPtr vm)
{
- struct qemud_driver *driver = qemu_driver;
+ virQEMUDriverPtr driver = qemu_driver;
virDomainEventPtr event = NULL;
virDomainEventPtr lifecycleEvent = NULL;
@@ -1121,7 +1121,7 @@ static int
qemuProcessHandlePMSuspend(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
virDomainObjPtr vm)
{
- struct qemud_driver *driver = qemu_driver;
+ virQEMUDriverPtr driver = qemu_driver;
virDomainEventPtr event = NULL;
virDomainEventPtr lifecycleEvent = NULL;
@@ -1168,7 +1168,7 @@ qemuProcessHandleBalloonChange(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
virDomainObjPtr vm,
unsigned long long actual)
{
- struct qemud_driver *driver = qemu_driver;
+ virQEMUDriverPtr driver = qemu_driver;
virDomainEventPtr event;
virDomainObjLock(vm);
@@ -1196,7 +1196,7 @@ static int
qemuProcessHandlePMSuspendDisk(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
virDomainObjPtr vm)
{
- struct qemud_driver *driver = qemu_driver;
+ virQEMUDriverPtr driver = qemu_driver;
virDomainEventPtr event = NULL;
virDomainEventPtr lifecycleEvent = NULL;
@@ -1260,7 +1260,7 @@ static qemuMonitorCallbacks monitorCallbacks = {
};
static int
-qemuConnectMonitor(struct qemud_driver *driver, virDomainObjPtr vm)
+qemuConnectMonitor(virQEMUDriverPtr driver, virDomainObjPtr vm)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
int ret = -1;
@@ -1634,7 +1634,7 @@ qemuProcessReadLogFD(int logfd, char *buf, int maxlen, int off)
static int
-qemuProcessWaitForMonitor(struct qemud_driver* driver,
+qemuProcessWaitForMonitor(virQEMUDriverPtr driver,
virDomainObjPtr vm,
qemuCapsPtr caps,
off_t pos)
@@ -1709,7 +1709,7 @@ closelog:
}
static int
-qemuProcessDetectVcpuPIDs(struct qemud_driver *driver,
+qemuProcessDetectVcpuPIDs(virQEMUDriverPtr driver,
virDomainObjPtr vm)
{
pid_t *cpupids = NULL;
@@ -1898,7 +1898,7 @@ qemuGetNumadAdvice(virDomainDefPtr def ATTRIBUTE_UNUSED)
* just return a new allocated bitmap.
*/
virBitmapPtr
-qemuPrepareCpumap(struct qemud_driver *driver,
+qemuPrepareCpumap(virQEMUDriverPtr driver,
virBitmapPtr nodemask)
{
int i, hostcpus, maxcpu = QEMUD_CPUMASK_LEN;
@@ -1943,7 +1943,7 @@ qemuPrepareCpumap(struct qemud_driver *driver,
* To be run between fork/exec of QEMU only
*/
static int
-qemuProcessInitCpuAffinity(struct qemud_driver *driver,
+qemuProcessInitCpuAffinity(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virBitmapPtr nodemask)
{
@@ -2073,7 +2073,7 @@ qemuProcessSetEmulatorAffinites(virConnectPtr conn ATTRIBUTE_UNUSED,
static int
qemuProcessInitPasswords(virConnectPtr conn,
- struct qemud_driver *driver,
+ virQEMUDriverPtr driver,
virDomainObjPtr vm)
{
int ret = 0;
@@ -2497,7 +2497,7 @@ qemuProcessDetectPCIAddresses(virDomainObjPtr vm,
}
static int
-qemuProcessInitPCIAddresses(struct qemud_driver *driver,
+qemuProcessInitPCIAddresses(virQEMUDriverPtr driver,
virDomainObjPtr vm)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
@@ -2518,7 +2518,7 @@ qemuProcessInitPCIAddresses(struct qemud_driver *driver,
}
-static int qemuProcessNextFreePort(struct qemud_driver *driver,
+static int qemuProcessNextFreePort(virQEMUDriverPtr driver,
int startPort)
{
int i;
@@ -2573,7 +2573,7 @@ static int qemuProcessNextFreePort(struct qemud_driver *driver,
static void
-qemuProcessReturnPort(struct qemud_driver *driver,
+qemuProcessReturnPort(virQEMUDriverPtr driver,
int port)
{
if (port < driver->remotePortMin)
@@ -2609,7 +2609,7 @@ qemuProcessPrepareChardevDevice(virDomainDefPtr def ATTRIBUTE_UNUSED,
static int
-qemuProcessLimits(struct qemud_driver *driver)
+qemuProcessLimits(virQEMUDriverPtr driver)
{
struct rlimit rlim;
@@ -2642,7 +2642,7 @@ qemuProcessLimits(struct qemud_driver *driver)
struct qemuProcessHookData {
virConnectPtr conn;
virDomainObjPtr vm;
- struct qemud_driver *driver;
+ virQEMUDriverPtr driver;
virBitmapPtr nodemask;
};
@@ -2706,7 +2706,7 @@ cleanup:
}
int
-qemuProcessPrepareMonitorChr(struct qemud_driver *driver,
+qemuProcessPrepareMonitorChr(virQEMUDriverPtr driver,
virDomainChrSourceDefPtr monConfig,
const char *vm)
{
@@ -2729,7 +2729,7 @@ qemuProcessPrepareMonitorChr(struct qemud_driver *driver,
* {Enter,Exit}MonitorWithDriver
*/
int
-qemuProcessStartCPUs(struct qemud_driver *driver, virDomainObjPtr vm,
+qemuProcessStartCPUs(virQEMUDriverPtr driver, virDomainObjPtr vm,
virConnectPtr conn, virDomainRunningReason reason,
enum qemuDomainAsyncJob asyncJob)
{
@@ -2765,7 +2765,7 @@ qemuProcessStartCPUs(struct qemud_driver *driver, virDomainObjPtr vm,
}
-int qemuProcessStopCPUs(struct qemud_driver *driver, virDomainObjPtr vm,
+int qemuProcessStopCPUs(virQEMUDriverPtr driver, virDomainObjPtr vm,
virDomainPausedReason reason,
enum qemuDomainAsyncJob asyncJob)
{
@@ -2829,7 +2829,7 @@ qemuProcessFiltersInstantiate(virConnectPtr conn,
}
static int
-qemuProcessUpdateState(struct qemud_driver *driver, virDomainObjPtr vm)
+qemuProcessUpdateState(virQEMUDriverPtr driver, virDomainObjPtr vm)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
virDomainState state;
@@ -2890,7 +2890,7 @@ qemuProcessUpdateState(struct qemud_driver *driver, virDomainObjPtr vm)
}
static int
-qemuProcessRecoverMigration(struct qemud_driver *driver,
+qemuProcessRecoverMigration(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virConnectPtr conn,
enum qemuDomainAsyncJob job,
@@ -3002,7 +3002,7 @@ qemuProcessRecoverMigration(struct qemud_driver *driver,
}
static int
-qemuProcessRecoverJob(struct qemud_driver *driver,
+qemuProcessRecoverJob(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virConnectPtr conn,
const struct qemuDomainJobObj *job)
@@ -3095,7 +3095,7 @@ qemuProcessRecoverJob(struct qemud_driver *driver,
struct qemuProcessReconnectData {
virConnectPtr conn;
- struct qemud_driver *driver;
+ virQEMUDriverPtr driver;
void *payload;
struct qemuDomainJobObj oldjob;
};
@@ -3111,7 +3111,7 @@ static void
qemuProcessReconnect(void *opaque)
{
struct qemuProcessReconnectData *data = opaque;
- struct qemud_driver *driver = data->driver;
+ virQEMUDriverPtr driver = data->driver;
virDomainObjPtr obj = data->payload;
qemuDomainObjPrivatePtr priv;
virConnectPtr conn = data->conn;
@@ -3370,14 +3370,14 @@ error:
* about.
*/
void
-qemuProcessReconnectAll(virConnectPtr conn, struct qemud_driver *driver)
+qemuProcessReconnectAll(virConnectPtr conn, virQEMUDriverPtr driver)
{
struct qemuProcessReconnectData data = {.conn = conn, .driver = driver};
virHashForEach(driver->domains.objs, qemuProcessReconnectHelper, &data);
}
int qemuProcessStart(virConnectPtr conn,
- struct qemud_driver *driver,
+ virQEMUDriverPtr driver,
virDomainObjPtr vm,
const char *migrateFrom,
int stdin_fd,
@@ -3931,7 +3931,7 @@ cleanup:
int
-qemuProcessKill(struct qemud_driver *driver,
+qemuProcessKill(virQEMUDriverPtr driver,
virDomainObjPtr vm, unsigned int flags)
{
int ret;
@@ -3971,7 +3971,7 @@ qemuProcessKill(struct qemud_driver *driver,
}
-void qemuProcessStop(struct qemud_driver *driver,
+void qemuProcessStop(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainShutoffReason reason,
unsigned int flags)
@@ -4196,7 +4196,7 @@ retry:
int qemuProcessAttach(virConnectPtr conn ATTRIBUTE_UNUSED,
- struct qemud_driver *driver,
+ virQEMUDriverPtr driver,
virDomainObjPtr vm,
pid_t pid,
const char *pidfile,
@@ -4410,7 +4410,7 @@ cleanup:
static virDomainObjPtr
-qemuProcessAutoDestroy(struct qemud_driver *driver,
+qemuProcessAutoDestroy(virQEMUDriverPtr driver,
virDomainObjPtr dom,
virConnectPtr conn)
{
@@ -4448,7 +4448,7 @@ cleanup:
return dom;
}
-int qemuProcessAutoDestroyAdd(struct qemud_driver *driver,
+int qemuProcessAutoDestroyAdd(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virConnectPtr conn)
{
@@ -4457,14 +4457,14 @@ int qemuProcessAutoDestroyAdd(struct qemud_driver *driver,
qemuProcessAutoDestroy);
}
-int qemuProcessAutoDestroyRemove(struct qemud_driver *driver,
+int qemuProcessAutoDestroyRemove(virQEMUDriverPtr driver,
virDomainObjPtr vm)
{
VIR_DEBUG("vm=%s", vm->def->name);
return qemuDriverCloseCallbackUnset(driver, vm, qemuProcessAutoDestroy);
}
-bool qemuProcessAutoDestroyActive(struct qemud_driver *driver,
+bool qemuProcessAutoDestroyActive(virQEMUDriverPtr driver,
virDomainObjPtr vm)
{
qemuDriverCloseCallback cb;
diff --git a/src/qemu/qemu_process.h b/src/qemu/qemu_process.h
index 543c9ee..c12df32 100644
--- a/src/qemu/qemu_process.h
+++ b/src/qemu/qemu_process.h
@@ -25,22 +25,22 @@
# include "qemu_conf.h"
# include "qemu_domain.h"
-int qemuProcessPrepareMonitorChr(struct qemud_driver *driver,
+int qemuProcessPrepareMonitorChr(virQEMUDriverPtr driver,
virDomainChrSourceDefPtr monConfig,
const char *vm);
-int qemuProcessStartCPUs(struct qemud_driver *driver,
+int qemuProcessStartCPUs(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virConnectPtr conn,
virDomainRunningReason reason,
enum qemuDomainAsyncJob asyncJob);
-int qemuProcessStopCPUs(struct qemud_driver *driver,
+int qemuProcessStopCPUs(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainPausedReason reason,
enum qemuDomainAsyncJob asyncJob);
-void qemuProcessAutostartAll(struct qemud_driver *driver);
-void qemuProcessReconnectAll(virConnectPtr conn, struct qemud_driver *driver);
+void qemuProcessAutostartAll(virQEMUDriverPtr driver);
+void qemuProcessReconnectAll(virConnectPtr conn, virQEMUDriverPtr driver);
int qemuProcessAssignPCIAddresses(virDomainDefPtr def);
@@ -51,7 +51,7 @@ typedef enum {
} qemuProcessStartFlags;
int qemuProcessStart(virConnectPtr conn,
- struct qemud_driver *driver,
+ virQEMUDriverPtr driver,
virDomainObjPtr vm,
const char *migrateFrom,
int stdin_fd,
@@ -65,13 +65,13 @@ typedef enum {
VIR_QEMU_PROCESS_STOP_NO_RELABEL = 1 << 1,
} qemuProcessStopFlags;
-void qemuProcessStop(struct qemud_driver *driver,
+void qemuProcessStop(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainShutoffReason reason,
unsigned int flags);
int qemuProcessAttach(virConnectPtr conn,
- struct qemud_driver *driver,
+ virQEMUDriverPtr driver,
virDomainObjPtr vm,
pid_t pid,
const char *pidfile,
@@ -84,19 +84,19 @@ typedef enum {
VIR_QEMU_PROCESS_KILL_NOCHECK = 1 << 2, /* bypass the running vm check */
} virQemuProcessKillMode;
-int qemuProcessKill(struct qemud_driver *driver,
+int qemuProcessKill(virQEMUDriverPtr driver,
virDomainObjPtr vm, unsigned int flags);
-int qemuProcessAutoDestroyInit(struct qemud_driver *driver);
-void qemuProcessAutoDestroyShutdown(struct qemud_driver *driver);
-int qemuProcessAutoDestroyAdd(struct qemud_driver *driver,
+int qemuProcessAutoDestroyInit(virQEMUDriverPtr driver);
+void qemuProcessAutoDestroyShutdown(virQEMUDriverPtr driver);
+int qemuProcessAutoDestroyAdd(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virConnectPtr conn);
-int qemuProcessAutoDestroyRemove(struct qemud_driver *driver,
+int qemuProcessAutoDestroyRemove(virQEMUDriverPtr driver,
virDomainObjPtr vm);
-bool qemuProcessAutoDestroyActive(struct qemud_driver *driver,
+bool qemuProcessAutoDestroyActive(virQEMUDriverPtr driver,
virDomainObjPtr vm);
-virBitmapPtr qemuPrepareCpumap(struct qemud_driver *driver,
+virBitmapPtr qemuPrepareCpumap(virQEMUDriverPtr driver,
virBitmapPtr nodemask);
#endif /* __QEMU_PROCESS_H__ */
--
1.7.11.7
11 years, 12 months
[libvirt] [PATCH] maint: Fix use of invalid reboot flags
by Michal Privoznik
Throughout the code, we've always used VIR_DOMAIN_SHUTDOWN* flags
even for virDomainReboot() API and its implementation. Fortunately,
the appropriate macros has the same value. But if we want to keep
things consistent, we should be using the correct macros. This
patch doesn't break anything, luckily.
---
Worth backporting to v0.10.2-maint and v0.9.11-maint (will cause conflict)?
The v0.9.6-maint doesn't have these flags yet.
src/libvirt.c | 4 ++--
src/qemu/qemu_driver.c | 8 ++++----
tools/virsh-domain.c | 4 ++--
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/libvirt.c b/src/libvirt.c
index 23c36f9..ce17998 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -3305,8 +3305,8 @@ virDomainReboot(virDomainPtr domain, unsigned int flags)
}
/* At most one of these two flags should be set. */
- if ((flags & VIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN) &&
- (flags & VIR_DOMAIN_SHUTDOWN_GUEST_AGENT)) {
+ if ((flags & VIR_DOMAIN_REBOOT_ACPI_POWER_BTN) &&
+ (flags & VIR_DOMAIN_REBOOT_GUEST_AGENT)) {
virReportInvalidArg(flags, "%s",
_("flags for acpi power button and guest agent are mutually exclusive"));
goto error;
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index d027880..b18e037 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -1893,8 +1893,8 @@ qemuDomainReboot(virDomainPtr dom, unsigned int flags)
qemuDomainObjPrivatePtr priv;
bool useAgent = false;
- virCheckFlags(VIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN |
- VIR_DOMAIN_SHUTDOWN_GUEST_AGENT , -1);
+ virCheckFlags(VIR_DOMAIN_REBOOT_ACPI_POWER_BTN |
+ VIR_DOMAIN_REBOOT_GUEST_AGENT , -1);
qemuDriverLock(driver);
vm = virDomainFindByUUID(&driver->domains, dom->uuid);
@@ -1910,8 +1910,8 @@ qemuDomainReboot(virDomainPtr dom, unsigned int flags)
priv = vm->privateData;
- if ((flags & VIR_DOMAIN_SHUTDOWN_GUEST_AGENT) ||
- (!(flags & VIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN) &&
+ if ((flags & VIR_DOMAIN_REBOOT_GUEST_AGENT) ||
+ (!(flags & VIR_DOMAIN_REBOOT_ACPI_POWER_BTN) &&
priv->agent))
useAgent = true;
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 5ff8a82..6d5a0ec 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -4101,9 +4101,9 @@ cmdReboot(vshControl *ctl, const vshCmd *cmd)
if (mode) {
if (STREQ(mode, "acpi")) {
- flags |= VIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN;
+ flags |= VIR_DOMAIN_REBOOT_ACPI_POWER_BTN;
} else if (STREQ(mode, "agent")) {
- flags |= VIR_DOMAIN_SHUTDOWN_GUEST_AGENT;
+ flags |= VIR_DOMAIN_REBOOT_GUEST_AGENT;
} else {
vshError(ctl, _("Unknown mode %s value, expecting 'acpi' or 'agent'"), mode);
return false;
--
1.7.8.6
11 years, 12 months
[libvirt] [PATCH] build: avoid C99 for loop
by Eric Blake
Although we require various C99 features, we don't yet require a
complete C99 compiler. On RHEL 5, compilation complained:
qemu/qemu_command.c: In function 'qemuBuildGraphicsCommandLine':
qemu/qemu_command.c:4688: error: 'for' loop initial declaration used outside C99 mode
* src/qemu/qemu_command.c (qemuBuildGraphicsCommandLine): Declare
variable sooner.
* src/qemu/qemu_process.c (qemuProcessInitPasswords): Likewise.
---
Pushing under the build-breaker rule
src/qemu/qemu_command.c | 4 +++-
src/qemu/qemu_process.c | 5 ++---
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 9c9a0ed..03716d4 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -4429,6 +4429,8 @@ qemuBuildGraphicsCommandLine(struct qemud_driver *driver,
qemuCapsPtr caps,
virDomainGraphicsDefPtr graphics)
{
+ int i;
+
if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
virBuffer opt = VIR_BUFFER_INITIALIZER;
@@ -4685,7 +4687,7 @@ qemuBuildGraphicsCommandLine(struct qemud_driver *driver,
break;
}
- for (int i = 0 ; i < VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_LAST ; i++) {
+ for (i = 0 ; i < VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_LAST ; i++) {
int mode = graphics->data.spice.channels[i];
switch (mode) {
case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_SECURE:
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 3d7a5a0..8743c60 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -2078,8 +2078,9 @@ qemuProcessInitPasswords(virConnectPtr conn,
{
int ret = 0;
qemuDomainObjPrivatePtr priv = vm->privateData;
+ int i;
- for (int i = 0 ; i < vm->def->ngraphics; ++i) {
+ for (i = 0 ; i < vm->def->ngraphics; ++i) {
virDomainGraphicsDefPtr graphics = vm->def->graphics[i];
if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
ret = qemuDomainChangeGraphicsPasswords(driver, vm,
@@ -2098,8 +2099,6 @@ qemuProcessInitPasswords(virConnectPtr conn,
goto cleanup;
if (qemuCapsGet(priv->caps, QEMU_CAPS_DEVICE)) {
- int i;
-
for (i = 0 ; i < vm->def->ndisks ; i++) {
char *secret;
size_t secretLen;
--
1.7.1
11 years, 12 months
[libvirt] Any plans to extend openvswitch configuration in libvirt?
by james robson
Hello All,
Are there any current plans to extend the openvswitch port configuration
options to include the 'native-tagged' and 'native-untagged' vlan modes?
I'm currently setting up a test lab that is going to require the
'native-untagged' vlan mode on openvswitch and would prefer to keep
these setting with the other network configuration for my virtual
machines.
I can produce a patch for this functionality myself, but don't want to
duplicate effort if someone else is all ready working on it.
Protected by Websense Hosted Email Security -- www.websense.com
11 years, 12 months
[libvirt] [PATCH] nwfilter: drop dead code
by Eric Blake
Commit cb022152 went overboard and introduced a dead conditional
while trying to get rid of a potential NULL dereference.
* src/nwfilter/nwfilter_dhcpsnoop.c (virNWFilterSnoopReqNew):
Remove redundant conditional.
---
Pushing under the trivial rule.
src/nwfilter/nwfilter_dhcpsnoop.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/nwfilter/nwfilter_dhcpsnoop.c b/src/nwfilter/nwfilter_dhcpsnoop.c
index 3321d0b..e4c895f 100644
--- a/src/nwfilter/nwfilter_dhcpsnoop.c
+++ b/src/nwfilter/nwfilter_dhcpsnoop.c
@@ -573,7 +573,7 @@ virNWFilterSnoopReqNew(const char *ifkey)
{
virNWFilterSnoopReqPtr req;
- if (ifkey == NULL || (ifkey && (strlen(ifkey) != VIR_IFKEY_LEN - 1))) {
+ if (ifkey == NULL || strlen(ifkey) != VIR_IFKEY_LEN - 1) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("virNWFilterSnoopReqNew called with invalid "
"key \"%s\" (%zu)"),
--
1.7.1
11 years, 12 months