[libvirt] [PATCH] Revert "admin: Rename virAdmConnect to virAdmDaemon"
by Erik Skultety
Commmit df8192aa introduced admin related rename and some minor
(caused by automated approach, aka sed) and some more severe isues along with
it. First reason to revert is the inconsistency with libvirt library.
Although we deal with the daemon directly rather than with a specific
hypervisor, we still do have a connection. That being said, contributors might
get under the impression that AdmDaemonNew would spawn/start a new daemon
(since it's admin API, why not...), or AdmDaemonClose would do the exact
opposite or they might expect DaemonIsAlive report overall status of the daemon
which definitely isn't the case.
The second reason to revert this patch is renaming virt-admin client. The
client tool does not necessarily have to reflect the names of the API's it's
using in his internals. An example would be 's/vshAdmConnect/vshAdmDaemon'
where noone can be certain of what the latter function really does. The former
is quite expressive about some connection magic it performs, but the latter does
not say anything, especially when vshAdmReconnect and vshAdmDisconnect were
left untouched.
---
The admin API rename is not entirely bad idea (e.g. virAdmDaemonGetURI sounds
a little better than virAdmConnectGetURI), so by introducing this patch
I'd like to reopen the discussion about what we could/should rename
(if anything) and which parts should definitely be left untouched, because
there is still time to do somthing with it since admin is disabled and not
distributed in the package.
daemon/admin_server.c | 22 ++---
include/libvirt/libvirt-admin.h | 48 +++++-----
src/admin/admin_protocol.x | 10 +--
src/admin/admin_remote.c | 36 ++++----
src/admin_protocol-structs | 10 +--
src/datatypes.c | 38 ++++----
src/datatypes.h | 28 +++---
src/libvirt-admin.c | 195 ++++++++++++++++++++--------------------
src/libvirt_admin_private.syms | 4 +-
src/libvirt_admin_public.syms | 16 ++--
src/rpc/gendispatch.pl | 2 +-
tools/virsh.c | 18 ++--
tools/virsh.h | 1 -
tools/virt-admin.c | 65 +++++++-------
tools/virt-admin.h | 3 +-
tools/vsh.h | 1 +
16 files changed, 249 insertions(+), 248 deletions(-)
diff --git a/daemon/admin_server.c b/daemon/admin_server.c
index 678e8bc..189091e 100644
--- a/daemon/admin_server.c
+++ b/daemon/admin_server.c
@@ -79,11 +79,11 @@ remoteAdmClientInitHook(virNetServerClientPtr client ATTRIBUTE_UNUSED,
/* Functions */
static int
-adminDispatchDaemonOpen(virNetServerPtr server ATTRIBUTE_UNUSED,
- virNetServerClientPtr client,
- virNetMessagePtr msg ATTRIBUTE_UNUSED,
- virNetMessageErrorPtr rerr,
- struct admin_daemon_open_args *args)
+adminDispatchConnectOpen(virNetServerPtr server ATTRIBUTE_UNUSED,
+ virNetServerClientPtr client,
+ virNetMessagePtr msg ATTRIBUTE_UNUSED,
+ virNetMessageErrorPtr rerr,
+ struct admin_connect_open_args *args)
{
unsigned int flags;
struct daemonAdmClientPrivate *priv =
@@ -105,18 +105,18 @@ adminDispatchDaemonOpen(virNetServerPtr server ATTRIBUTE_UNUSED,
}
static int
-adminDispatchDaemonClose(virNetServerPtr server ATTRIBUTE_UNUSED,
- virNetServerClientPtr client,
- virNetMessagePtr msg ATTRIBUTE_UNUSED,
- virNetMessageErrorPtr rerr ATTRIBUTE_UNUSED)
+adminDispatchConnectClose(virNetServerPtr server ATTRIBUTE_UNUSED,
+ virNetServerClientPtr client,
+ virNetMessagePtr msg ATTRIBUTE_UNUSED,
+ virNetMessageErrorPtr rerr ATTRIBUTE_UNUSED)
{
virNetServerClientDelayedClose(client);
return 0;
}
static int
-adminDaemonGetVersion(virNetDaemonPtr dmn ATTRIBUTE_UNUSED,
- unsigned long long *libVer)
+adminConnectGetLibVersion(virNetDaemonPtr dmn ATTRIBUTE_UNUSED,
+ unsigned long long *libVer)
{
if (libVer)
*libVer = LIBVIR_VERSION_NUMBER;
diff --git a/include/libvirt/libvirt-admin.h b/include/libvirt/libvirt-admin.h
index b81698e..ab9df96 100644
--- a/include/libvirt/libvirt-admin.h
+++ b/include/libvirt/libvirt-admin.h
@@ -35,51 +35,53 @@ extern "C" {
# undef __VIR_ADMIN_H_INCLUDES__
/**
- * virAdmDaemon:
+ * virAdmConnect:
*
- * a virAdmDaemon is a private structure representing a remote daemon.
+ * a virAdmConnect is a private structure representing a connection to
+ * libvirt daemon.
*/
-typedef struct _virAdmDaemon virAdmDaemon;
+typedef struct _virAdmConnect virAdmConnect;
/**
- * virAdmDaemonPtr:
+ * virAdmConnectPtr:
*
- * a virAdmDaemonPtr is pointer to a virAdmDaemon private structure,
- * this is the type used to reference a daemon in the API.
+ * a virAdmConnectPtr is pointer to a virAdmConnect private structure,
+ * this is the type used to reference a connection to the daemon
+ * in the API.
*/
-typedef virAdmDaemon *virAdmDaemonPtr;
+typedef virAdmConnect *virAdmConnectPtr;
-virAdmDaemonPtr virAdmDaemonOpen(const char *name, unsigned int flags);
-int virAdmDaemonClose(virAdmDaemonPtr dmn);
+virAdmConnectPtr virAdmConnectOpen(const char *name, unsigned int flags);
+int virAdmConnectClose(virAdmConnectPtr conn);
-int virAdmDaemonRef(virAdmDaemonPtr dmn);
-int virAdmDaemonIsAlive(virAdmDaemonPtr dmn);
+int virAdmConnectRef(virAdmConnectPtr conn);
+int virAdmConnectIsAlive(virAdmConnectPtr conn);
int virAdmGetVersion(unsigned long long *libVer);
-char *virAdmDaemonGetURI(virAdmDaemonPtr dmn);
+char *virAdmConnectGetURI(virAdmConnectPtr conn);
-int virAdmDaemonGetVersion(virAdmDaemonPtr dmn,
- unsigned long long *libVer);
+int virAdmConnectGetLibVersion(virAdmConnectPtr conn,
+ unsigned long long *libVer);
/**
- * virAdmDaemonCloseFunc:
- * @dmn: virAdmDaemon connection
+ * virAdmConnectCloseFunc:
+ * @conn: virAdmConnect connection
* @reason: reason why the connection was closed (see virConnectCloseReason)
* @opaque: opaque client data
*
* A callback to be registered, in case a connection was closed.
*/
-typedef void (*virAdmDaemonCloseFunc)(virAdmDaemonPtr dmn,
+typedef void (*virAdmConnectCloseFunc)(virAdmConnectPtr conn,
int reason,
void *opaque);
-int virAdmDaemonRegisterCloseCallback(virAdmDaemonPtr dmn,
- virAdmDaemonCloseFunc cb,
- void *opaque,
- virFreeCallback freecb);
-int virAdmDaemonUnregisterCloseCallback(virAdmDaemonPtr dmn,
- virAdmDaemonCloseFunc cb);
+int virAdmConnectRegisterCloseCallback(virAdmConnectPtr conn,
+ virAdmConnectCloseFunc cb,
+ void *opaque,
+ virFreeCallback freecb);
+int virAdmConnectUnregisterCloseCallback(virAdmConnectPtr conn,
+ virAdmConnectCloseFunc cb);
# ifdef __cplusplus
}
diff --git a/src/admin/admin_protocol.x b/src/admin/admin_protocol.x
index b168f6f..878983d 100644
--- a/src/admin/admin_protocol.x
+++ b/src/admin/admin_protocol.x
@@ -37,11 +37,11 @@ typedef string admin_nonnull_string<ADMIN_STRING_MAX>;
typedef admin_nonnull_string *admin_string;
/*----- Protocol. -----*/
-struct admin_daemon_open_args {
+struct admin_connect_open_args {
unsigned int flags;
};
-struct admin_daemon_get_version_ret {
+struct admin_connect_get_lib_version_ret {
unsigned hyper libVer;
};
@@ -70,15 +70,15 @@ enum admin_procedure {
/**
* @generate: none
*/
- ADMIN_PROC_DAEMON_OPEN = 1,
+ ADMIN_PROC_CONNECT_OPEN = 1,
/**
* @generate: none
*/
- ADMIN_PROC_DAEMON_CLOSE = 2,
+ ADMIN_PROC_CONNECT_CLOSE = 2,
/**
* @generate: both
*/
- ADMIN_PROC_DAEMON_GET_VERSION = 3
+ ADMIN_PROC_CONNECT_GET_LIB_VERSION = 3
};
diff --git a/src/admin/admin_remote.c b/src/admin/admin_remote.c
index 8073b08..7b40ea1 100644
--- a/src/admin/admin_remote.c
+++ b/src/admin/admin_remote.c
@@ -48,7 +48,7 @@ remoteAdminPrivDispose(void *opaque)
static int
-callFull(virAdmDaemonPtr dmn ATTRIBUTE_UNUSED,
+callFull(virAdmConnectPtr conn ATTRIBUTE_UNUSED,
remoteAdminPrivPtr priv,
int *fdin,
size_t fdinlen,
@@ -86,7 +86,7 @@ callFull(virAdmDaemonPtr dmn ATTRIBUTE_UNUSED,
}
static int
-call(virAdmDaemonPtr dmn,
+call(virAdmConnectPtr conn,
unsigned int flags,
int proc_nr,
xdrproc_t args_filter, char *args,
@@ -94,7 +94,7 @@ call(virAdmDaemonPtr dmn,
{
virCheckFlags(0, -1);
- return callFull(dmn, dmn->privateData,
+ return callFull(conn, conn->privateData,
NULL, 0, NULL, NULL, proc_nr,
args_filter, args, ret_filter, ret);
}
@@ -106,14 +106,14 @@ remoteAdminClientCloseFunc(virNetClientPtr client ATTRIBUTE_UNUSED,
int reason,
void *opaque)
{
- virAdmDaemonCloseCallbackDataPtr cbdata = opaque;
+ virAdmConnectCloseCallbackDataPtr cbdata = opaque;
virObjectLock(cbdata);
if (cbdata->callback) {
VIR_DEBUG("Triggering connection close callback %p reason=%d, opaque=%p",
cbdata->callback, reason, cbdata->opaque);
- cbdata->callback(cbdata->dmn, reason, cbdata->opaque);
+ cbdata->callback(cbdata->conn, reason, cbdata->opaque);
if (cbdata->freeCallback)
cbdata->freeCallback(cbdata->opaque);
@@ -124,11 +124,11 @@ remoteAdminClientCloseFunc(virNetClientPtr client ATTRIBUTE_UNUSED,
}
static int
-remoteAdminDaemonOpen(virAdmDaemonPtr dmn, unsigned int flags)
+remoteAdminConnectOpen(virAdmConnectPtr conn, unsigned int flags)
{
int rv = -1;
- remoteAdminPrivPtr priv = dmn->privateData;
- admin_daemon_open_args args;
+ remoteAdminPrivPtr priv = conn->privateData;
+ admin_connect_open_args args;
virObjectLock(priv);
@@ -140,13 +140,13 @@ remoteAdminDaemonOpen(virAdmDaemonPtr dmn, unsigned int flags)
virResetLastError();
}
- virObjectRef(dmn->closeCallback);
+ virObjectRef(conn->closeCallback);
virNetClientSetCloseCallback(priv->client, remoteAdminClientCloseFunc,
- dmn->closeCallback,
+ conn->closeCallback,
virObjectFreeCallback);
- if (call(dmn, 0, ADMIN_PROC_DAEMON_OPEN,
- (xdrproc_t)xdr_admin_daemon_open_args, (char *)&args,
+ if (call(conn, 0, ADMIN_PROC_CONNECT_OPEN,
+ (xdrproc_t)xdr_admin_connect_open_args, (char *)&args,
(xdrproc_t)xdr_void, (char *)NULL) == -1) {
goto done;
}
@@ -159,14 +159,14 @@ remoteAdminDaemonOpen(virAdmDaemonPtr dmn, unsigned int flags)
}
static int
-remoteAdminDaemonClose(virAdmDaemonPtr dmn)
+remoteAdminConnectClose(virAdmConnectPtr conn)
{
int rv = -1;
- remoteAdminPrivPtr priv = dmn->privateData;
+ remoteAdminPrivPtr priv = conn->privateData;
virObjectLock(priv);
- if (call(dmn, 0, ADMIN_PROC_DAEMON_CLOSE,
+ if (call(conn, 0, ADMIN_PROC_CONNECT_CLOSE,
(xdrproc_t)xdr_void, (char *)NULL,
(xdrproc_t)xdr_void, (char *)NULL) == -1) {
goto done;
@@ -184,10 +184,10 @@ remoteAdminDaemonClose(virAdmDaemonPtr dmn)
static void
remoteAdminPrivFree(void *opaque)
{
- virAdmDaemonPtr dmn = opaque;
+ virAdmConnectPtr conn = opaque;
- remoteAdminDaemonClose(dmn);
- virObjectUnref(dmn->privateData);
+ remoteAdminConnectClose(conn);
+ virObjectUnref(conn->privateData);
}
static remoteAdminPrivPtr
diff --git a/src/admin_protocol-structs b/src/admin_protocol-structs
index 1753f54..809379b 100644
--- a/src/admin_protocol-structs
+++ b/src/admin_protocol-structs
@@ -1,12 +1,12 @@
/* -*- c -*- */
-struct admin_daemon_open_args {
+struct admin_connect_open_args {
u_int flags;
};
-struct admin_daemon_get_version_ret {
+struct admin_connect_get_lib_version_ret {
uint64_t libVer;
};
enum admin_procedure {
- ADMIN_PROC_DAEMON_OPEN = 1,
- ADMIN_PROC_DAEMON_CLOSE = 2,
- ADMIN_PROC_DAEMON_GET_VERSION = 3,
+ ADMIN_PROC_CONNECT_OPEN = 1,
+ ADMIN_PROC_CONNECT_CLOSE = 2,
+ ADMIN_PROC_CONNECT_GET_LIB_VERSION = 3,
};
diff --git a/src/datatypes.c b/src/datatypes.c
index dc592b6..c832d80 100644
--- a/src/datatypes.c
+++ b/src/datatypes.c
@@ -59,11 +59,11 @@ static void virStreamDispose(void *obj);
static void virStorageVolDispose(void *obj);
static void virStoragePoolDispose(void *obj);
-virClassPtr virAdmDaemonClass;
-virClassPtr virAdmDaemonCloseCallbackDataClass;
+virClassPtr virAdmConnectClass;
+virClassPtr virAdmConnectCloseCallbackDataClass;
-static void virAdmDaemonDispose(void *obj);
-static void virAdmDaemonCloseCallbackDataDispose(void *obj);
+static void virAdmConnectDispose(void *obj);
+static void virAdmConnectCloseCallbackDataDispose(void *obj);
static int
virDataTypesOnceInit(void)
@@ -92,8 +92,8 @@ virDataTypesOnceInit(void)
DECLARE_CLASS(virStorageVol);
DECLARE_CLASS(virStoragePool);
- DECLARE_CLASS_LOCKABLE(virAdmDaemon);
- DECLARE_CLASS_LOCKABLE(virAdmDaemonCloseCallbackData);
+ DECLARE_CLASS_LOCKABLE(virAdmConnect);
+ DECLARE_CLASS_LOCKABLE(virAdmConnectCloseCallbackData);
#undef DECLARE_CLASS_COMMON
#undef DECLARE_CLASS_LOCKABLE
@@ -814,18 +814,18 @@ virDomainSnapshotDispose(void *obj)
}
-virAdmDaemonPtr
-virAdmDaemonNew(void)
+virAdmConnectPtr
+virAdmConnectNew(void)
{
- virAdmDaemonPtr ret;
+ virAdmConnectPtr ret;
if (virDataTypesInitialize() < 0)
return NULL;
- if (!(ret = virObjectLockableNew(virAdmDaemonClass)))
+ if (!(ret = virObjectLockableNew(virAdmConnectClass)))
return NULL;
- if (!(ret->closeCallback = virObjectLockableNew(virAdmDaemonCloseCallbackDataClass)))
+ if (!(ret->closeCallback = virObjectLockableNew(virAdmConnectCloseCallbackDataClass)))
goto error;
return ret;
@@ -836,21 +836,21 @@ virAdmDaemonNew(void)
}
static void
-virAdmDaemonDispose(void *obj)
+virAdmConnectDispose(void *obj)
{
- virAdmDaemonPtr dmn = obj;
+ virAdmConnectPtr conn = obj;
- if (dmn->privateDataFreeFunc)
- dmn->privateDataFreeFunc(dmn);
+ if (conn->privateDataFreeFunc)
+ conn->privateDataFreeFunc(conn);
- virURIFree(dmn->uri);
- virObjectUnref(dmn->closeCallback);
+ virURIFree(conn->uri);
+ virObjectUnref(conn->closeCallback);
}
static void
-virAdmDaemonCloseCallbackDataDispose(void *obj)
+virAdmConnectCloseCallbackDataDispose(void *obj)
{
- virAdmDaemonCloseCallbackDataPtr cb_data = obj;
+ virAdmConnectCloseCallbackDataPtr cb_data = obj;
virObjectLock(cb_data);
diff --git a/src/datatypes.h b/src/datatypes.h
index 0402f09..1b1777d 100644
--- a/src/datatypes.h
+++ b/src/datatypes.h
@@ -41,7 +41,7 @@ extern virClassPtr virStreamClass;
extern virClassPtr virStorageVolClass;
extern virClassPtr virStoragePoolClass;
-extern virClassPtr virAdmDaemonClass;
+extern virClassPtr virAdmConnectClass;
# define virCheckConnectReturn(obj, retval) \
do { \
@@ -297,9 +297,9 @@ extern virClassPtr virAdmDaemonClass;
dom, NULLSTR(_domname), _uuidstr, __VA_ARGS__); \
} while (0)
-# define virCheckAdmDaemonReturn(obj, retval) \
+# define virCheckAdmConnectReturn(obj, retval) \
do { \
- if (!virObjectIsClass(obj, virAdmDaemonClass)) { \
+ if (!virObjectIsClass(obj, virAdmConnectClass)) { \
virReportErrorHelper(VIR_FROM_THIS, VIR_ERR_INVALID_CONN, \
__FILE__, __FUNCTION__, __LINE__, \
__FUNCTION__); \
@@ -307,9 +307,9 @@ extern virClassPtr virAdmDaemonClass;
return retval; \
} \
} while (0)
-# define virCheckAdmDaemonGoto(obj, label) \
+# define virCheckAdmConnectGoto(obj, label) \
do { \
- if (!virObjectIsClass(obj, virAdmDaemonClass)) { \
+ if (!virObjectIsClass(obj, virAdmConnectClass)) { \
virReportErrorHelper(VIR_FROM_THIS, VIR_ERR_INVALID_CONN, \
__FILE__, __FUNCTION__, __LINE__, \
__FUNCTION__); \
@@ -331,8 +331,8 @@ extern virClassPtr virAdmDaemonClass;
typedef struct _virConnectCloseCallbackData virConnectCloseCallbackData;
typedef virConnectCloseCallbackData *virConnectCloseCallbackDataPtr;
-typedef struct _virAdmDaemonCloseCallbackData virAdmDaemonCloseCallbackData;
-typedef virAdmDaemonCloseCallbackData *virAdmDaemonCloseCallbackDataPtr;
+typedef struct _virAdmConnectCloseCallbackData virAdmConnectCloseCallbackData;
+typedef virAdmConnectCloseCallbackData *virAdmConnectCloseCallbackDataPtr;
/**
* Internal structures holding data related to connection close callbacks.
@@ -346,11 +346,11 @@ struct _virConnectCloseCallbackData {
virFreeCallback freeCallback;
};
-struct _virAdmDaemonCloseCallbackData {
+struct _virAdmConnectCloseCallbackData {
virObjectLockable parent;
- virAdmDaemonPtr dmn;
- virAdmDaemonCloseFunc callback;
+ virAdmConnectPtr conn;
+ virAdmConnectCloseFunc callback;
void *opaque;
virFreeCallback freeCallback;
};
@@ -402,11 +402,11 @@ struct _virConnect {
};
/**
- * _virAdmDaemon:
+ * _virAdmConnect:
*
* Internal structure associated to an admin connection
*/
-struct _virAdmDaemon {
+struct _virAdmConnect {
virObjectLockable object;
virURIPtr uri;
@@ -414,7 +414,7 @@ struct _virAdmDaemon {
virFreeCallback privateDataFreeFunc;
/* Per-connection close callback */
- virAdmDaemonCloseCallbackDataPtr closeCallback;
+ virAdmConnectCloseCallbackDataPtr closeCallback;
};
@@ -599,6 +599,6 @@ virNWFilterPtr virGetNWFilter(virConnectPtr conn,
virDomainSnapshotPtr virGetDomainSnapshot(virDomainPtr domain,
const char *name);
-virAdmDaemonPtr virAdmDaemonNew(void);
+virAdmConnectPtr virAdmConnectNew(void);
#endif /* __VIR_DATATYPES_H__ */
diff --git a/src/libvirt-admin.c b/src/libvirt-admin.c
index 7b767bd..6e6da81 100644
--- a/src/libvirt-admin.c
+++ b/src/libvirt-admin.c
@@ -53,7 +53,7 @@ virAdmGlobalInit(void)
{
/* It would be nice if we could trace the use of this call, to
* help diagnose in log files if a user calls something other than
- * virAdmDaemonOpen first. But we can't rely on VIR_DEBUG working
+ * virAdmConnectOpen first. But we can't rely on VIR_DEBUG working
* until after initialization is complete, and since this is
* one-shot, we never get here again. */
if (virThreadInitialize() < 0 ||
@@ -183,20 +183,20 @@ virAdmGetDefaultURI(virConfPtr conf)
}
/**
- * virAdmDaemonOpen:
+ * virAdmConnectOpen:
* @name: uri of the daemon to connect to, NULL for default
* @flags: unused, must be 0
*
* Opens connection to admin interface of the daemon.
*
- * Returns @virAdmDaemonPtr object or NULL on error
+ * Returns @virAdmConnectPtr object or NULL on error
*/
-virAdmDaemonPtr
-virAdmDaemonOpen(const char *name, unsigned int flags)
+virAdmConnectPtr
+virAdmConnectOpen(const char *name, unsigned int flags)
{
char *sock_path = NULL;
char *alias = NULL;
- virAdmDaemonPtr dmn = NULL;
+ virAdmConnectPtr conn = NULL;
virConfPtr conf = NULL;
if (virAdmInitialize() < 0)
@@ -206,7 +206,7 @@ virAdmDaemonOpen(const char *name, unsigned int flags)
virResetLastError();
virCheckFlags(VIR_CONNECT_NO_ALIASES, NULL);
- if (!(dmn = virAdmDaemonNew()))
+ if (!(conn = virAdmConnectNew()))
goto error;
if (virConfLoadConfig(&conf, "libvirt-admin.conf") < 0)
@@ -219,46 +219,46 @@ virAdmDaemonOpen(const char *name, unsigned int flags)
virURIResolveAlias(conf, name, &alias) < 0))
goto error;
- if (!(dmn->uri = virURIParse(alias ? alias : name)))
+ if (!(conn->uri = virURIParse(alias ? alias : name)))
goto error;
- if (!(sock_path = getSocketPath(dmn->uri)))
+ if (!(sock_path = getSocketPath(conn->uri)))
goto error;
- if (!(dmn->privateData = remoteAdminPrivNew(sock_path)))
+ if (!(conn->privateData = remoteAdminPrivNew(sock_path)))
goto error;
- dmn->privateDataFreeFunc = remoteAdminPrivFree;
+ conn->privateDataFreeFunc = remoteAdminPrivFree;
- if (remoteAdminDaemonOpen(dmn, flags) < 0)
+ if (remoteAdminConnectOpen(conn, flags) < 0)
goto error;
cleanup:
VIR_FREE(sock_path);
VIR_FREE(alias);
virConfFree(conf);
- return dmn;
+ return conn;
error:
virDispatchError(NULL);
- virObjectUnref(dmn);
- dmn = NULL;
+ virObjectUnref(conn);
+ conn = NULL;
goto cleanup;
}
/**
- * virAdmDaemonClose:
- * @dmn: pointer to admin connection to close
+ * virAdmConnectClose:
+ * @conn: pointer to admin connection to close
*
* This function closes the admin connection to the Hypervisor. This should not
* be called if further interaction with the Hypervisor are needed especially if
* there is running domain which need further monitoring by the application.
*
* Connections are reference counted; the count is explicitly increased by the
- * initial virAdmDaemonOpen, as well as virAdmDaemonRef; it is also temporarily
+ * initial virAdmConnectOpen, as well as virAdmConnectRef; it is also temporarily
* increased by other API that depend on the connection remaining alive. The
- * open and every virAdmDaemonRef call should have a matching
- * virAdmDaemonClose, and all other references will be released after the
+ * open and every virAdmConnectRef call should have a matching
+ * virAdmConnectClose, and all other references will be released after the
* corresponding operation completes.
*
* Returns a positive number if at least 1 reference remains on success. The
@@ -266,34 +266,34 @@ virAdmDaemonOpen(const char *name, unsigned int flags)
* return of 0 implies no references remain and the connection is closed and
* memory has been freed. A return of -1 implies a failure.
*
- * It is possible for the last virAdmDaemonClose to return a positive value if
+ * It is possible for the last virAdmConnectClose to return a positive value if
* some other object still has a temporary reference to the connection, but the
* application should not try to further use a connection after the
- * virAdmDaemonClose that matches the initial open.
+ * virAdmConnectClose that matches the initial open.
*/
int
-virAdmDaemonClose(virAdmDaemonPtr dmn)
+virAdmConnectClose(virAdmConnectPtr conn)
{
- VIR_DEBUG("dmn=%p", dmn);
+ VIR_DEBUG("conn=%p", conn);
virResetLastError();
- if (!dmn)
+ if (!conn)
return 0;
- virCheckAdmDaemonReturn(dmn, -1);
+ virCheckAdmConnectReturn(conn, -1);
- if (!virObjectUnref(dmn))
+ if (!virObjectUnref(conn))
return 0;
return 1;
}
/**
- * virAdmDaemonRef:
- * @dmn: the connection to hold a reference on
+ * virAdmConnectRef:
+ * @conn: the connection to hold a reference on
*
* Increment the reference count on the connection. For each additional call to
- * this method, there shall be a corresponding call to virAdmDaemonClose to
+ * this method, there shall be a corresponding call to virAdmConnectClose to
* release the reference count, once the caller no longer needs the reference to
* this object.
*
@@ -305,15 +305,15 @@ virAdmDaemonClose(virAdmDaemonPtr dmn)
* Returns 0 in case of success, -1 in case of failure
*/
int
-virAdmDaemonRef(virAdmDaemonPtr dmn)
+virAdmConnectRef(virAdmConnectPtr conn)
{
- VIR_DEBUG("dmn=%p refs=%d", dmn,
- dmn ? dmn->object.parent.u.s.refs : 0);
+ VIR_DEBUG("conn=%p refs=%d", conn,
+ conn ? conn->object.parent.u.s.refs : 0);
virResetLastError();
- virCheckAdmDaemonReturn(dmn, -1);
+ virCheckAdmConnectReturn(conn, -1);
- virObjectRef(dmn);
+ virObjectRef(conn);
return 0;
}
@@ -327,7 +327,8 @@ virAdmDaemonRef(virAdmDaemonPtr dmn)
* generic message will be returned. @libVer format is as follows:
* major * 1,000,000 + minor * 1,000 + release.
*
- * NOTE: To get the remote side version use virAdmDaemonGetVersion instead.
+ * NOTE: To get the remote side library version use virAdmConnectGetLibVersion
+ * instead.
*
* Returns 0 on success, -1 in case of an error.
*/
@@ -352,8 +353,8 @@ virAdmGetVersion(unsigned long long *libVer)
}
/**
- * virAdmDaemonIsAlive:
- * @dmn: connection to admin server
+ * virAdmConnectIsAlive:
+ * @conn: connection to admin server
*
* Decide whether the connection to the admin server is alive or not.
* Connection is considered alive if the channel it is running over is not
@@ -363,20 +364,20 @@ virAdmGetVersion(unsigned long long *libVer)
* connection at all or the channel has already been closed, or -1 on error.
*/
int
-virAdmDaemonIsAlive(virAdmDaemonPtr dmn)
+virAdmConnectIsAlive(virAdmConnectPtr conn)
{
bool ret;
remoteAdminPrivPtr priv = NULL;
- VIR_DEBUG("dmn=%p", dmn);
+ VIR_DEBUG("conn=%p", conn);
- if (!dmn)
+ if (!conn)
return 0;
- virCheckAdmDaemonReturn(dmn, -1);
+ virCheckAdmConnectReturn(conn, -1);
virResetLastError();
- priv = dmn->privateData;
+ priv = conn->privateData;
virObjectLock(priv);
ret = virNetClientIsOpen(priv->client);
virObjectUnlock(priv);
@@ -385,35 +386,35 @@ virAdmDaemonIsAlive(virAdmDaemonPtr dmn)
}
/**
- * virAdmDaemonGetURI:
- * @dmn: pointer to an admin connection
+ * virAdmConnectGetURI:
+ * @conn: pointer to an admin connection
*
* String returned by this method is normally the same as the string passed
- * to the virAdmDaemonOpen. Even if NULL was passed to virAdmDaemonOpen,
+ * to the virAdmConnectOpen. Even if NULL was passed to virAdmConnectOpen,
* this method returns a non-null URI string.
*
* Returns an URI string related to the connection or NULL in case of an error.
* Caller is responsible for freeing the string.
*/
char *
-virAdmDaemonGetURI(virAdmDaemonPtr dmn)
+virAdmConnectGetURI(virAdmConnectPtr conn)
{
char *uri = NULL;
- VIR_DEBUG("dmn=%p", dmn);
+ VIR_DEBUG("conn=%p", conn);
virResetLastError();
- virCheckAdmDaemonReturn(dmn, NULL);
+ virCheckAdmConnectReturn(conn, NULL);
- if (!(uri = virURIFormat(dmn->uri)))
+ if (!(uri = virURIFormat(conn->uri)))
virDispatchError(NULL);
return uri;
}
/**
- * virAdmDaemonRegisterCloseCallback:
- * @dmn: connection to admin server
+ * virAdmConnectRegisterCloseCallback:
+ * @conn: connection to admin server
* @cb: callback to be invoked upon connection close
* @opaque: user data to pass to @cb
* @freecb: callback to free @opaque
@@ -429,103 +430,103 @@ virAdmDaemonGetURI(virAdmDaemonPtr dmn)
*
* Returns 0 on success, -1 on error
*/
-int virAdmDaemonRegisterCloseCallback(virAdmDaemonPtr dmn,
- virAdmDaemonCloseFunc cb,
- void *opaque,
- virFreeCallback freecb)
+int virAdmConnectRegisterCloseCallback(virAdmConnectPtr conn,
+ virAdmConnectCloseFunc cb,
+ void *opaque,
+ virFreeCallback freecb)
{
- VIR_DEBUG("dmn=%p", dmn);
+ VIR_DEBUG("conn=%p", conn);
virResetLastError();
- virCheckAdmDaemonReturn(dmn, -1);
+ virCheckAdmConnectReturn(conn, -1);
- virObjectRef(dmn);
+ virObjectRef(conn);
- virObjectLock(dmn);
- virObjectLock(dmn->closeCallback);
+ virObjectLock(conn);
+ virObjectLock(conn->closeCallback);
virCheckNonNullArgGoto(cb, error);
- if (dmn->closeCallback->callback) {
+ if (conn->closeCallback->callback) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("A close callback is already registered"));
goto error;
}
- dmn->closeCallback->dmn = dmn;
- dmn->closeCallback->callback = cb;
- dmn->closeCallback->opaque = opaque;
- dmn->closeCallback->freeCallback = freecb;
+ conn->closeCallback->conn = conn;
+ conn->closeCallback->callback = cb;
+ conn->closeCallback->opaque = opaque;
+ conn->closeCallback->freeCallback = freecb;
- virObjectUnlock(dmn->closeCallback);
- virObjectUnlock(dmn);
+ virObjectUnlock(conn->closeCallback);
+ virObjectUnlock(conn);
return 0;
error:
- virObjectUnlock(dmn->closeCallback);
- virObjectUnlock(dmn);
+ virObjectUnlock(conn->closeCallback);
+ virObjectUnlock(conn);
virDispatchError(NULL);
- virObjectUnref(dmn);
+ virObjectUnref(conn);
return -1;
}
/**
- * virAdmDaemonUnregisterCloseCallback:
- * @dmn: pointer to connection object
+ * virAdmConnectUnregisterCloseCallback:
+ * @conn: pointer to connection object
* @cb: pointer to the current registered callback
*
* Unregisters the callback previously set with the
- * virAdmDaemonRegisterCloseCallback method. The callback
+ * virAdmConnectRegisterCloseCallback method. The callback
* will no longer receive notifications when the connection
* closes. If a virFreeCallback was provided at time of
* registration, it will be invoked.
*
* Returns 0 on success, -1 on error
*/
-int virAdmDaemonUnregisterCloseCallback(virAdmDaemonPtr dmn,
- virAdmDaemonCloseFunc cb)
+int virAdmConnectUnregisterCloseCallback(virAdmConnectPtr conn,
+ virAdmConnectCloseFunc cb)
{
- VIR_DEBUG("dmn=%p", dmn);
+ VIR_DEBUG("conn=%p", conn);
virResetLastError();
- virCheckAdmDaemonReturn(dmn, -1);
+ virCheckAdmConnectReturn(conn, -1);
- virObjectLock(dmn);
- virObjectLock(dmn->closeCallback);
+ virObjectLock(conn);
+ virObjectLock(conn->closeCallback);
virCheckNonNullArgGoto(cb, error);
- if (dmn->closeCallback->callback != cb) {
+ if (conn->closeCallback->callback != cb) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("A different callback was requested"));
goto error;
}
- dmn->closeCallback->callback = NULL;
- if (dmn->closeCallback->freeCallback)
- dmn->closeCallback->freeCallback(dmn->closeCallback->opaque);
- dmn->closeCallback->freeCallback = NULL;
+ conn->closeCallback->callback = NULL;
+ if (conn->closeCallback->freeCallback)
+ conn->closeCallback->freeCallback(conn->closeCallback->opaque);
+ conn->closeCallback->freeCallback = NULL;
- virObjectUnlock(dmn->closeCallback);
- virObjectUnlock(dmn);
- virObjectUnref(dmn);
+ virObjectUnlock(conn->closeCallback);
+ virObjectUnlock(conn);
+ virObjectUnref(conn);
return 0;
error:
- virObjectUnlock(dmn->closeCallback);
- virObjectUnlock(dmn);
+ virObjectUnlock(conn->closeCallback);
+ virObjectUnlock(conn);
virDispatchError(NULL);
return -1;
}
/**
- * virAdmDaemonGetVersion:
- * @dmn: pointer to an active admin connection
+ * virAdmConnectGetLibVersion:
+ * @conn: pointer to an active admin connection
* @libVer: stores the current remote libvirt version number
*
* Retrieves the remote side libvirt version used by the daemon. Format
@@ -534,17 +535,17 @@ int virAdmDaemonUnregisterCloseCallback(virAdmDaemonPtr dmn,
*
* Returns 0 on success, -1 on failure and @libVer follows this format:
*/
-int virAdmDaemonGetVersion(virAdmDaemonPtr dmn,
- unsigned long long *libVer)
+int virAdmConnectGetLibVersion(virAdmConnectPtr conn,
+ unsigned long long *libVer)
{
- VIR_DEBUG("dmn=%p, libVir=%p", dmn, libVer);
+ VIR_DEBUG("conn=%p, libVir=%p", conn, libVer);
virResetLastError();
- virCheckAdmDaemonReturn(dmn, -1);
+ virCheckAdmConnectReturn(conn, -1);
virCheckNonNullArgReturn(libVer, -1);
- if (remoteAdminDaemonGetVersion(dmn, libVer) < 0)
+ if (remoteAdminConnectGetLibVersion(conn, libVer) < 0)
goto error;
return 0;
diff --git a/src/libvirt_admin_private.syms b/src/libvirt_admin_private.syms
index 3dc06a0..85380dc 100644
--- a/src/libvirt_admin_private.syms
+++ b/src/libvirt_admin_private.syms
@@ -6,8 +6,8 @@
#
# admin/admin_protocol.x
-xdr_admin_daemon_get_version_ret;
-xdr_admin_daemon_open_args;
+xdr_admin_connect_get_lib_version_ret;
+xdr_admin_connect_open_args;
# Let emacs know we want case-insensitive sorting
# Local Variables:
diff --git a/src/libvirt_admin_public.syms b/src/libvirt_admin_public.syms
index 75ff8a8..33b1db4 100644
--- a/src/libvirt_admin_public.syms
+++ b/src/libvirt_admin_public.syms
@@ -12,13 +12,13 @@
#
LIBVIRT_ADMIN_1.3.0 {
global:
- virAdmDaemonClose;
- virAdmDaemonGetURI;
- virAdmDaemonGetVersion;
- virAdmDaemonIsAlive;
- virAdmDaemonOpen;
- virAdmDaemonRef;
- virAdmDaemonRegisterCloseCallback;
- virAdmDaemonUnregisterCloseCallback;
+ virAdmConnectOpen;
+ virAdmConnectClose;
+ virAdmConnectRef;
virAdmGetVersion;
+ virAdmConnectIsAlive;
+ virAdmConnectGetURI;
+ virAdmConnectGetLibVersion;
+ virAdmConnectRegisterCloseCallback;
+ virAdmConnectUnregisterCloseCallback;
};
diff --git a/src/rpc/gendispatch.pl b/src/rpc/gendispatch.pl
index eb45465..5cfc512 100755
--- a/src/rpc/gendispatch.pl
+++ b/src/rpc/gendispatch.pl
@@ -49,7 +49,7 @@ my $procprefix = shift or die "missing procedure prefix argument";
my $protocol = shift or die "missing protocol argument";
my @autogen;
-my $connect_ptr = $structprefix eq "admin" ? "virAdmDaemonPtr" : "virConnectPtr";
+my $connect_ptr = $structprefix eq "admin" ? "virAdmConnectPtr" : "virConnectPtr";
my $prefix = ($structprefix eq "admin") ? "admin" : "vir";
sub fixup_name {
diff --git a/tools/virsh.c b/tools/virsh.c
index 96316bf..7484bed 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -198,7 +198,7 @@ virshReconnect(vshControl *ctl)
"disconnect from the hypervisor"));
}
- priv->conn = virshConnect(ctl, priv->connname, priv->readonly);
+ priv->conn = virshConnect(ctl, ctl->connname, priv->readonly);
if (!priv->conn) {
if (disconnected)
@@ -275,18 +275,18 @@ cmdConnect(vshControl *ctl, const vshCmd *cmd)
priv->conn = NULL;
}
- VIR_FREE(priv->connname);
+ VIR_FREE(ctl->connname);
if (vshCommandOptStringReq(ctl, cmd, "name", &name) < 0)
return false;
- priv->connname = vshStrdup(ctl, name);
+ ctl->connname = vshStrdup(ctl, name);
priv->useGetInfo = false;
priv->useSnapshotOld = false;
priv->blockJobNoBytes = false;
priv->readonly = ro;
- priv->conn = virshConnect(ctl, priv->connname, priv->readonly);
+ priv->conn = virshConnect(ctl, ctl->connname, priv->readonly);
if (!priv->conn) {
vshError(ctl, "%s", _("Failed to connect to the hypervisor"));
@@ -398,7 +398,7 @@ virshInit(vshControl *ctl)
NULL)) < 0)
return false;
- if (priv->connname) {
+ if (ctl->connname) {
virshReconnect(ctl);
/* Connecting to a named connection must succeed, but we delay
* connecting to the default connection until we need it
@@ -430,7 +430,7 @@ virshDeinit(vshControl *ctl)
virshControlPtr priv = ctl->privData;
vshDeinit(ctl);
- VIR_FREE(priv->connname);
+ VIR_FREE(ctl->connname);
if (priv->conn) {
int ret;
virConnectUnregisterCloseCallback(priv->conn, virshCatchDisconnect);
@@ -706,8 +706,8 @@ virshParseArgv(vshControl *ctl, int argc, char **argv)
while ((arg = getopt_long(argc, argv, "+:c:d:e:hk:K:l:qrtvV", opt, &longindex)) != -1) {
switch (arg) {
case 'c':
- VIR_FREE(priv->connname);
- priv->connname = vshStrdup(ctl, optarg);
+ VIR_FREE(ctl->connname);
+ ctl->connname = vshStrdup(ctl, optarg);
break;
case 'd':
if (virStrToLong_i(optarg, NULL, 10, &debug) < 0) {
@@ -934,7 +934,7 @@ main(int argc, char **argv)
virFileActivateDirOverride(argv[0]);
if ((defaultConn = virGetEnvBlockSUID("VIRSH_DEFAULT_CONNECT_URI")))
- virshCtl.connname = vshStrdup(ctl, defaultConn);
+ ctl->connname = vshStrdup(ctl, defaultConn);
if (!vshInit(ctl, cmdGroups, NULL))
exit(EXIT_FAILURE);
diff --git a/tools/virsh.h b/tools/virsh.h
index 1845b0e..3402408 100644
--- a/tools/virsh.h
+++ b/tools/virsh.h
@@ -69,7 +69,6 @@ typedef struct _virshCtrlData virshCtrlData;
*/
struct _virshControl {
virConnectPtr conn; /* connection to hypervisor (MAY BE NULL) */
- char *connname; /* connection name */
bool readonly; /* connect readonly (first time only, not
* during explicit connect command)
*/
diff --git a/tools/virt-admin.c b/tools/virt-admin.c
index 3b5efab..1372963 100644
--- a/tools/virt-admin.c
+++ b/tools/virt-admin.c
@@ -56,11 +56,11 @@ static const vshClientHooks hooks;
* vshAdmCatchDisconnect:
*
* We get here when the connection was closed. Unlike virsh, we do not save
- * the fact that the event was raised, sice there is virAdmDaemonIsAlive to
+ * the fact that the event was raised, sice there is virAdmConnectIsAlive to
* check if the communication channel has not been closed by remote party.
*/
static void
-vshAdmCatchDisconnect(virAdmDaemonPtr dmn ATTRIBUTE_UNUSED,
+vshAdmCatchDisconnect(virAdmConnectPtr conn ATTRIBUTE_UNUSED,
int reason,
void *opaque)
{
@@ -73,7 +73,7 @@ vshAdmCatchDisconnect(virAdmDaemonPtr dmn ATTRIBUTE_UNUSED,
return;
error = virSaveLastError();
- uri = virAdmDaemonGetURI(dmn);
+ uri = virAdmConnectGetURI(conn);
switch ((virConnectCloseReason) reason) {
case VIR_CONNECT_CLOSE_REASON_ERROR:
@@ -100,21 +100,21 @@ vshAdmCatchDisconnect(virAdmDaemonPtr dmn ATTRIBUTE_UNUSED,
}
static int
-vshAdmDaemon(vshControl *ctl, unsigned int flags)
+vshAdmConnect(vshControl *ctl, unsigned int flags)
{
vshAdmControlPtr priv = ctl->privData;
- priv->dmn = virAdmDaemonOpen(priv->name, flags);
+ priv->conn = virAdmConnectOpen(ctl->connname, flags);
- if (!priv->dmn) {
+ if (!priv->conn) {
if (priv->wantReconnect)
vshError(ctl, "%s", _("Failed to reconnect to the admin server"));
else
vshError(ctl, "%s", _("Failed to connect to the admin server"));
return -1;
} else {
- if (virAdmDaemonRegisterCloseCallback(priv->dmn, vshAdmCatchDisconnect,
- NULL, NULL) < 0)
+ if (virAdmConnectRegisterCloseCallback(priv->conn, vshAdmCatchDisconnect,
+ NULL, NULL) < 0)
vshError(ctl, "%s", _("Unable to register disconnect callback"));
if (priv->wantReconnect)
@@ -132,17 +132,17 @@ vshAdmDisconnect(vshControl *ctl)
int ret = 0;
vshAdmControlPtr priv = ctl->privData;
- if (!priv->dmn)
+ if (!priv->conn)
return ret;
- virAdmDaemonUnregisterCloseCallback(priv->dmn, vshAdmCatchDisconnect);
- ret = virAdmDaemonClose(priv->dmn);
+ virAdmConnectUnregisterCloseCallback(priv->conn, vshAdmCatchDisconnect);
+ ret = virAdmConnectClose(priv->conn);
if (ret < 0)
vshError(ctl, "%s", _("Failed to disconnect from the admin server"));
else if (ret > 0)
vshError(ctl, "%s", _("One or more references were leaked after "
"disconnect from the hypervisor"));
- priv->dmn = NULL;
+ priv->conn = NULL;
return ret;
}
@@ -156,11 +156,11 @@ static void
vshAdmReconnect(vshControl *ctl)
{
vshAdmControlPtr priv = ctl->privData;
- if (priv->dmn)
+ if (priv->conn)
priv->wantReconnect = true;
vshAdmDisconnect(ctl);
- vshAdmDaemon(ctl, 0);
+ vshAdmConnect(ctl, 0);
priv->wantReconnect = false;
}
@@ -185,7 +185,7 @@ cmdURI(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
char *uri;
vshAdmControlPtr priv = ctl->privData;
- uri = virAdmDaemonGetURI(priv->dmn);
+ uri = virAdmConnectGetURI(priv->conn);
if (!uri) {
vshError(ctl, "%s", _("failed to get URI"));
return false;
@@ -243,7 +243,7 @@ cmdVersion(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
vshPrint(ctl, _("Using library: libvirt %d.%d.%d\n"),
major, minor, rel);
- ret = virAdmDaemonGetVersion(priv->dmn, &daemonVersion);
+ ret = virAdmConnectGetLibVersion(priv->conn, &daemonVersion);
if (ret < 0) {
vshError(ctl, "%s", _("failed to get the daemon version"));
} else {
@@ -292,28 +292,28 @@ cmdConnect(vshControl *ctl, const vshCmd *cmd)
if (vshCommandOptStringReq(ctl, cmd, "name", &name) < 0)
return false;
- VIR_FREE(priv->name);
- priv->name = vshStrdup(ctl, name);
+ VIR_FREE(ctl->connname);
+ ctl->connname = vshStrdup(ctl, name);
vshAdmReconnect(ctl);
- return !!priv->dmn;
+ return !!priv->conn;
}
static void *
-vshAdmDaemonionHandler(vshControl *ctl)
+vshAdmConnectionHandler(vshControl *ctl)
{
vshAdmControlPtr priv = ctl->privData;
- if (!virAdmDaemonIsAlive(priv->dmn))
+ if (!virAdmConnectIsAlive(priv->conn))
vshAdmReconnect(ctl);
- if (!virAdmDaemonIsAlive(priv->dmn)) {
+ if (!virAdmConnectIsAlive(priv->conn)) {
vshError(ctl, "%s", _("no valid connection"));
return NULL;
}
- return priv->dmn;
+ return priv->conn;
}
/*
@@ -329,7 +329,7 @@ vshAdmInit(vshControl *ctl)
* work properly */
vshInitReload(ctl);
- if (priv->dmn)
+ if (priv->conn)
return false;
/* set up the library error handler */
@@ -342,7 +342,7 @@ vshAdmInit(vshControl *ctl)
return false;
ctl->eventLoopStarted = true;
- if (priv->name) {
+ if (ctl->connname) {
vshAdmReconnect(ctl);
/* Connecting to a named connection must succeed, but we delay
* connecting to the default connection until we need it
@@ -350,7 +350,7 @@ vshAdmInit(vshControl *ctl)
* non-default connection, or might be 'help' which needs no
* connection).
*/
- if (!priv->dmn) {
+ if (!priv->conn) {
vshReportError(ctl);
return false;
}
@@ -374,9 +374,9 @@ vshAdmDeinit(vshControl *ctl)
vshAdmControlPtr priv = ctl->privData;
vshDeinit(ctl);
- VIR_FREE(priv->name);
+ VIR_FREE(ctl->connname);
- if (priv->dmn)
+ if (priv->conn)
vshAdmDisconnect(ctl);
virResetLastError();
@@ -473,7 +473,6 @@ vshAdmParseArgv(vshControl *ctl, int argc, char **argv)
int arg, debug;
size_t i;
int longindex = -1;
- vshAdmControlPtr priv = ctl->privData;
struct option opt[] = {
{"connect", required_argument, NULL, 'c'},
{"debug", required_argument, NULL, 'd'},
@@ -490,8 +489,8 @@ vshAdmParseArgv(vshControl *ctl, int argc, char **argv)
while ((arg = getopt_long(argc, argv, "+:c:d:hl:qvV", opt, &longindex)) != -1) {
switch (arg) {
case 'c':
- VIR_FREE(priv->name);
- priv->name = vshStrdup(ctl, optarg);
+ VIR_FREE(ctl->connname);
+ ctl->connname = vshStrdup(ctl, optarg);
break;
case 'd':
if (virStrToLong_i(optarg, NULL, 10, &debug) < 0) {
@@ -599,7 +598,7 @@ static const vshCmdGrp cmdGroups[] = {
};
static const vshClientHooks hooks = {
- .connHandler = vshAdmDaemonionHandler
+ .connHandler = vshAdmConnectionHandler
};
int
@@ -657,7 +656,7 @@ main(int argc, char **argv)
virFileActivateDirOverride(argv[0]);
if ((defaultConn = virGetEnvBlockSUID("LIBVIRT_DEFAULT_ADMIN_URI")))
- virtAdminCtl.name = vshStrdup(ctl, defaultConn);
+ ctl->connname = vshStrdup(ctl, defaultConn);
if (!vshInit(ctl, cmdGroups, NULL))
exit(EXIT_FAILURE);
diff --git a/tools/virt-admin.h b/tools/virt-admin.h
index d1b1bb4..62228cc 100644
--- a/tools/virt-admin.h
+++ b/tools/virt-admin.h
@@ -39,8 +39,7 @@ typedef vshAdmControl *vshAdmControlPtr;
* adminControl
*/
struct _vshAdmControl {
- virAdmDaemonPtr dmn; /* remote daemon */
- char *name;
+ virAdmConnectPtr conn; /* connection to a daemon's admin server */
bool wantReconnect;
};
diff --git a/tools/vsh.h b/tools/vsh.h
index 9c0d8a6..0c5abdc 100644
--- a/tools/vsh.h
+++ b/tools/vsh.h
@@ -197,6 +197,7 @@ struct _vshControl {
const char *name; /* hardcoded name of the binary that cannot
* be changed without recompilation compared
* to program name */
+ char *connname; /* connection name */
char *progname; /* program name */
vshCmd *cmd; /* the current command */
char *cmdstr; /* string with command */
--
2.4.3
8 years, 11 months
[libvirt] [PATCHv2 0/4] Implement shared memory device (cold) hot-plug/unplug
by Luyao Huang
v1:
https://www.redhat.com/archives/libvir-list/2015-June/msg00830.html
These patches implement the hot-plug/hot-unplug
and cold-plug/cold-unplug for Inter-VM Shared Memory PCI device.
Luyao Huang (4):
conf: Add helpers to insert/remove/find shmem devices in domain def
qemu: Implement shared memory device cold (un)plug
qemu: Implement share memory device hot-plug
qemu: Implement shared memory device hot-unplug
src/conf/domain_conf.c | 66 ++++++++++++++++++++
src/conf/domain_conf.h | 7 +++
src/libvirt_private.syms | 4 ++
src/qemu/qemu_driver.c | 35 +++++++++--
src/qemu/qemu_hotplug.c | 152 ++++++++++++++++++++++++++++++++++++++++++++++-
src/qemu/qemu_hotplug.h | 6 ++
6 files changed, 265 insertions(+), 5 deletions(-)
--
1.8.3.1
8 years, 11 months
[libvirt] [PATCH V2] Xen: support maxvcpus in xm and xl config
by Jim Fehlig
From: Ian Campbell <ian.campbell(a)citrix.com>
xend prior to 4.0 understands vcpus as maxvcpus and vcpu_avail
as a bit map of which cpus are online (default is all).
xend from 4.0 onwards understands maxvcpus as maxvcpus and
vcpus as the number which are online (from 0..N-1). The
upstream commit (68a94cf528e6 "xm: Add maxvcpus support")
claims that if maxvcpus is omitted then the old behaviour
(i.e. obeying vcpu_avail) is retained, but AFAICT it was not,
in this case vcpu==maxcpus==online cpus. This is good for us
because handling anything else would be fiddly.
This patch changes parsing of the virDomainDef maxvcpus and vcpus
entries to use the corresponding 'maxvcpus' and 'vcpus' settings
from xm and xl config. It also drops use of the old Xen 3.x
'vcpu_avail' setting.
The change also removes the maxvcpus limit of MAX_VIRT_VCPUS (since
maxvcpus is simply a count, not a bit mask), which is particularly
crucial on ARM where MAX_VIRT_CPUS == 1 (since all guests are
expected to support vcpu placement, and therefore only the boot
vcpu's info lives in the shared info page).
Existing tests adjusted accordingly, and new tests added for the
'maxvcpus' setting.
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
This is a respin of Ian's patch [1] to support parsing/formatting of the
'maxvcpus' xm and xl config setting. It goes a bit further and removes
the old Xen 3.x 'vcpu_avail' setting and lifts the maxvcpus limit of
MAX_VIRT_CPUS entirely.
The patch is based on my recent series [2] removing xend config version from
the codebase.
[1] https://www.redhat.com/archives/libvir-list/2015-November/msg01155.html
[2] https://www.redhat.com/archives/libvir-list/2015-December/msg00616.html
src/xenconfig/xen_common.c | 25 +++++++++++----------
tests/xlconfigdata/test-paravirt-maxvcpus.cfg | 13 +++++++++++
tests/xlconfigdata/test-paravirt-maxvcpus.xml | 28 ++++++++++++++++++++++++
tests/xlconfigtest.c | 1 +
tests/xmconfigdata/test-paravirt-maxvcpus.cfg | 13 +++++++++++
tests/xmconfigdata/test-paravirt-maxvcpus.xml | 31 +++++++++++++++++++++++++++
tests/xmconfigdata/test-paravirt-vcpu.cfg | 4 ++--
tests/xmconfigtest.c | 1 +
8 files changed, 101 insertions(+), 15 deletions(-)
diff --git a/src/xenconfig/xen_common.c b/src/xenconfig/xen_common.c
index f3e7e18..54f5791 100644
--- a/src/xenconfig/xen_common.c
+++ b/src/xenconfig/xen_common.c
@@ -488,19 +488,22 @@ xenParseCPUFeatures(virConfPtr conf, virDomainDefPtr def)
const char *str = NULL;
int val = 0;
- if (xenConfigGetULong(conf, "vcpus", &count, 1) < 0 ||
- MAX_VIRT_CPUS < count)
+ if (xenConfigGetULong(conf, "vcpus", &count, 1) < 0)
return -1;
if (virDomainDefSetVcpusMax(def, count) < 0)
return -1;
- if (xenConfigGetULong(conf, "vcpu_avail", &count, -1) < 0)
+ if (virDomainDefSetVcpus(def, count) < 0)
return -1;
- if (virDomainDefSetVcpus(def, MIN(count_one_bits_l(count),
- virDomainDefGetVcpusMax(def))) < 0)
- return -1;
+ if (virConfGetValue(conf, "maxvcpus")) {
+ if (xenConfigGetULong(conf, "maxvcpus", &count, 0) < 0)
+ return -1;
+
+ if (virDomainDefSetVcpusMax(def, count) < 0)
+ return -1;
+ }
if (xenConfigGetString(conf, "cpus", &str, NULL) < 0)
return -1;
@@ -1494,14 +1497,10 @@ xenFormatCPUAllocation(virConfPtr conf, virDomainDefPtr def)
int ret = -1;
char *cpus = NULL;
- if (xenConfigSetInt(conf, "vcpus", virDomainDefGetVcpusMax(def)) < 0)
+ if (virDomainDefGetVcpus(def) < virDomainDefGetVcpusMax(def) &&
+ xenConfigSetInt(conf, "maxvcpus", virDomainDefGetVcpusMax(def)) < 0)
goto cleanup;
-
- /* Computing the vcpu_avail bitmask works because MAX_VIRT_CPUS is
- either 32, or 64 on a platform where long is big enough. */
- if (virDomainDefHasVcpusOffline(def) &&
- xenConfigSetInt(conf, "vcpu_avail",
- (1UL << virDomainDefGetVcpus(def)) - 1) < 0)
+ if (xenConfigSetInt(conf, "vcpus", virDomainDefGetVcpus(def)) < 0)
goto cleanup;
if ((def->cpumask != NULL) &&
diff --git a/tests/xlconfigdata/test-paravirt-maxvcpus.cfg b/tests/xlconfigdata/test-paravirt-maxvcpus.cfg
new file mode 100644
index 0000000..d506b75
--- /dev/null
+++ b/tests/xlconfigdata/test-paravirt-maxvcpus.cfg
@@ -0,0 +1,13 @@
+name = "XenGuest1"
+uuid = "45b60f51-88a9-47a8-a3b3-5e66d71b2283"
+maxmem = 512
+memory = 512
+maxvcpus = 8
+vcpus = 4
+localtime = 0
+on_poweroff = "preserve"
+on_reboot = "restart"
+on_crash = "preserve"
+vif = [ "mac=5a:36:0e:be:00:09" ]
+bootloader = "/usr/bin/pygrub"
+disk = [ "/var/lib/xen/images/debian/disk.qcow2,qcow2,xvda,w,backendtype=qdisk" ]
diff --git a/tests/xlconfigdata/test-paravirt-maxvcpus.xml b/tests/xlconfigdata/test-paravirt-maxvcpus.xml
new file mode 100644
index 0000000..2e1f8f8
--- /dev/null
+++ b/tests/xlconfigdata/test-paravirt-maxvcpus.xml
@@ -0,0 +1,28 @@
+<domain type='xen'>
+ <name>XenGuest1</name>
+ <uuid>45b60f51-88a9-47a8-a3b3-5e66d71b2283</uuid>
+ <memory unit='KiB'>524288</memory>
+ <currentMemory unit='KiB'>524288</currentMemory>
+ <vcpu placement='static' current='4'>8</vcpu>
+ <bootloader>/usr/bin/pygrub</bootloader>
+ <os>
+ <type arch='x86_64' machine='xenpv'>linux</type>
+ </os>
+ <clock offset='utc' adjustment='reset'/>
+ <on_poweroff>preserve</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>preserve</on_crash>
+ <devices>
+ <disk type='file' device='disk'>
+ <driver name='qemu' type='qcow2'/>
+ <source file='/var/lib/xen/images/debian/disk.qcow2'/>
+ <target dev='xvda' bus='xen'/>
+ </disk>
+ <interface type='ethernet'>
+ <mac address='5a:36:0e:be:00:09'/>
+ </interface>
+ <console type='pty'>
+ <target type='xen' port='0'/>
+ </console>
+ </devices>
+</domain>
diff --git a/tests/xlconfigtest.c b/tests/xlconfigtest.c
index de7f871..1db11e7 100644
--- a/tests/xlconfigtest.c
+++ b/tests/xlconfigtest.c
@@ -192,6 +192,7 @@ mymain(void)
ret = -1; \
} while (0)
+ DO_TEST("paravirt-maxvcpus");
DO_TEST("new-disk");
DO_TEST("spice");
DO_TEST("spice-features");
diff --git a/tests/xmconfigdata/test-paravirt-maxvcpus.cfg b/tests/xmconfigdata/test-paravirt-maxvcpus.cfg
new file mode 100644
index 0000000..8d1ac4d
--- /dev/null
+++ b/tests/xmconfigdata/test-paravirt-maxvcpus.cfg
@@ -0,0 +1,13 @@
+name = "XenGuest1"
+uuid = "c7a5fdb0-cdaf-9455-926a-d65c16db1809"
+maxmem = 579
+memory = 394
+maxvcpus = 4
+vcpus = 2
+localtime = 0
+on_poweroff = "destroy"
+on_reboot = "restart"
+on_crash = "restart"
+vif = [ "mac=00:16:3e:66:94:9c,bridge=br0,script=vif-bridge" ]
+bootloader = "/usr/bin/pygrub"
+disk = [ "phy:/dev/HostVG/XenGuest1,xvda,w" ]
diff --git a/tests/xmconfigdata/test-paravirt-maxvcpus.xml b/tests/xmconfigdata/test-paravirt-maxvcpus.xml
new file mode 100644
index 0000000..3b0e0ce
--- /dev/null
+++ b/tests/xmconfigdata/test-paravirt-maxvcpus.xml
@@ -0,0 +1,31 @@
+<domain type='xen'>
+ <name>XenGuest1</name>
+ <uuid>c7a5fdb0-cdaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>592896</memory>
+ <currentMemory unit='KiB'>403456</currentMemory>
+ <vcpu placement='static' current='2'>4</vcpu>
+ <bootloader>/usr/bin/pygrub</bootloader>
+ <os>
+ <type arch='i686' machine='xenpv'>linux</type>
+ </os>
+ <clock offset='utc' adjustment='reset'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>restart</on_crash>
+ <devices>
+ <disk type='block' device='disk'>
+ <driver name='phy'/>
+ <source dev='/dev/HostVG/XenGuest1'/>
+ <target dev='xvda' bus='xen'/>
+ </disk>
+ <interface type='bridge'>
+ <mac address='00:16:3e:66:94:9c'/>
+ <source bridge='br0'/>
+ <script path='vif-bridge'/>
+ </interface>
+ <console type='pty'>
+ <target type='xen' port='0'/>
+ </console>
+ <memballoon model='xen'/>
+ </devices>
+</domain>
diff --git a/tests/xmconfigdata/test-paravirt-vcpu.cfg b/tests/xmconfigdata/test-paravirt-vcpu.cfg
index 1e7765d..8d1ac4d 100644
--- a/tests/xmconfigdata/test-paravirt-vcpu.cfg
+++ b/tests/xmconfigdata/test-paravirt-vcpu.cfg
@@ -2,8 +2,8 @@ name = "XenGuest1"
uuid = "c7a5fdb0-cdaf-9455-926a-d65c16db1809"
maxmem = 579
memory = 394
-vcpus = 4
-vcpu_avail = 3
+maxvcpus = 4
+vcpus = 2
localtime = 0
on_poweroff = "destroy"
on_reboot = "restart"
diff --git a/tests/xmconfigtest.c b/tests/xmconfigtest.c
index c2084c2..3d47693 100644
--- a/tests/xmconfigtest.c
+++ b/tests/xmconfigtest.c
@@ -215,6 +215,7 @@ mymain(void)
DO_TEST("paravirt-net-e1000");
DO_TEST("paravirt-net-vifname");
DO_TEST("paravirt-vcpu");
+ DO_TEST("paravirt-maxvcpus");
DO_TEST("fullvirt-new-cdrom");
DO_TEST("fullvirt-utc");
DO_TEST("fullvirt-localtime");
--
2.1.4
8 years, 11 months
[libvirt] TSO of VM packets degardes significantly on increasing VM's on a Host
by Piyush R Srivastava1
Hi,
Problem-
Offloading for VM packets (TSO enabled in VM's ) degrades severely with
increase in VM's on a host
What is controlling the offloading of VM packets and how can we improve
it ?
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Description-
We have a testbed OpenStack deployment. We boot 1, 10 and 25 VM's on a
single compute node and start iperf traffic. ( VM's are iperf client ).
We then simultaneously do tcpdump at the veth-pair connecting the VM to the
OVS Bridges.
Tcpdump data shows that on increasing the VM's on a host, the % of
offloaded packets degrades severely
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Host configuration- 12 cores ( 24 vCPU ), 40 GB RAM
[root@rhel7-25 ~]# uname -a
Linux rhel7-25.in.ibm.com 3.10.0-229.el7.x86_64 #1 SMP Thu Jan 29 18:37:38
EST 2015 x86_64 x86_64 x86_64 GNU/Linux
VM MTU is set to 1450
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Analysis-
------------------------------------------------------------------------------------
| VMs | % Non-Offloaded packets |
|-----------------------------------------------------------------------------------|
| 1 | 11.11% |
| 10 | 71.78% |
| 25 | 80.44% |
|-----------------------|-----------------------------------------------------------|
Thus we see significant degradation in offloaded packets when 10 and 25
VM's are sending iperf data simultaneously. ( TSO enabled VM's )
Non-Offloaded packets means Ethernet Frame of size 1464 ( VM MTU is 1450 )
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Tcpdump details-
Iperf Server IP- 1.1.1.34
For 1 VM, we see majority offloaded packets-
[piyush@rhel7-34 25]$ cat qvoed7aa38d-22.log | grep "> 1.1.1.34.5001" |
head -n 30
14:36:26.331073 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 74:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 0
14:36:26.331917 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 66:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 0
14:36:26.331946 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 90:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 24
14:36:26.331977 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 7056:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 6990
14:36:26.332018 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 5658:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 5592
14:36:26.332527 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 7056:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 6990
14:36:26.332560 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 9852:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 9786
14:36:26.333024 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 8454:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 8388
14:36:26.333054 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 7056:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 6990
14:36:26.333076 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 4260:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 4194
14:36:26.333530 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 16842:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 16776
14:36:26.333568 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 4260:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 4194
14:36:26.333886 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 21036:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 20970
14:36:26.333925 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 2862:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 2796
14:36:26.334303 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 21036:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 20970
14:36:26.334349 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 2862:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 2796
14:36:26.334741 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 22434:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 22368
14:36:26.335118 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 25230:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 25164
14:36:26.335566 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 25230:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 25164
14:36:26.336007 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 23832:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 23766
14:36:26.336050 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 2862:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 2796
14:36:26.336453 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 26628:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 26562
14:36:26.336898 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 22434:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 22368
14:36:26.336941 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 5658:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 5592
14:36:26.337235 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 23832:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 23766
14:36:26.337603 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 21036:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 20970
14:36:26.337644 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 8454:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 8388
14:36:26.337987 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 18240:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 18174
14:36:26.338040 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 12648:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 12582
14:36:26.338356 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 14046:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 13980
For 20 VM's, we see reduction is size of offloaded packets. Tcpdump for one
of the 10 VM's-
[piyush@rhel7-34 25]$ cat qvo255d8cdd-90.log | grep "> 1.1.1.34.5001" |
head -n 30
15:09:25.024790 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 74:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 0
15:09:25.026834 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 66:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 0
15:09:25.026870 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 90:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 24
15:09:25.027186 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 7056:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 6990
15:09:25.027213 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 5658:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 5592
15:09:25.032500 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 5658:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 5592
15:09:25.032539 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 1464:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 1398
15:09:25.032567 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 7056:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 6990
15:09:25.035122 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 7056:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 6990
15:09:25.035631 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 7056:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 6990
15:09:25.035661 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 7056:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 6990
15:09:25.038508 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 7056:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 6990
15:09:25.038904 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 7056:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 6990
15:09:25.039300 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 7056:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 6990
15:09:25.040740 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 4260:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 4194
15:09:25.040774 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 2862:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 2796
15:09:25.040995 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 7056:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 6990
15:09:25.041235 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 7056:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 6990
15:09:25.042599 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 7056:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 6990
15:09:25.043209 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 7056:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 6990
15:09:25.043592 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 7056:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 6990
15:09:25.044312 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 7056:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 6990
15:09:25.044551 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 7056:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 6990
15:09:25.045232 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 7056:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 6990
15:09:25.045251 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 7056:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 6990
15:09:25.049951 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 5658:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 5592
15:09:25.049977 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 1464:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 1398
15:09:25.049996 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 7056:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 6990
15:09:25.050020 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 2862:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 2796
15:09:25.050039 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 4260:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 4194
For 25 VM's, we hardly see very less offloaded packets. Tcpdump for one of
the 25 VM's-
15:52:31.543613 fa:16:3e:3c:7d:78 > fa:16:3e:aa:af:d5, IPv4, length 1464:
10.20.10.3.45892 > 1.1.1.34.5001: tcp 1398
15:52:31.543637 fa:16:3e:3c:7d:78 > fa:16:3e:aa:af:d5, IPv4, length 2862:
10.20.10.3.45892 > 1.1.1.34.5001: tcp 2796
15:52:31.543957 fa:16:3e:3c:7d:78 > fa:16:3e:aa:af:d5, IPv4, length 2862:
10.20.10.3.45892 > 1.1.1.34.5001: tcp 2796
15:52:31.544090 fa:16:3e:3c:7d:78 > fa:16:3e:aa:af:d5, IPv4, length 4260:
10.20.10.3.45892 > 1.1.1.34.5001: tcp 4194
15:52:31.544272 fa:16:3e:3c:7d:78 > fa:16:3e:aa:af:d5, IPv4, length 1464:
10.20.10.3.45892 > 1.1.1.34.5001: tcp 1398
15:52:31.544296 fa:16:3e:3c:7d:78 > fa:16:3e:aa:af:d5, IPv4, length 1464:
10.20.10.3.45892 > 1.1.1.34.5001: tcp 1398
15:52:31.544316 fa:16:3e:3c:7d:78 > fa:16:3e:aa:af:d5, IPv4, length 1464:
10.20.10.3.45892 > 1.1.1.34.5001: tcp 1398
15:52:31.544340 fa:16:3e:3c:7d:78 > fa:16:3e:aa:af:d5, IPv4, length 1464:
10.20.10.3.45892 > 1.1.1.34.5001: tcp 1398
15:52:31.545034 fa:16:3e:3c:7d:78 > fa:16:3e:aa:af:d5, IPv4, length 1464:
10.20.10.3.45892 > 1.1.1.34.5001: tcp 1398
15:52:31.545066 fa:16:3e:3c:7d:78 > fa:16:3e:aa:af:d5, IPv4, length 5658:
10.20.10.3.45892 > 1.1.1.34.5001: tcp 5592
15:52:31.545474 fa:16:3e:3c:7d:78 > fa:16:3e:aa:af:d5, IPv4, length 1464:
10.20.10.3.45892 > 1.1.1.34.5001: tcp 1398
15:52:31.545501 fa:16:3e:3c:7d:78 > fa:16:3e:aa:af:d5, IPv4, length 2862:
10.20.10.3.45892 > 1.1.1.34.5001: tcp 2796
15:52:31.545539 fa:16:3e:3c:7d:78 > fa:16:3e:aa:af:d5, IPv4, length 2862:
10.20.10.3.45892 > 1.1.1.34.5001: tcp 2796
15:52:31.545572 fa:16:3e:3c:7d:78 > fa:16:3e:aa:af:d5, IPv4, length 7056:
10.20.10.3.45892 > 1.1.1.34.5001: tcp 6990
15:52:31.545736 fa:16:3e:3c:7d:78 > fa:16:3e:aa:af:d5, IPv4, length 1464:
10.20.10.3.45892 > 1.1.1.34.5001: tcp 1398
15:52:31.545807 fa:16:3e:3c:7d:78 > fa:16:3e:aa:af:d5, IPv4, length 1464:
10.20.10.3.45892 > 1.1.1.34.5001: tcp 1398
15:52:31.545813 fa:16:3e:3c:7d:78 > fa:16:3e:aa:af:d5, IPv4, length 1464:
10.20.10.3.45892 > 1.1.1.34.5001: tcp 1398
15:52:31.545934 fa:16:3e:3c:7d:78 > fa:16:3e:aa:af:d5, IPv4, length 1464:
10.20.10.3.45892 > 1.1.1.34.5001: tcp 1398
15:52:31.545956 fa:16:3e:3c:7d:78 > fa:16:3e:aa:af:d5, IPv4, length 1464:
10.20.10.3.45892 > 1.1.1.34.5001: tcp 1398
15:52:31.545974 fa:16:3e:3c:7d:78 > fa:16:3e:aa:af:d5, IPv4, length 1464:
10.20.10.3.45892 > 1.1.1.34.5001: tcp 1398
15:52:31.546012 fa:16:3e:3c:7d:78 > fa:16:3e:aa:af:d5, IPv4, length 1464:
10.20.10.3.45892 > 1.1.1.34.5001: tcp 1398
Thanks and regards,
Piyush Raman
Mail: pirsriva(a)in.ibm.com
8 years, 11 months
[libvirt] TSO of VM packets degardes significantly on increasing VM's on a Host
by Piyush R Srivastava1
Hi,
Problem-
Offloading for VM packets (TSO enabled in VM's ) degrades severely with
increase in VM's on a host
What is controlling the offloading of VM packets and how can we improve
it ?
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Description-
We have a testbed OpenStack deployment. We boot 1, 10 and 25 VM's on a
single compute node and start iperf traffic. ( VM's are iperf client ).
We then simultaneously do tcpdump at the veth-pair connecting the VM to the
OVS Bridges.
Tcpdump data shows that on increasing the VM's on a host, the % of
offloaded packets degrades severely
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Host configuration- 12 cores ( 24 vCPU ), 40 GB RAM
[root@rhel7-25 ~]# uname -a
Linux rhel7-25.in.ibm.com 3.10.0-229.el7.x86_64 #1 SMP Thu Jan 29 18:37:38
EST 2015 x86_64 x86_64 x86_64 GNU/Linux
VM MTU is set to 1450
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Analysis-
------------------------------------------------------------------------------------
| VMs | % Non-Offloaded packets |
|-----------------------------------------------------------------------------------|
| 1 | 11.11% |
| 10 | 71.78% |
| 25 | 80.44% |
|-----------------------|-----------------------------------------------------------|
Thus we see significant degradation in offloaded packets when 10 and 25
VM's are sending iperf data simultaneously. ( TSO enabled VM's )
Non-Offloaded packets means Ethernet Frame of size 1464 ( VM MTU is 1450 )
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Tcpdump details-
Iperf Server IP- 1.1.1.34
For 1 VM, we see majority offloaded packets-
[piyush@rhel7-34 25]$ cat qvoed7aa38d-22.log | grep "> 1.1.1.34.5001" |
head -n 30
14:36:26.331073 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 74:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 0
14:36:26.331917 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 66:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 0
14:36:26.331946 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 90:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 24
14:36:26.331977 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 7056:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 6990
14:36:26.332018 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 5658:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 5592
14:36:26.332527 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 7056:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 6990
14:36:26.332560 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 9852:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 9786
14:36:26.333024 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 8454:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 8388
14:36:26.333054 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 7056:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 6990
14:36:26.333076 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 4260:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 4194
14:36:26.333530 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 16842:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 16776
14:36:26.333568 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 4260:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 4194
14:36:26.333886 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 21036:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 20970
14:36:26.333925 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 2862:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 2796
14:36:26.334303 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 21036:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 20970
14:36:26.334349 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 2862:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 2796
14:36:26.334741 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 22434:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 22368
14:36:26.335118 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 25230:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 25164
14:36:26.335566 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 25230:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 25164
14:36:26.336007 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 23832:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 23766
14:36:26.336050 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 2862:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 2796
14:36:26.336453 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 26628:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 26562
14:36:26.336898 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 22434:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 22368
14:36:26.336941 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 5658:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 5592
14:36:26.337235 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 23832:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 23766
14:36:26.337603 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 21036:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 20970
14:36:26.337644 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 8454:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 8388
14:36:26.337987 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 18240:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 18174
14:36:26.338040 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 12648:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 12582
14:36:26.338356 fa:16:3e:98:41:8b > fa:16:3e:ef:5f:16, IPv4, length 14046:
10.20.7.3.50395 > 1.1.1.34.5001: tcp 13980
For 20 VM's, we see reduction is size of offloaded packets. Tcpdump for one
of the 10 VM's-
[piyush@rhel7-34 25]$ cat qvo255d8cdd-90.log | grep "> 1.1.1.34.5001" |
head -n 30
15:09:25.024790 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 74:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 0
15:09:25.026834 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 66:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 0
15:09:25.026870 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 90:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 24
15:09:25.027186 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 7056:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 6990
15:09:25.027213 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 5658:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 5592
15:09:25.032500 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 5658:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 5592
15:09:25.032539 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 1464:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 1398
15:09:25.032567 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 7056:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 6990
15:09:25.035122 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 7056:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 6990
15:09:25.035631 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 7056:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 6990
15:09:25.035661 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 7056:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 6990
15:09:25.038508 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 7056:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 6990
15:09:25.038904 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 7056:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 6990
15:09:25.039300 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 7056:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 6990
15:09:25.040740 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 4260:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 4194
15:09:25.040774 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 2862:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 2796
15:09:25.040995 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 7056:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 6990
15:09:25.041235 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 7056:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 6990
15:09:25.042599 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 7056:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 6990
15:09:25.043209 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 7056:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 6990
15:09:25.043592 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 7056:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 6990
15:09:25.044312 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 7056:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 6990
15:09:25.044551 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 7056:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 6990
15:09:25.045232 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 7056:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 6990
15:09:25.045251 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 7056:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 6990
15:09:25.049951 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 5658:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 5592
15:09:25.049977 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 1464:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 1398
15:09:25.049996 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 7056:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 6990
15:09:25.050020 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 2862:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 2796
15:09:25.050039 fa:16:3e:b9:f8:ec > fa:16:3e:c1:de:cc, IPv4, length 4260:
10.20.18.3.36798 > 1.1.1.34.5001: tcp 4194
For 25 VM's, we hardly see very less offloaded packets. Tcpdump for one of
the 25 VM's-
15:52:31.543613 fa:16:3e:3c:7d:78 > fa:16:3e:aa:af:d5, IPv4, length 1464:
10.20.10.3.45892 > 1.1.1.34.5001: tcp 1398
15:52:31.543637 fa:16:3e:3c:7d:78 > fa:16:3e:aa:af:d5, IPv4, length 2862:
10.20.10.3.45892 > 1.1.1.34.5001: tcp 2796
15:52:31.543957 fa:16:3e:3c:7d:78 > fa:16:3e:aa:af:d5, IPv4, length 2862:
10.20.10.3.45892 > 1.1.1.34.5001: tcp 2796
15:52:31.544090 fa:16:3e:3c:7d:78 > fa:16:3e:aa:af:d5, IPv4, length 4260:
10.20.10.3.45892 > 1.1.1.34.5001: tcp 4194
15:52:31.544272 fa:16:3e:3c:7d:78 > fa:16:3e:aa:af:d5, IPv4, length 1464:
10.20.10.3.45892 > 1.1.1.34.5001: tcp 1398
15:52:31.544296 fa:16:3e:3c:7d:78 > fa:16:3e:aa:af:d5, IPv4, length 1464:
10.20.10.3.45892 > 1.1.1.34.5001: tcp 1398
15:52:31.544316 fa:16:3e:3c:7d:78 > fa:16:3e:aa:af:d5, IPv4, length 1464:
10.20.10.3.45892 > 1.1.1.34.5001: tcp 1398
15:52:31.544340 fa:16:3e:3c:7d:78 > fa:16:3e:aa:af:d5, IPv4, length 1464:
10.20.10.3.45892 > 1.1.1.34.5001: tcp 1398
15:52:31.545034 fa:16:3e:3c:7d:78 > fa:16:3e:aa:af:d5, IPv4, length 1464:
10.20.10.3.45892 > 1.1.1.34.5001: tcp 1398
15:52:31.545066 fa:16:3e:3c:7d:78 > fa:16:3e:aa:af:d5, IPv4, length 5658:
10.20.10.3.45892 > 1.1.1.34.5001: tcp 5592
15:52:31.545474 fa:16:3e:3c:7d:78 > fa:16:3e:aa:af:d5, IPv4, length 1464:
10.20.10.3.45892 > 1.1.1.34.5001: tcp 1398
15:52:31.545501 fa:16:3e:3c:7d:78 > fa:16:3e:aa:af:d5, IPv4, length 2862:
10.20.10.3.45892 > 1.1.1.34.5001: tcp 2796
15:52:31.545539 fa:16:3e:3c:7d:78 > fa:16:3e:aa:af:d5, IPv4, length 2862:
10.20.10.3.45892 > 1.1.1.34.5001: tcp 2796
15:52:31.545572 fa:16:3e:3c:7d:78 > fa:16:3e:aa:af:d5, IPv4, length 7056:
10.20.10.3.45892 > 1.1.1.34.5001: tcp 6990
15:52:31.545736 fa:16:3e:3c:7d:78 > fa:16:3e:aa:af:d5, IPv4, length 1464:
10.20.10.3.45892 > 1.1.1.34.5001: tcp 1398
15:52:31.545807 fa:16:3e:3c:7d:78 > fa:16:3e:aa:af:d5, IPv4, length 1464:
10.20.10.3.45892 > 1.1.1.34.5001: tcp 1398
15:52:31.545813 fa:16:3e:3c:7d:78 > fa:16:3e:aa:af:d5, IPv4, length 1464:
10.20.10.3.45892 > 1.1.1.34.5001: tcp 1398
15:52:31.545934 fa:16:3e:3c:7d:78 > fa:16:3e:aa:af:d5, IPv4, length 1464:
10.20.10.3.45892 > 1.1.1.34.5001: tcp 1398
15:52:31.545956 fa:16:3e:3c:7d:78 > fa:16:3e:aa:af:d5, IPv4, length 1464:
10.20.10.3.45892 > 1.1.1.34.5001: tcp 1398
15:52:31.545974 fa:16:3e:3c:7d:78 > fa:16:3e:aa:af:d5, IPv4, length 1464:
10.20.10.3.45892 > 1.1.1.34.5001: tcp 1398
15:52:31.546012 fa:16:3e:3c:7d:78 > fa:16:3e:aa:af:d5, IPv4, length 1464:
10.20.10.3.45892 > 1.1.1.34.5001: tcp 1398
Thanks and regards,
Piyush Raman
Mail: pirsriva(a)in.ibm.com
8 years, 11 months
[libvirt] [PATCH 0/2] 'deflate-on-oom' attribute for mememory balloon
by Dmitry Andreev
This patch-set adds support for the new feature that has
been added to the QEMU virtio memory balloon a month ago.
This feature lets a guest OS deflate balloon on OOM.
With 'deflate-on-oom' enabled virtio balloon will release
it's memory if possible right before an OOM termination of
processes.
QEMU commit with the complete feature description:
http://git.qemu.org/?p=qemu.git;a=commit;h=e3816255bf4b6377bb405331e2ee0d...
Dmitry Andreev (2):
conf: introduce 'deflate-on-oom' attribute for memballoon device
qemu: add support of optional 'deflate-on-oom' attribute
docs/formatdomain.html.in | 10 +++++++++
docs/schemas/domaincommon.rng | 5 +++++
src/conf/domain_conf.c | 23 ++++++++++++++++++++
src/conf/domain_conf.h | 1 +
src/qemu/qemu_command.c | 4 ++++
.../qemuxml2argv-balloon-device-deflate-off.args | 23 ++++++++++++++++++++
.../qemuxml2argv-balloon-device-deflate-off.xml | 25 ++++++++++++++++++++++
.../qemuxml2argv-balloon-device-deflate.args | 23 ++++++++++++++++++++
.../qemuxml2argv-balloon-device-deflate.xml | 25 ++++++++++++++++++++++
tests/qemuxml2argvtest.c | 4 ++++
10 files changed, 143 insertions(+)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-balloon-device-deflate-off.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-balloon-device-deflate-off.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-balloon-device-deflate.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-balloon-device-deflate.xml
--
1.8.3.1
8 years, 11 months
[libvirt] [libvirt-perl][PATCH] Add VIR_STORAGE_POOL_CREATE_* constants
by Michal Privoznik
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
Changes | 4 +++-
Virt.xs | 5 +++++
lib/Sys/Virt/StoragePool.pm | 28 ++++++++++++++++++++++++++++
3 files changed, 36 insertions(+), 1 deletion(-)
diff --git a/Changes b/Changes
index 0b3e659..05643b5 100644
--- a/Changes
+++ b/Changes
@@ -2,7 +2,9 @@ Revision history for perl module Sys::Virt
1.3.1 2015-12-00
- - XXX
+ - Add VIR_STORAGE_POOL_CREATE_NORMAL, VIR_STORAGE_POOL_CREATE_WITH_BUILD,
+ VIR_STORAGE_POOL_CREATE_WITH_BUILD_OVERWRITE and
+ VIR_STORAGE_POOL_CREATE_WITH_BUILD_NO_OVERWRITE constants
1.3.0 2015-12-10
diff --git a/Virt.xs b/Virt.xs
index db04fc2..4e28887 100644
--- a/Virt.xs
+++ b/Virt.xs
@@ -8026,6 +8026,11 @@ BOOT:
REGISTER_CONSTANT(VIR_STORAGE_POOL_BUILD_NO_OVERWRITE, BUILD_NO_OVERWRITE);
REGISTER_CONSTANT(VIR_STORAGE_POOL_BUILD_OVERWRITE, BUILD_OVERWRITE);
+ REGISTER_CONSTANT(VIR_STORAGE_POOL_CREATE_NORMAL, CREATE_NORMAL);
+ REGISTER_CONSTANT(VIR_STORAGE_POOL_CREATE_WITH_BUILD, CREATE_WITH_BUILD);
+ REGISTER_CONSTANT(VIR_STORAGE_POOL_CREATE_WITH_BUILD_OVERWRITE, CREATE_WITH_BUILD_OVERWRITE);
+ REGISTER_CONSTANT(VIR_STORAGE_POOL_CREATE_WITH_BUILD_NO_OVERWRITE, CREATE_WITH_BUILD_NO_OVERWRITE);
+
REGISTER_CONSTANT(VIR_STORAGE_POOL_DELETE_NORMAL, DELETE_NORMAL);
REGISTER_CONSTANT(VIR_STORAGE_POOL_DELETE_ZEROED, DELETE_ZEROED);
diff --git a/lib/Sys/Virt/StoragePool.pm b/lib/Sys/Virt/StoragePool.pm
index 7572d62..5fd6acc 100644
--- a/lib/Sys/Virt/StoragePool.pm
+++ b/lib/Sys/Virt/StoragePool.pm
@@ -355,6 +355,34 @@ Overwrite existing storage pool data
=back
+=head2 CREATE MODES
+
+When creating a storage pool it can be built at the same time.
+The following values are therefore close to their BUILD
+counterparts.
+
+=over 4
+
+=item Sys::Virt::StoragePool::CREATE_NORMAL
+
+Just create the storage pool without building it.
+
+=item Sys::Virt::StoragePool::CREATE_WITH_BUILD
+
+When creating new storage pool also perform pool build without any flags.
+
+=item Sys::Virt::StoragePool::CREATE_WITH_BUILD_OVERWRITE
+
+Create the pool and perform pool build using the BUILD_OVERWRITE
+flag. This is mutually exclusive to CREATE_WITH_BUILD_NO_OVERWRITE.
+
+=item Sys::Virt::StoragePool::CREATE_WITH_BUILD_NO_OVERWRITE
+
+Create the pool and perform pool build using the BUILD_NO_OVERWRITE
+flag. This is mutually exclusive to CREATE_WITH_BUILD_OVERWRITE.
+
+=back
+
=head2 XML DOCUMENTS
The following constants are useful when requesting
--
2.4.10
8 years, 11 months
[libvirt] [PATCH] lxc_cgroup: Add check for NULL cgroup before AddTask call
by John Ferlan
Commit id '71ce4759' altered the cgroup processing with respect to the
call to virCgroupAddTask being moved out from lower layers into the calling
layers especially for qemu processing of emulator and vcpu threads. The
movement affected lxc insomuch as it is possible for a code path to
return a NULL cgroup *and* a 0 return status via virCgroupNewPartition
failure when virCgroupNewIgnoreError succeeded when virCgroupNewMachineManual
returns. Coverity pointed out that would cause virCgroupAddTask to core.
This patch will check for a NULL cgroup as well as the negative return
and just return the NULL cgroup to the caller (as it would have previously)
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
src/lxc/lxc_cgroup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lxc/lxc_cgroup.c b/src/lxc/lxc_cgroup.c
index 609e9ea..ef332e3 100644
--- a/src/lxc/lxc_cgroup.c
+++ b/src/lxc/lxc_cgroup.c
@@ -501,7 +501,7 @@ virCgroupPtr virLXCCgroupCreate(virDomainDefPtr def,
nnicindexes, nicindexes,
def->resource->partition,
-1,
- &cgroup) < 0)
+ &cgroup) < 0 || !cgroup)
goto cleanup;
if (virCgroupAddTask(cgroup, initpid) < 0) {
--
2.5.0
8 years, 11 months
[libvirt] [PATCH 0/8] Use macros for more common virsh command options
by John Ferlan
As a follow on to a recent series which created macros for various
virsh-*.c command options, see:
http://www.redhat.com/archives/libvir-list/2015-December/msg00672.html
(although best to view by index since there are varying opinions on
the matter)...
Modify virsh-domain.c and virsh-volume.c to "follow" the concept of
macro-ifying some commonly used options. In order to choose, I used:
$ grep "{.name =" tools/virsh-*.c | \
grep -v "help" | grep -v "desc" | grep -v NULL | \
sort -i | uniq -c | sort -n
To generate a list by module. That generated a list where I randomly
picked 9 as the nexus, leaving the following:
9 tools/virsh-domain.c: {.name = "persistent",
10 tools/virsh-snapshot.c: {.name = "domain",
12 tools/virsh-network.c: {.name = "network",
12 tools/virsh-pool.c: {.name = "pool",
13 tools/virsh-volume.c: {.name = "vol",
14 tools/virsh-domain.c: {.name = "file",
14 tools/virsh-domain-monitor.c: {.name = "domain",
14 tools/virsh-volume.c: {.name = "pool",
26 tools/virsh-domain.c: {.name = "current",
28 tools/virsh-domain.c: {.name = "config",
28 tools/virsh-domain.c: {.name = "live",
81 tools/virsh-domain.c: {.name = "domain",
Because virsh-domain-monitor.c, virsh-network.c, and virsh-snapshot.c
only had one element with larger counts - I just left them as is and
focused on the virsh-domain.c and virsh-volume.c.
The perhaps more controversial choice will be the "file" option in
virsh-domain.c which had numerous different helpstr values. I chose
to macro-ify them using the entire helpstr including the N_("xxx")
rather than just "xxx" since the N_ is the I18N marker.
John Ferlan (8):
virsh: Create macro for common "domain" option
virsh: Create macro for common "persistent" option
virsh: Create macro for common "config" option
virsh: Create macro for common "live" option
virsh: Create macro for common "current" option
virsh: Create macro for common "file" option
virsh: Create macros for common "pool" options
virsh: Create macros for common "vol" options
tools/virsh-domain.c | 918 +++++++++++----------------------------------------
tools/virsh-volume.c | 155 +++------
2 files changed, 247 insertions(+), 826 deletions(-)
--
2.5.0
8 years, 11 months
[libvirt] [PATCH 0/3] Add delete-snapshots option to virsh commands
by John Ferlan
Commit id '3c7590e0' added the ability to delete snapshots for rbd backends,
but did not provide the virsh commands in order to handle that option.
The first two patches fix a couple of minor nits - not using virCheckFlags
in virStorageBackendRBDDeleteVol even though the flags are used. Also,
the virStorageVolDeleteFlags did not document the possible flags. Added
the reference for the API.
The third patch is the meat where the --delete-snapshots flag to virsh
commands 'undefine' and 'vol-delete' was added and handled.
cc'd author of '3c7590e0' - hopefully this series could be applied and
tested in a "real" environment.
John Ferlan (3):
storage: Add virCheckFlags to virStorageBackendRBDDeleteVol
libvirt: Add virStorageVolDeleteFlags to virStorageVolDelete
virsh: Add --delete-snapshots flag for undefine and vol-delete
src/libvirt-storage.c | 2 +-
src/storage/storage_backend_rbd.c | 3 +++
tools/virsh-domain.c | 14 +++++++++++++-
tools/virsh-volume.c | 12 +++++++++++-
tools/virsh.pod | 14 +++++++++++++-
5 files changed, 41 insertions(+), 4 deletions(-)
--
2.5.0
8 years, 11 months