[libvirt] [PATCH] esx: Improve object-by-type lookup performance
by Matthias Bolte
Instead of using one big traversal spec for lookup use a set of
more fine grained traversal specs that are selected based on the
actual needs of the lookup.
This gives up to 20% speedup for certain operations like domain
listing due to less HTTP(S) traffic.
---
src/esx/esx_driver.c | 1 -
src/esx/esx_vi.c | 223 +++++++++++++++++++++++++-------------------------
src/esx/esx_vi.h | 16 ++--
3 files changed, 121 insertions(+), 119 deletions(-)
diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c
index c6bd3b8..9fef1df 100644
--- a/src/esx/esx_driver.c
+++ b/src/esx/esx_driver.c
@@ -3734,7 +3734,6 @@ esxNodeGetFreeMemory(virConnectPtr conn)
esxVI_LookupObjectContentByType(priv->primary,
priv->primary->computeResource->resourcePool,
"ResourcePool", propertyNameList,
- esxVI_Boolean_False,
&resourcePool) < 0) {
goto cleanup;
}
diff --git a/src/esx/esx_vi.c b/src/esx/esx_vi.c
index 3773a5f..b531798 100644
--- a/src/esx/esx_vi.c
+++ b/src/esx/esx_vi.c
@@ -104,8 +104,12 @@ ESX_VI__TEMPLATE__FREE(Context,
esxVI_Datacenter_Free(&item->datacenter);
esxVI_ComputeResource_Free(&item->computeResource);
esxVI_HostSystem_Free(&item->hostSystem);
- esxVI_SelectionSpec_Free(&item->fullTraversalSpecList);
- esxVI_SelectionSpec_Free(&item->fullTraversalSpecList2);
+ esxVI_SelectionSpec_Free(&item->selectSet_folderToChildEntity);
+ esxVI_SelectionSpec_Free(&item->selectSet_hostSystemToParent);
+ esxVI_SelectionSpec_Free(&item->selectSet_hostSystemToVm);
+ esxVI_SelectionSpec_Free(&item->selectSet_hostSystemToDatastore);
+ esxVI_SelectionSpec_Free(&item->selectSet_computeResourceToHost);
+ esxVI_SelectionSpec_Free(&item->selectSet_computeResourceToParentToParent);
});
static size_t
@@ -450,23 +454,7 @@ esxVI_Context_Connect(esxVI_Context *ctx, const char *url,
}
if (esxVI_Login(ctx, username, password, NULL, &ctx->session) < 0 ||
- esxVI_BuildFullTraversalSpecList(&ctx->fullTraversalSpecList) < 0) {
- return -1;
- }
-
- /* Folder -> parent (Folder, Datacenter) */
- if (esxVI_BuildFullTraversalSpecItem(&ctx->fullTraversalSpecList2,
- "managedEntityToParent",
- "ManagedEntity", "parent",
- NULL) < 0) {
- return -1;
- }
-
- /* ComputeResource -> parent (Folder) */
- if (esxVI_BuildFullTraversalSpecItem(&ctx->fullTraversalSpecList2,
- "computeResourceToParent",
- "ComputeResource", "parent",
- "managedEntityToParent\0") < 0) {
+ esxVI_BuildSelectSetCollection(ctx) < 0) {
return -1;
}
@@ -495,7 +483,6 @@ esxVI_Context_LookupObjectsByPath(esxVI_Context *ctx,
"hostFolder\0") < 0 ||
esxVI_LookupObjectContentByType(ctx, ctx->service->rootFolder,
"Datacenter", propertyNameList,
- esxVI_Boolean_True,
&datacenterList) < 0) {
goto cleanup;
}
@@ -545,7 +532,6 @@ esxVI_Context_LookupObjectsByPath(esxVI_Context *ctx,
"resourcePool\0") < 0 ||
esxVI_LookupObjectContentByType(ctx, ctx->datacenter->hostFolder,
"ComputeResource", propertyNameList,
- esxVI_Boolean_True,
&computeResourceList) < 0) {
goto cleanup;
}
@@ -607,7 +593,6 @@ esxVI_Context_LookupObjectsByPath(esxVI_Context *ctx,
"name\0") < 0 ||
esxVI_LookupObjectContentByType(ctx, ctx->computeResource->_reference,
"HostSystem", propertyNameList,
- esxVI_Boolean_True,
&hostSystemList) < 0) {
goto cleanup;
}
@@ -684,7 +669,7 @@ esxVI_Context_LookupObjectsByHostSystemIp(esxVI_Context *ctx,
&managedObjectReference) < 0 ||
esxVI_LookupObjectContentByType(ctx, managedObjectReference,
"HostSystem", propertyNameList,
- esxVI_Boolean_False, &hostSystem) < 0) {
+ &hostSystem) < 0) {
goto cleanup;
}
@@ -708,7 +693,6 @@ esxVI_Context_LookupObjectsByHostSystemIp(esxVI_Context *ctx,
"resourcePool\0") < 0 ||
esxVI_LookupObjectContentByType(ctx, hostSystem->obj,
"ComputeResource", propertyNameList,
- esxVI_Boolean_True,
&computeResource) < 0) {
goto cleanup;
}
@@ -733,14 +717,6 @@ esxVI_Context_LookupObjectsByHostSystemIp(esxVI_Context *ctx,
"hostFolder\0") < 0 ||
esxVI_LookupObjectContentByType(ctx, computeResource->obj,
"Datacenter", propertyNameList,
- /* FIXME: Passing Undefined here is a hack until
- * esxVI_LookupObjectContentByType supports more
- * fine grained traversal configuration. Looking
- * up the Datacenter from the ComputeResource
- * requiers an upward search. Putting this in the
- * list with the other downward traversal rules
- * would result in cyclic searching */
- esxVI_Boolean_Undefined,
&datacenter) < 0) {
goto cleanup;
}
@@ -1406,15 +1382,15 @@ esxVI_Alloc(void **ptrptr, size_t size)
int
-esxVI_BuildFullTraversalSpecItem(esxVI_SelectionSpec **fullTraversalSpecList,
- const char *name, const char *type,
- const char *path, const char *selectSetNames)
+esxVI_BuildSelectSet(esxVI_SelectionSpec **selectSet,
+ const char *name, const char *type,
+ const char *path, const char *selectSetNames)
{
esxVI_TraversalSpec *traversalSpec = NULL;
esxVI_SelectionSpec *selectionSpec = NULL;
const char *currentSelectSetName = NULL;
- if (fullTraversalSpecList == NULL) {
+ if (selectSet == NULL || *selectSet != NULL) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
return -1;
}
@@ -1445,7 +1421,7 @@ esxVI_BuildFullTraversalSpecItem(esxVI_SelectionSpec **fullTraversalSpecList,
}
}
- if (esxVI_SelectionSpec_AppendToList(fullTraversalSpecList,
+ if (esxVI_SelectionSpec_AppendToList(selectSet,
esxVI_SelectionSpec_DynamicCast
(traversalSpec)) < 0) {
goto failure;
@@ -1461,86 +1437,87 @@ esxVI_BuildFullTraversalSpecItem(esxVI_SelectionSpec **fullTraversalSpecList,
}
-
int
-esxVI_BuildFullTraversalSpecList(esxVI_SelectionSpec **fullTraversalSpecList)
+esxVI_BuildSelectSetCollection(esxVI_Context *ctx)
{
- if (fullTraversalSpecList == NULL || *fullTraversalSpecList != NULL) {
- ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
- return -1;
- }
-
/* Folder -> childEntity (ManagedEntity) */
- if (esxVI_BuildFullTraversalSpecItem(fullTraversalSpecList,
- "folderToChildEntity",
- "Folder", "childEntity",
- "folderToChildEntity\0") < 0) {
- goto failure;
+ if (esxVI_BuildSelectSet(&ctx->selectSet_folderToChildEntity,
+ "folderToChildEntity",
+ "Folder", "childEntity",
+ "folderToChildEntity\0") < 0) {
+ return -1;
}
/* ComputeResource -> host (HostSystem) */
- if (esxVI_BuildFullTraversalSpecItem(fullTraversalSpecList,
- "computeResourceToHost",
- "ComputeResource", "host",
- NULL) < 0) {
- goto failure;
+ if (esxVI_BuildSelectSet(&ctx->selectSet_computeResourceToHost,
+ "computeResourceToHost",
+ "ComputeResource", "host", NULL) < 0) {
+ return -1;
}
- /* ComputeResource -> datastore (Datastore) */
- if (esxVI_BuildFullTraversalSpecItem(fullTraversalSpecList,
- "computeResourceToDatastore",
- "ComputeResource", "datastore",
- NULL) < 0) {
- goto failure;
- }
+ /* ComputeResource -> datastore (Datastore) *//*
+ if (esxVI_BuildSelectSet(&ctx->selectSet_computeResourceToDatastore,
+ "computeResourceToDatastore",
+ "ComputeResource", "datastore", NULL) < 0) {
+ return -1;
+ }*/
- /* ResourcePool -> resourcePool (ResourcePool) */
- if (esxVI_BuildFullTraversalSpecItem(fullTraversalSpecList,
- "resourcePoolToResourcePool",
- "ResourcePool", "resourcePool",
- "resourcePoolToResourcePool\0"
- "resourcePoolToVm\0") < 0) {
- goto failure;
- }
+ /* ResourcePool -> resourcePool (ResourcePool) *//*
+ if (esxVI_BuildSelectSet(&ctx->selectSet_resourcePoolToVm,
+ "resourcePoolToResourcePool",
+ "ResourcePool", "resourcePool",
+ "resourcePoolToResourcePool\0"
+ "resourcePoolToVm\0") < 0) {
+ return -1;
+ }*/
- /* ResourcePool -> vm (VirtualMachine) */
- if (esxVI_BuildFullTraversalSpecItem(fullTraversalSpecList,
- "resourcePoolToVm",
- "ResourcePool", "vm", NULL) < 0) {
- goto failure;
- }
+ /* ResourcePool -> vm (VirtualMachine) *//*
+ if (esxVI_BuildSelectSet(&ctx->selectSet_resourcePoolToVm,
+ "resourcePoolToVm",
+ "ResourcePool", "vm", NULL) < 0) {
+ return -1;
+ }*/
/* HostSystem -> parent (ComputeResource) */
- if (esxVI_BuildFullTraversalSpecItem(fullTraversalSpecList,
- "hostSystemToParent",
- "HostSystem", "parent", NULL) < 0) {
- goto failure;
+ if (esxVI_BuildSelectSet(&ctx->selectSet_hostSystemToParent,
+ "hostSystemToParent",
+ "HostSystem", "parent", NULL) < 0) {
+ return -1;
}
/* HostSystem -> vm (VirtualMachine) */
- if (esxVI_BuildFullTraversalSpecItem(fullTraversalSpecList,
- "hostSystemToVm",
- "HostSystem", "vm", NULL) < 0) {
- goto failure;
+ if (esxVI_BuildSelectSet(&ctx->selectSet_hostSystemToVm,
+ "hostSystemToVm",
+ "HostSystem", "vm", NULL) < 0) {
+ return -1;
}
/* HostSystem -> datastore (Datastore) */
- if (esxVI_BuildFullTraversalSpecItem(fullTraversalSpecList,
- "hostSystemToDatastore",
- "HostSystem", "datastore", NULL) < 0) {
- goto failure;
+ if (esxVI_BuildSelectSet(&ctx->selectSet_hostSystemToDatastore,
+ "hostSystemToDatastore",
+ "HostSystem", "datastore", NULL) < 0) {
+ return -1;
}
- return 0;
+ /* Folder -> parent (Folder, Datacenter) */
+ if (esxVI_BuildSelectSet(&ctx->selectSet_computeResourceToParentToParent,
+ "managedEntityToParent",
+ "ManagedEntity", "parent", NULL) < 0) {
+ return -1;
+ }
- failure:
- esxVI_SelectionSpec_Free(fullTraversalSpecList);
+ /* ComputeResource -> parent (Folder) */
+ if (esxVI_BuildSelectSet(&ctx->selectSet_computeResourceToParentToParent,
+ "computeResourceToParent",
+ "ComputeResource", "parent",
+ "managedEntityToParent\0") < 0) {
+ return -1;
+ }
- return -1;
+ return 0;
}
-
/*
* Can't use the SessionIsActive() function here, because at least
* 'ESX Server 3.5.0 build-64607' returns an 'method not implemented' fault if
@@ -1591,7 +1568,6 @@ esxVI_EnsureSession(esxVI_Context *ctx)
"currentSession") < 0 ||
esxVI_LookupObjectContentByType(ctx, ctx->service->sessionManager,
"SessionManager", propertyNameList,
- esxVI_Boolean_False,
&sessionManager) < 0) {
goto cleanup;
}
@@ -1642,7 +1618,6 @@ esxVI_LookupObjectContentByType(esxVI_Context *ctx,
esxVI_ManagedObjectReference *root,
const char *type,
esxVI_String *propertyNameList,
- esxVI_Boolean recurse,
esxVI_ObjectContent **objectContentList)
{
int result = -1;
@@ -1650,11 +1625,6 @@ esxVI_LookupObjectContentByType(esxVI_Context *ctx,
esxVI_PropertySpec *propertySpec = NULL;
esxVI_PropertyFilterSpec *propertyFilterSpec = NULL;
- if (ctx->fullTraversalSpecList == NULL) {
- ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid call"));
- return -1;
- }
-
if (objectContentList == NULL || *objectContentList != NULL) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
return -1;
@@ -1667,10 +1637,45 @@ esxVI_LookupObjectContentByType(esxVI_Context *ctx,
objectSpec->obj = root;
objectSpec->skip = esxVI_Boolean_False;
- if (recurse == esxVI_Boolean_True) {
- objectSpec->selectSet = ctx->fullTraversalSpecList;
- } else if (recurse == esxVI_Boolean_Undefined) {
- objectSpec->selectSet = ctx->fullTraversalSpecList2;
+ if (STRNEQ(root->type, type)) {
+ if (STREQ(root->type, "Folder")) {
+ if (STREQ(type, "Datacenter") || STREQ(type, "ComputeResource")) {
+ objectSpec->selectSet = ctx->selectSet_folderToChildEntity;
+ } else {
+ ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
+ _("Invalid lookup of '%s' from '%s'"),
+ type, root->type);
+ goto cleanup;
+ }
+ } else if (STREQ(root->type, "ComputeResource")) {
+ if (STREQ(type, "HostSystem")) {
+ objectSpec->selectSet = ctx->selectSet_computeResourceToHost;
+ } else if (STREQ(type, "Datacenter")) {
+ objectSpec->selectSet = ctx->selectSet_computeResourceToParentToParent;
+ } else {
+ ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
+ _("Invalid lookup of '%s' from '%s'"),
+ type, root->type);
+ goto cleanup;
+ }
+ } else if (STREQ(root->type, "HostSystem")) {
+ if (STREQ(type, "ComputeResource")) {
+ objectSpec->selectSet = ctx->selectSet_hostSystemToParent;
+ } else if (STREQ(type, "VirtualMachine")) {
+ objectSpec->selectSet = ctx->selectSet_hostSystemToVm;
+ } else if (STREQ(type, "Datastore")) {
+ objectSpec->selectSet = ctx->selectSet_hostSystemToDatastore;
+ } else {
+ ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
+ _("Invalid lookup of '%s' from '%s'"),
+ type, root->type);
+ goto cleanup;
+ }
+ } else {
+ ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
+ _("Invalid lookup from '%s'"), root->type);
+ goto cleanup;
+ }
}
if (esxVI_PropertySpec_Alloc(&propertySpec) < 0) {
@@ -2210,7 +2215,7 @@ int esxVI_LookupHostSystemProperties(esxVI_Context *ctx,
{
return esxVI_LookupObjectContentByType(ctx, ctx->hostSystem->_reference,
"HostSystem", propertyNameList,
- esxVI_Boolean_False, hostSystem);
+ hostSystem);
}
@@ -2224,7 +2229,6 @@ esxVI_LookupVirtualMachineList(esxVI_Context *ctx,
* for cluster support */
return esxVI_LookupObjectContentByType(ctx, ctx->hostSystem->_reference,
"VirtualMachine", propertyNameList,
- esxVI_Boolean_True,
virtualMachineList);
}
@@ -2267,7 +2271,6 @@ esxVI_LookupVirtualMachineByUuid(esxVI_Context *ctx, const unsigned char *uuid,
if (esxVI_LookupObjectContentByType(ctx, managedObjectReference,
"VirtualMachine", propertyNameList,
- esxVI_Boolean_False,
virtualMachine) < 0) {
goto cleanup;
}
@@ -2411,7 +2414,7 @@ esxVI_LookupDatastoreList(esxVI_Context *ctx, esxVI_String *propertyNameList,
* support */
return esxVI_LookupObjectContentByType(ctx, ctx->hostSystem->_reference,
"Datastore", propertyNameList,
- esxVI_Boolean_True, datastoreList);
+ datastoreList);
}
@@ -2590,8 +2593,7 @@ esxVI_LookupDatastoreHostMount(esxVI_Context *ctx,
if (esxVI_String_AppendValueToList(&propertyNameList, "host") < 0 ||
esxVI_LookupObjectContentByType(ctx, datastore, "Datastore",
- propertyNameList, esxVI_Boolean_False,
- &objectContent) < 0) {
+ propertyNameList, &objectContent) < 0) {
goto cleanup;
}
@@ -2656,7 +2658,6 @@ esxVI_LookupTaskInfoByTask(esxVI_Context *ctx,
if (esxVI_String_AppendValueToList(&propertyNameList, "info") < 0 ||
esxVI_LookupObjectContentByType(ctx, task, "Task", propertyNameList,
- esxVI_Boolean_False,
&objectContent) < 0) {
goto cleanup;
}
diff --git a/src/esx/esx_vi.h b/src/esx/esx_vi.h
index d5dc9d5..1431db2 100644
--- a/src/esx/esx_vi.h
+++ b/src/esx/esx_vi.h
@@ -161,8 +161,12 @@ struct _esxVI_Context {
esxVI_Datacenter *datacenter;
esxVI_ComputeResource *computeResource;
esxVI_HostSystem *hostSystem;
- esxVI_SelectionSpec *fullTraversalSpecList;
- esxVI_SelectionSpec *fullTraversalSpecList2;
+ esxVI_SelectionSpec *selectSet_folderToChildEntity;
+ esxVI_SelectionSpec *selectSet_hostSystemToParent;
+ esxVI_SelectionSpec *selectSet_hostSystemToVm;
+ esxVI_SelectionSpec *selectSet_hostSystemToDatastore;
+ esxVI_SelectionSpec *selectSet_computeResourceToHost;
+ esxVI_SelectionSpec *selectSet_computeResourceToParentToParent;
};
int esxVI_Context_Alloc(esxVI_Context **ctx);
@@ -266,12 +270,11 @@ int esxVI_List_Deserialize(xmlNodePtr node, esxVI_List **list,
int esxVI_Alloc(void **ptrptr, size_t size);
-int esxVI_BuildFullTraversalSpecItem
- (esxVI_SelectionSpec **fullTraversalSpecList, const char *name,
+int esxVI_BuildSelectSet
+ (esxVI_SelectionSpec **selectSet, const char *name,
const char *type, const char *path, const char *selectSetNames);
-int esxVI_BuildFullTraversalSpecList
- (esxVI_SelectionSpec **fullTraversalSpecList);
+int esxVI_BuildSelectSetCollection(esxVI_Context *ctx);
int esxVI_EnsureSession(esxVI_Context *ctx);
@@ -279,7 +282,6 @@ int esxVI_LookupObjectContentByType(esxVI_Context *ctx,
esxVI_ManagedObjectReference *root,
const char *type,
esxVI_String *propertyNameList,
- esxVI_Boolean recurse,
esxVI_ObjectContent **objectContentList);
int esxVI_GetManagedEntityStatus
--
1.7.0.4
14 years, 3 months
[libvirt] [PATCH] nodeinfotest: Print libvirt error on failure
by Jiri Denemark
If linuxNodeInfoCPUPopulate() fails, the test would just print "FAILED"
which is not very informative. It's better to print the real error.
---
tests/nodeinfotest.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/tests/nodeinfotest.c b/tests/nodeinfotest.c
index d3c500d..d256c53 100644
--- a/tests/nodeinfotest.c
+++ b/tests/nodeinfotest.c
@@ -43,6 +43,12 @@ static int linuxTestCompareFiles(const char *cpuinfofile, const char *outputfile
memset(&nodeinfo, 0, sizeof(nodeinfo));
if (linuxNodeInfoCPUPopulate(cpuinfo, &nodeinfo) < 0) {
+ if (virTestGetDebug()) {
+ virErrorPtr error = virSaveLastError();
+ if (error && error->code != VIR_ERR_OK)
+ fprintf(stderr, "\n%s\n", error->message);
+ virFreeError(error);
+ }
fclose(cpuinfo);
return -1;
}
--
1.7.2
14 years, 3 months
[libvirt] [PATCH 0/3] Fix make check failures with RHEL-5 xen
by Jiri Denemark
When libvirt is configured using --with-rhel5-api, make check fails on a bunch
of tests for xen driver. All check now pass regardless on rhel5-api.
Jiri Denemark (3):
xen tests: Fix missing "type ioemu" with rhel5-api
xml2sexprtest: Remove graphics from unrelated tests
xen tests: Fix PV-VFB tests with RHEL-5 API
tests/xmconfigdata/test-escape-paths.cfg | 2 +-
tests/xmconfigdata/test-escape-paths.xml | 1 +
tests/xmconfigdata/test-fullvirt-localtime.cfg | 2 +-
tests/xmconfigdata/test-fullvirt-localtime.xml | 1 +
tests/xmconfigdata/test-fullvirt-new-cdrom.cfg | 2 +-
tests/xmconfigdata/test-fullvirt-new-cdrom.xml | 1 +
tests/xmconfigdata/test-fullvirt-old-cdrom.cfg | 2 +-
tests/xmconfigdata/test-fullvirt-old-cdrom.xml | 1 +
tests/xmconfigdata/test-fullvirt-parallel-tcp.cfg | 2 +-
tests/xmconfigdata/test-fullvirt-parallel-tcp.xml | 1 +
tests/xmconfigdata/test-fullvirt-serial-file.cfg | 2 +-
tests/xmconfigdata/test-fullvirt-serial-file.xml | 1 +
tests/xmconfigdata/test-fullvirt-serial-null.cfg | 2 +-
tests/xmconfigdata/test-fullvirt-serial-null.xml | 1 +
tests/xmconfigdata/test-fullvirt-serial-pipe.cfg | 2 +-
tests/xmconfigdata/test-fullvirt-serial-pipe.xml | 1 +
tests/xmconfigdata/test-fullvirt-serial-pty.cfg | 2 +-
tests/xmconfigdata/test-fullvirt-serial-pty.xml | 1 +
tests/xmconfigdata/test-fullvirt-serial-stdio.cfg | 2 +-
tests/xmconfigdata/test-fullvirt-serial-stdio.xml | 1 +
.../test-fullvirt-serial-tcp-telnet.cfg | 2 +-
.../test-fullvirt-serial-tcp-telnet.xml | 1 +
tests/xmconfigdata/test-fullvirt-serial-tcp.cfg | 2 +-
tests/xmconfigdata/test-fullvirt-serial-tcp.xml | 1 +
tests/xmconfigdata/test-fullvirt-serial-udp.cfg | 2 +-
tests/xmconfigdata/test-fullvirt-serial-udp.xml | 1 +
tests/xmconfigdata/test-fullvirt-serial-unix.cfg | 2 +-
tests/xmconfigdata/test-fullvirt-serial-unix.xml | 1 +
tests/xmconfigdata/test-fullvirt-sound.cfg | 2 +-
tests/xmconfigdata/test-fullvirt-sound.xml | 1 +
tests/xmconfigdata/test-fullvirt-usbmouse.cfg | 2 +-
tests/xmconfigdata/test-fullvirt-usbmouse.xml | 1 +
tests/xmconfigdata/test-fullvirt-usbtablet.cfg | 2 +-
tests/xmconfigdata/test-fullvirt-usbtablet.xml | 1 +
tests/xmconfigdata/test-fullvirt-utc.cfg | 2 +-
tests/xmconfigdata/test-fullvirt-utc.xml | 1 +
tests/xmconfigdata/test-no-source-cdrom.cfg | 2 +-
tests/xmconfigdata/test-no-source-cdrom.xml | 1 +
tests/xmconfigdata/test-pci-devs.cfg | 2 +-
tests/xmconfigdata/test-pci-devs.xml | 1 +
tests/xmconfigtest.c | 4 ++--
tests/xml2sexprdata/xml2sexpr-curmem.xml | 1 -
.../xml2sexpr-disk-block-shareable.xml | 1 -
tests/xml2sexprdata/xml2sexpr-fv-localtime.sexpr | 2 +-
tests/xml2sexprdata/xml2sexpr-fv-localtime.xml | 1 +
.../xml2sexprdata/xml2sexpr-fv-parallel-tcp.sexpr | 2 +-
tests/xml2sexprdata/xml2sexpr-fv-parallel-tcp.xml | 1 +
tests/xml2sexprdata/xml2sexpr-fv-serial-file.sexpr | 2 +-
tests/xml2sexprdata/xml2sexpr-fv-serial-file.xml | 1 +
tests/xml2sexprdata/xml2sexpr-fv-serial-null.sexpr | 2 +-
tests/xml2sexprdata/xml2sexpr-fv-serial-null.xml | 1 +
tests/xml2sexprdata/xml2sexpr-fv-serial-pipe.sexpr | 2 +-
tests/xml2sexprdata/xml2sexpr-fv-serial-pipe.xml | 1 +
tests/xml2sexprdata/xml2sexpr-fv-serial-pty.sexpr | 2 +-
tests/xml2sexprdata/xml2sexpr-fv-serial-pty.xml | 1 +
.../xml2sexprdata/xml2sexpr-fv-serial-stdio.sexpr | 2 +-
tests/xml2sexprdata/xml2sexpr-fv-serial-stdio.xml | 1 +
.../xml2sexpr-fv-serial-tcp-telnet.sexpr | 2 +-
.../xml2sexpr-fv-serial-tcp-telnet.xml | 1 +
tests/xml2sexprdata/xml2sexpr-fv-serial-tcp.sexpr | 2 +-
tests/xml2sexprdata/xml2sexpr-fv-serial-tcp.xml | 1 +
tests/xml2sexprdata/xml2sexpr-fv-serial-udp.sexpr | 2 +-
tests/xml2sexprdata/xml2sexpr-fv-serial-udp.xml | 1 +
tests/xml2sexprdata/xml2sexpr-fv-serial-unix.sexpr | 2 +-
tests/xml2sexprdata/xml2sexpr-fv-serial-unix.xml | 1 +
tests/xml2sexprdata/xml2sexpr-fv-sound.sexpr | 2 +-
tests/xml2sexprdata/xml2sexpr-fv-sound.xml | 1 +
tests/xml2sexprdata/xml2sexpr-fv-usbmouse.sexpr | 2 +-
tests/xml2sexprdata/xml2sexpr-fv-usbmouse.xml | 1 +
tests/xml2sexprdata/xml2sexpr-fv-utc.sexpr | 2 +-
tests/xml2sexprdata/xml2sexpr-fv-utc.xml | 1 +
tests/xml2sexprdata/xml2sexpr-fv-v2.sexpr | 2 +-
tests/xml2sexprdata/xml2sexpr-fv-vncunused.sexpr | 2 +-
tests/xml2sexprdata/xml2sexpr-fv-vncunused.xml | 1 +
tests/xml2sexprdata/xml2sexpr-fv.sexpr | 2 +-
tests/xml2sexprdata/xml2sexpr-fv.xml | 1 +
.../xml2sexprdata/xml2sexpr-no-source-cdrom.sexpr | 2 +-
tests/xml2sexprdata/xml2sexpr-no-source-cdrom.xml | 1 +
tests/xml2sexprtest.c | 5 +++++
79 files changed, 82 insertions(+), 42 deletions(-)
--
1.7.2
14 years, 3 months
[libvirt] XP install: where to ask questions?
by sean darcy
On Fedora FC14 I'm trying to install XP under KVM/qemu. It works with VBOx.
On FC14, kvm/qemu I've used F5 to select i486 C-step, but after the
formatting step, I get a message that VNC no longer connects with the
hypervisor. Googled, but no help.
Is this the list to discuss this sort of issue? If not, where?
sean
14 years, 3 months
[libvirt] [PATCH] xenapi: support xenapi 5.6.0 headers
by Eric Blake
* src/xenapi/xenapi_driver.c (xenapiDomainGetInfo): Avoid using
XEN_VM_POWER_STATE_UNKNOWN, which disappeared in newer xenapi.
* src/xenapi/xenapi_utils.c (mapPowerState): Likewise.
---
After letting that last build regression slip through, I decided
to install libxenserver, at the current 5.6.0-1 release. To
my surprise, the compilation still failed; the culprit is that
upstream deleted an enum value.
I thought about doing a configure check and #defining the old
UNKNOWN name to alias the existing UNDEFINED name, but that
would only fix one of the two cases; the switch statement
would still fail to compile in that case due to a duplicate
label. So I think this patch is the right approach.
I guess I could fold the default: and UNDEFINED: case labels
into one, if that is desirable.
src/xenapi/xenapi_driver.c | 2 +-
src/xenapi/xenapi_utils.c | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/xenapi/xenapi_driver.c b/src/xenapi/xenapi_driver.c
index fb3c91d..730859b 100644
--- a/src/xenapi/xenapi_driver.c
+++ b/src/xenapi/xenapi_driver.c
@@ -966,7 +966,7 @@ xenapiDomainGetInfo (virDomainPtr dom, virDomainInfoPtr info)
vm = vms->contents[0];
xen_vm_get_memory_static_max(session, &maxmem, vm);
info->maxMem = (maxmem / 1024);
- enum xen_vm_power_state state = XEN_VM_POWER_STATE_UNKNOWN;
+ enum xen_vm_power_state state = XEN_VM_POWER_STATE_UNDEFINED;
xen_vm_get_power_state(session, &state, vm);
info->state = mapPowerState(state);
xen_vm_get_record(session, &record, vm);
diff --git a/src/xenapi/xenapi_utils.c b/src/xenapi/xenapi_utils.c
index 23d3fef..e22f6fd 100644
--- a/src/xenapi/xenapi_utils.c
+++ b/src/xenapi/xenapi_utils.c
@@ -336,11 +336,12 @@ mapPowerState(enum xen_vm_power_state state)
case XEN_VM_POWER_STATE_RUNNING:
virState = VIR_DOMAIN_RUNNING;
break;
- case XEN_VM_POWER_STATE_UNKNOWN:
case XEN_VM_POWER_STATE_UNDEFINED:
virState = VIR_DOMAIN_NOSTATE;
break;
default:
+ /* Includes XEN_VM_POWER_STATE_UNKNOWN from libxenserver
+ * 5.5.0, which is gone in 5.6.0. */
virState = VIR_DOMAIN_NOSTATE;
break;
}
--
1.7.2.1
14 years, 3 months
[libvirt] using sync_manager with libvirt
by David Teigland
Hi,
We've been working on a program called sync_manager that implements
shared-storage-based leases to protect shared resources. One way we'd like
to use it is to protect vm images that reside on shared storage,
i.e. preventing two vm's on two hosts from using the same image at once.
It's functional, and the next big step is using it through libvirt.
sync_manager "wraps" a process, i.e. acquires a lease, forks&execs a
process, renews the lease wile the process runs, and releases the lease
when the process exits. While the process runs, it has exclusive access
to whatever resource was named in the lease that was acquired.
A command would be something like this:
sync_manager daemon -i <host_id> -n <vm_id> -l <lease> -c <command> <args>
<host_id> is integer between 1 and 2000 that is statically
assigned to each host.
<vm_id> is a unique identifer for the process that will be run,
e.g. the vm name or uuid.
<lease> defines the shared storage area that sync_manager should
use for performing the disk-paxos based synchronization.
It consists of <resource_name>:<path>:<offset>, where
<resource_name> is likely to be the vm name/uuid (or the
name of the vm's disk image), and <path>:<offset> is an
area of shared storage that has been allocated for
sync_manager to use (a separate area for each resource/vm).
<command> <args>
would be the qemu command line that is currently used.
We expect these new config values will need a place to live in the libvirt
xml config file, and libvirt will need to fork sync_manager -c qemu rather
than qemu directly. At least those are the most obvious things that need
doing, there are sure to be other api or functional issues.
sync_manager only forks when running the command, and doesn't change any
fd's, so any command output should appear unchanged to libvirt. Would
there be any problem with sync_manager also printing its own warnings and
errors to stderr?
While the main point of sync_manager is the disk leases to synchronize
access among hosts, it also uses posix locks to synchronize access among
local processes.
http://git.fedorahosted.org/git/?p=sync_manager.git
Thanks,
Dave
14 years, 3 months
Re: [libvirt] virsh question
by Eric Blake
[again, adding the list]
On 08/23/2010 07:35 AM, Matthew Whitehead wrote:
> I want to enable gdb debugging for the qemu or qemu-kvm executables. The -s flag tells it to run qemu's gdbserver and -p tells the gdbserver to listen on a non-default (1234) port.
Yes, this sounds like a perfect fit for libvirt 0.8.3's qemu monitor
support. However, I did not implement that patch, so I'm not the best
person to ask on how to modify your XML to inject those options.
However, commit a71be01f04e7cac in libvirt.git includes some example XML
that uses the new elements, such as:
+<domain type='qemu'
xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory>219200</memory>
+ <currentMemory>219200</currentMemory>
+ <vcpu>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda' bus='ide'/>
+ <address type='drive' controller='0' bus='0' unit='0'/>
+ </disk>
+ <controller type='ide' index='0'/>
+ <memballoon model='virtio'/>
+ </devices>
+ <qemu:commandline>
+ <qemu:arg value='-unknown'/>
+ <qemu:arg value='parameter'/>
+ </qemu:commandline>
+</domain>
So, I think it is as simple as passing <qemu:arg value='-p'/> from
within your <domain> XML.
--
Eric Blake eblake(a)redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org
14 years, 3 months
Re: [libvirt] virsh question
by Eric Blake
[Adding the list]
On 08/23/2010 06:26 AM, Matthew Whitehead wrote:
> Eric,
> I'm trying to get "virsh domxml-from-native " working for the -s and -p flags. Do you know if support for those flags is possible? If not, is there a way I could hand code them into the xml to be passed through to the command line?
I'm not sure in which context you are referring to the -s and -p flags.
Which command line are you trying to modify so that those flags are
added? Also, as of libvirt 0.8.3, you can modify qemu command lines
issued by libvirt using appropriate XML, although such modifications go
behind libvirt's back and are therefore at your own risk.
--
Eric Blake eblake(a)redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org
14 years, 3 months
[libvirt] [PATCH] xenapi: Fix compile error in previous commit
by Matthias Bolte
---
I'm pushing this under the trivial compile error fix rule.
src/xenapi/xenapi_utils.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/xenapi/xenapi_utils.c b/src/xenapi/xenapi_utils.c
index c161b22..f61e09d 100644
--- a/src/xenapi/xenapi_utils.c
+++ b/src/xenapi/xenapi_utils.c
@@ -225,7 +225,7 @@ xenapiNormalExitEnum2virDomainLifecycle(enum xen_on_normal_exit action)
enum virDomainLifecycleCrashAction
xenapiCrashExitEnum2virDomainLifecycle(enum xen_on_crash_behaviour action)
{
- enum virDomainLifecycleCrashAction num = VIR_DOMAIN_LIFECYCLE_CRASH__RESTART;
+ enum virDomainLifecycleCrashAction num = VIR_DOMAIN_LIFECYCLE_CRASH_RESTART;
if (action == XEN_ON_CRASH_BEHAVIOUR_DESTROY)
num = VIR_DOMAIN_LIFECYCLE_CRASH_DESTROY;
else if (action == XEN_ON_CRASH_BEHAVIOUR_RESTART)
--
1.7.0.4
14 years, 3 months
Re: [libvirt] using sync_manager with libvirt
by Andrew Cathrow
----- "Perry Myers" <pmyers(a)redhat.com> wrote:
> From: "Perry Myers" <pmyers(a)redhat.com>
> To: "David Teigland" <teigland(a)redhat.com>
> Cc: libvir-list(a)redhat.com
> Sent: Sunday, August 22, 2010 12:13:16 PM GMT -05:00 US/Canada Eastern
> Subject: Re: [libvirt] using sync_manager with libvirt
>
> On 08/19/2010 01:23 PM, David Teigland wrote:
> > On Thu, Aug 19, 2010 at 11:12:25AM -0400, David Teigland wrote:
> >> I'm only aware of one goal, and the current plan is to implement it
> >> correctly and completely. That goal is to lock vm images so if the vm
> >> happens to run on two hosts, only one instance can access the image.
>
> Ok. So for the first implementation of sync_manager it will still be
> possible for someone to corrupt data by configuring two separate vms to
> accidentally use the same storage volumes. That's fine for the first
> pass, just something to keep in mind for later.
Presumably it'll use support the <shareable/> flag for shared disks.
>
> > (That's slightly misleading; technically, the lock prevents a second qemu
> > process from even being started.)
>
> ack
>
> Perry
>
>
> --
> libvir-list mailing list
> libvir-list(a)redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list
>
14 years, 3 months