[libvirt] [PATCH] conf: tests: fix virDomainNetDefFormat for vhost-user in client mode
by Maxime Leroy
The mode attribute is required for the source element of vhost-user. Thus
virDomainNetDefFormat should always generate a xml with it, and
not only when the mode is server.
The commit fixes the issue. And it adds a vhostuser interface in 'client' mode
to qemuxml2argv-net-vhostuser.(args|xml) to test this usecase.
Signed-off-by: Maxime Leroy <maxime.leroy(a)6wind.com>
---
src/conf/domain_conf.c | 5 +++--
tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser.args | 7 +++++--
tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser.xml | 7 ++++++-
3 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 42c0223..73c199e 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -17082,8 +17082,9 @@ virDomainNetDefFormat(virBufferPtr buf,
virBufferAddLit(buf, "<source type='unix'");
virBufferEscapeString(buf, " path='%s'",
def->data.vhostuser->data.nix.path);
- if (def->data.vhostuser->data.nix.listen)
- virBufferAddLit(buf, " mode='server'");
+ virBufferAsprintf(buf, " mode='%s'",
+ def->data.vhostuser->data.nix.listen ?
+ "server" : "client");
virBufferAddLit(buf, "/>\n");
}
break;
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser.args b/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser.args
index cc66ec3..26daac3 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser.args
@@ -2,6 +2,9 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
/usr/bin/qemu -S -M \
pc -m 214 -smp 1 -nographic -nodefaults -monitor unix:/tmp/test-monitor,server,nowait \
-no-acpi -boot c -usb -hda /dev/HostVG/QEMUGuest1 \
--chardev socket,id=charnet0,path=/tmp/vhost.sock,server \
+-chardev socket,id=charnet0,path=/tmp/vhost0.sock,server \
-netdev type=vhost-user,id=hostnet0,chardev=charnet0 \
--device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:ee:96:6b,bus=pci.0,addr=0x3
+-device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:ee:96:6b,bus=pci.0,addr=0x3 \
+-chardev socket,id=charnet1,path=/tmp/vhost1.sock \
+-netdev type=vhost-user,id=hostnet1,chardev=charnet1 \
+-device virtio-net-pci,netdev=hostnet1,id=net1,mac=52:54:00:ee:96:6c,bus=pci.0,addr=0x4
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser.xml b/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser.xml
index b49d48e..e5b6242 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser.xml
@@ -25,7 +25,12 @@
<controller type='pci' index='0' model='pci-root'/>
<interface type='vhostuser'>
<mac address='52:54:00:ee:96:6b'/>
- <source type='unix' path='/tmp/vhost.sock' mode='server'/>
+ <source type='unix' path='/tmp/vhost0.sock' mode='server'/>
+ <model type='virtio'/>
+ </interface>
+ <interface type='vhostuser'>
+ <mac address='52:54:00:ee:96:6c'/>
+ <source type='unix' path='/tmp/vhost1.sock' mode='client'/>
<model type='virtio'/>
</interface>
<memballoon model='none'/>
--
1.9.3
10 years, 1 month
[libvirt] [PATCH] docs: apps: Update references to virt-p2v and virt-v2v.
by Richard W.M. Jones
These tools have been rewritten upstream, so you don't need to link to
the old tools, link to the new ones and mention they are part of
libguestfs.
Also remove the link to "Poor man's P2V". There's no real reason to
use that technique any longer since the rewritten tools are simple,
fast and highly capable.
---
docs/apps.html.in | 26 +++++++++++---------------
1 file changed, 11 insertions(+), 15 deletions(-)
diff --git a/docs/apps.html.in b/docs/apps.html.in
index 70e7b41..4403ce6 100644
--- a/docs/apps.html.in
+++ b/docs/apps.html.in
@@ -163,25 +163,21 @@
<h2><a name="conversion">Conversion</a></h2>
<dl>
- <dt><a href="https://rwmj.wordpress.com/2009/10/13/poor-mans-p2v/">Poor mans p2v</a></dt>
+ <dt><a href="http://libguestfs.org/virt-p2v.1.html">virt-p2v</a></dt>
<dd>
- A simple approach for converting a physical machine to a virtual
- machine, using a rescue CD.
+ Convert a physical machine to run on KVM. It is a LiveCD
+ which is booted on the machine to be converted. It collects a
+ little information from the user, then copies the disks over
+ to a remote machine and defines the XML for a domain to run
+ the guest. (Note this tool is included with libguestfs)
</dd>
- <dt><a href="http://et.redhat.com/~rjones/virt-p2v/">virt-p2v</a></dt>
+ <dt><a href="http://libguestfs.org/virt-v2v.1.html">virt-v2v</a></dt>
<dd>
- An older tool for converting a physical machine into a virtual
- machine. It is a LiveCD which is booted on the machine to be
- converted. It collects a little information from the user, then
- copies the disks over to a remote machine and defines the XML for a
- domain to run the guest.
- </dd>
- <dt><a href="http://git.fedorahosted.org/git/?p=virt-v2v.git;a=summary">virt-v2v</a></dt>
- <dd>
- virt-v2v converts guests from a foreign hypervisor to run on KVM,
- managed by libvirt. It can currently convert Red Hat Enterprise
- Linux (RHEL) and Fedora guests running on Xen and VMware ESX. It
+ virt-v2v converts guests from a foreign hypervisor to run on
+ KVM, managed by libvirt. It can convert guests from VMware or
+ Xen to run on OpenStack, oVirt (RHEV-M), or local libvirt. It
will enable VirtIO drivers in the converted guest if possible.
+ (Note this tool is included with libguestfs)
</dd>
<dd>
For RHEL customers of Red Hat, conversion of Windows guests is also
--
2.0.4
10 years, 1 month
[libvirt] [PATCH] esx: Simplify VI (vSphere) API and VMware product version handling
by Matthias Bolte
Store version numbers in this format
version = 1000000 * major + 1000 * minor + micro
produces by virParseVersionString instead of dedicated enums.
Split the complex esxVI_ProductVersion enum into a simpler
sxVI_ProductLine enum and a product version number.
Relax API and product version number check to accept anything
that is equal or greater than the supported minimum version.
VMware ESX went through 3 major version and constantly stayed
backward compatible. This commit assumes that this will be
true for future versions.
---
src/esx/esx_driver.c | 59 +++++---------
src/esx/esx_vi.c | 215 ++++++++++++++++++++++++++-------------------------
src/esx/esx_vi.h | 55 +++----------
3 files changed, 140 insertions(+), 189 deletions(-)
diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c
index 39784b9..4f62774 100644
--- a/src/esx/esx_driver.c
+++ b/src/esx/esx_driver.c
@@ -646,9 +646,9 @@ esxConnectToHost(esxPrivate *priv,
esxVI_String *propertyNameList = NULL;
esxVI_ObjectContent *hostSystem = NULL;
esxVI_Boolean inMaintenanceMode = esxVI_Boolean_Undefined;
- esxVI_ProductVersion expectedProductVersion = STRCASEEQ(conn->uri->scheme, "esx")
- ? esxVI_ProductVersion_ESX
- : esxVI_ProductVersion_GSX;
+ esxVI_ProductLine expectedProductLine = STRCASEEQ(conn->uri->scheme, "esx")
+ ? esxVI_ProductLine_ESX
+ : esxVI_ProductLine_GSX;
if (!vCenterIpAddress || *vCenterIpAddress) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
@@ -695,25 +695,13 @@ esxConnectToHost(esxPrivate *priv,
goto cleanup;
}
- if (expectedProductVersion == esxVI_ProductVersion_ESX) {
- if (priv->host->productVersion != esxVI_ProductVersion_ESX35 &&
- priv->host->productVersion != esxVI_ProductVersion_ESX40 &&
- priv->host->productVersion != esxVI_ProductVersion_ESX41 &&
- priv->host->productVersion != esxVI_ProductVersion_ESX4x &&
- priv->host->productVersion != esxVI_ProductVersion_ESX50 &&
- priv->host->productVersion != esxVI_ProductVersion_ESX51 &&
- priv->host->productVersion != esxVI_ProductVersion_ESX5x) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("%s is neither an ESX 3.5, 4.x nor 5.x host"),
- conn->uri->server);
- goto cleanup;
- }
- } else { /* GSX */
- if (priv->host->productVersion != esxVI_ProductVersion_GSX20) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("%s isn't a GSX 2.0 host"), conn->uri->server);
- goto cleanup;
- }
+ if (priv->host->productLine != expectedProductLine) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Expecting '%s' to be a %s host, but found a %s host"),
+ conn->uri->server,
+ esxVI_ProductLineToDisplayName(expectedProductLine),
+ esxVI_ProductLineToDisplayName(priv->host->productLine));
+ goto cleanup;
}
/* Query the host for maintenance mode and vCenter IP address */
@@ -815,16 +803,12 @@ esxConnectToVCenter(esxPrivate *priv,
goto cleanup;
}
- if (priv->vCenter->productVersion != esxVI_ProductVersion_VPX25 &&
- priv->vCenter->productVersion != esxVI_ProductVersion_VPX40 &&
- priv->vCenter->productVersion != esxVI_ProductVersion_VPX41 &&
- priv->vCenter->productVersion != esxVI_ProductVersion_VPX4x &&
- priv->vCenter->productVersion != esxVI_ProductVersion_VPX50 &&
- priv->vCenter->productVersion != esxVI_ProductVersion_VPX51 &&
- priv->vCenter->productVersion != esxVI_ProductVersion_VPX5x) {
+ if (priv->vCenter->productLine != esxVI_ProductLine_VPX) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("%s is neither a vCenter 2.5, 4.x nor 5.x server"),
- hostname);
+ _("Expecting '%s' to be a %s host but found a %s host"),
+ conn->uri->server,
+ esxVI_ProductLineToDisplayName(esxVI_ProductLine_VPX),
+ esxVI_ProductLineToDisplayName(priv->vCenter->productLine));
goto cleanup;
}
@@ -1217,14 +1201,7 @@ esxConnectGetVersion(virConnectPtr conn, unsigned long *version)
{
esxPrivate *priv = conn->privateData;
- if (virParseVersionString(priv->primary->service->about->version,
- version, false) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Could not parse version number from '%s'"),
- priv->primary->service->about->version);
-
- return -1;
- }
+ *version = priv->primary->productVersion;
return 0;
}
@@ -2934,7 +2911,7 @@ esxConnectDomainXMLToNative(virConnectPtr conn, const char *nativeFormat,
}
virtualHW_version = esxVI_ProductVersionToDefaultVirtualHWVersion
- (priv->primary->productVersion);
+ (priv->primary->productLine, priv->primary->productVersion);
if (virtualHW_version < 0) {
return NULL;
@@ -3190,7 +3167,7 @@ esxDomainDefineXML(virConnectPtr conn, const char *xml)
/* Build VMX from domain XML */
virtualHW_version = esxVI_ProductVersionToDefaultVirtualHWVersion
- (priv->primary->productVersion);
+ (priv->primary->productLine, priv->primary->productVersion);
if (virtualHW_version < 0) {
goto cleanup;
diff --git a/src/esx/esx_vi.c b/src/esx/esx_vi.c
index b00d8e7..7c4af14 100644
--- a/src/esx/esx_vi.c
+++ b/src/esx/esx_vi.c
@@ -1040,98 +1040,77 @@ esxVI_Context_Connect(esxVI_Context *ctx, const char *url,
return -1;
}
- if (STREQ(ctx->service->about->apiType, "HostAgent") ||
- STREQ(ctx->service->about->apiType, "VirtualCenter")) {
- if (STRPREFIX(ctx->service->about->apiVersion, "2.5")) {
- ctx->apiVersion = esxVI_APIVersion_25;
- } else if (STRPREFIX(ctx->service->about->apiVersion, "4.0")) {
- ctx->apiVersion = esxVI_APIVersion_40;
- } else if (STRPREFIX(ctx->service->about->apiVersion, "4.1")) {
- ctx->apiVersion = esxVI_APIVersion_41;
- } else if (STRPREFIX(ctx->service->about->apiVersion, "4.")) {
- ctx->apiVersion = esxVI_APIVersion_4x;
- } else if (STRPREFIX(ctx->service->about->apiVersion, "5.0")) {
- ctx->apiVersion = esxVI_APIVersion_50;
- } else if (STRPREFIX(ctx->service->about->apiVersion, "5.1")) {
- ctx->apiVersion = esxVI_APIVersion_51;
- } else if (STRPREFIX(ctx->service->about->apiVersion, "5.")) {
- ctx->apiVersion = esxVI_APIVersion_5x;
- } else {
+ if (STRNEQ(ctx->service->about->apiType, "HostAgent") &&
+ STRNEQ(ctx->service->about->apiType, "VirtualCenter")) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Expecting VI API type 'HostAgent' or 'VirtualCenter' "
+ "but found '%s'"), ctx->service->about->apiType);
+ return -1;
+ }
+
+ if (virParseVersionString(ctx->service->about->apiVersion,
+ &ctx->apiVersion, true) < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not parse VI API version '%s'"),
+ ctx->service->about->apiVersion);
+ return -1;
+ }
+
+ if (ctx->apiVersion < 1000000 * 2 + 1000 * 5 /* 2.5 */) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Minimum supported %s version is %s but found version '%s'"),
+ "VI API", "2.5", ctx->service->about->apiVersion);
+ return -1;
+ }
+
+ if (virParseVersionString(ctx->service->about->version,
+ &ctx->productVersion, true) < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not parse product version '%s'"),
+ ctx->service->about->version);
+ return -1;
+ }
+
+ if (STREQ(ctx->service->about->productLineId, "gsx")) {
+ if (ctx->productVersion < 1000000 * 2 + 1000 * 0 /* 2.0 */) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Expecting VI API major/minor version '2.5', '4.x' or "
- "'5.x' but found '%s'"), ctx->service->about->apiVersion);
+ _("Minimum supported %s version is %s but found version '%s'"),
+ esxVI_ProductLineToDisplayName(esxVI_ProductLine_GSX),
+ "2.0", ctx->service->about->version);
return -1;
}
- if (STREQ(ctx->service->about->productLineId, "gsx")) {
- if (STRPREFIX(ctx->service->about->version, "2.0")) {
- ctx->productVersion = esxVI_ProductVersion_GSX20;
- } else {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Expecting GSX major/minor version '2.0' but "
- "found '%s'"), ctx->service->about->version);
- return -1;
- }
- } else if (STREQ(ctx->service->about->productLineId, "esx") ||
- STREQ(ctx->service->about->productLineId, "embeddedEsx")) {
- if (STRPREFIX(ctx->service->about->version, "3.5")) {
- ctx->productVersion = esxVI_ProductVersion_ESX35;
- } else if (STRPREFIX(ctx->service->about->version, "4.0")) {
- ctx->productVersion = esxVI_ProductVersion_ESX40;
- } else if (STRPREFIX(ctx->service->about->version, "4.1")) {
- ctx->productVersion = esxVI_ProductVersion_ESX41;
- } else if (STRPREFIX(ctx->service->about->version, "4.")) {
- ctx->productVersion = esxVI_ProductVersion_ESX4x;
- } else if (STRPREFIX(ctx->service->about->version, "5.0")) {
- ctx->productVersion = esxVI_ProductVersion_ESX50;
- } else if (STRPREFIX(ctx->service->about->version, "5.1")) {
- ctx->productVersion = esxVI_ProductVersion_ESX51;
- } else if (STRPREFIX(ctx->service->about->version, "5.")) {
- ctx->productVersion = esxVI_ProductVersion_ESX5x;
- } else {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Expecting ESX major/minor version '3.5', "
- "'4.x' or '5.x' but found '%s'"),
- ctx->service->about->version);
- return -1;
- }
- } else if (STREQ(ctx->service->about->productLineId, "vpx")) {
- if (STRPREFIX(ctx->service->about->version, "2.5")) {
- ctx->productVersion = esxVI_ProductVersion_VPX25;
- } else if (STRPREFIX(ctx->service->about->version, "4.0")) {
- ctx->productVersion = esxVI_ProductVersion_VPX40;
- } else if (STRPREFIX(ctx->service->about->version, "4.1")) {
- ctx->productVersion = esxVI_ProductVersion_VPX41;
- } else if (STRPREFIX(ctx->service->about->version, "4.")) {
- ctx->productVersion = esxVI_ProductVersion_VPX4x;
- } else if (STRPREFIX(ctx->service->about->version, "5.0")) {
- ctx->productVersion = esxVI_ProductVersion_VPX50;
- } else if (STRPREFIX(ctx->service->about->version, "5.1")) {
- ctx->productVersion = esxVI_ProductVersion_VPX51;
- } else if (STRPREFIX(ctx->service->about->version, "5.")) {
- ctx->productVersion = esxVI_ProductVersion_VPX5x;
- } else {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Expecting VPX major/minor version '2.5', '4.x' "
- "or '5.x' but found '%s'"),
- ctx->service->about->version);
- return -1;
- }
- } else {
+ ctx->productLine = esxVI_ProductLine_GSX;
+ } else if (STREQ(ctx->service->about->productLineId, "esx") ||
+ STREQ(ctx->service->about->productLineId, "embeddedEsx")) {
+ if (ctx->productVersion < 1000000 * 3 + 1000 * 5 /* 3.5 */) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Minimum supported %s version is %s but found version '%s'"),
+ esxVI_ProductLineToDisplayName(esxVI_ProductLine_ESX),
+ "3.5", ctx->service->about->version);
+ return -1;
+ }
+
+ ctx->productLine = esxVI_ProductLine_ESX;
+ } else if (STREQ(ctx->service->about->productLineId, "vpx")) {
+ if (ctx->productVersion < 1000000 * 2 + 1000 * 5 /* 2.5 */) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Expecting product 'gsx' or 'esx' or 'embeddedEsx' "
- "or 'vpx' but found '%s'"),
- ctx->service->about->productLineId);
+ _("Minimum supported %s version is %s but found version '%s'"),
+ esxVI_ProductLineToDisplayName(esxVI_ProductLine_VPX),
+ "2.5", ctx->service->about->version);
return -1;
}
+
+ ctx->productLine = esxVI_ProductLine_VPX;
} else {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Expecting VI API type 'HostAgent' or 'VirtualCenter' "
- "but found '%s'"), ctx->service->about->apiType);
+ _("Expecting product 'gsx' or 'esx' or 'embeddedEsx' "
+ "or 'vpx' but found '%s'"),
+ ctx->service->about->productLineId);
return -1;
}
- if (ctx->productVersion & esxVI_ProductVersion_ESX) {
+ if (ctx->productLine == esxVI_ProductLine_ESX) {
/*
* FIXME: Actually this should be detected by really calling
* QueryVirtualDiskUuid and checking if a NotImplemented fault is
@@ -1142,7 +1121,7 @@ esxVI_Context_Connect(esxVI_Context *ctx, const char *url,
ctx->hasQueryVirtualDiskUuid = true;
}
- if (ctx->productVersion & esxVI_ProductVersion_VPX) {
+ if (ctx->productLine == esxVI_ProductLine_VPX) {
ctx->hasSessionIsActive = true;
}
@@ -4770,9 +4749,33 @@ esxVI_ParseHostCpuIdInfo(esxVI_ParsedHostCpuIdInfo *parsedHostCpuIdInfo,
+const char *
+esxVI_ProductLineToDisplayName(esxVI_ProductLine productLine)
+{
+ switch (productLine) {
+ case esxVI_ProductLine_GSX:
+ return "GSX";
+
+ case esxVI_ProductLine_ESX:
+ return "ESX(i)";
+
+ case esxVI_ProductLine_VPX:
+ return "vCenter/VPX";
+
+ default:
+ return "<unknown>";
+ }
+}
+
+
+
int
-esxVI_ProductVersionToDefaultVirtualHWVersion(esxVI_ProductVersion productVersion)
+esxVI_ProductVersionToDefaultVirtualHWVersion(esxVI_ProductLine productLine,
+ unsigned long productVersion)
{
+ /* product version == 1000000 * major + 1000 * minor + micro */
+ int major = productVersion / 1000000;
+
/*
* virtualHW.version compatibility matrix:
*
@@ -4785,35 +4788,39 @@ esxVI_ProductVersionToDefaultVirtualHWVersion(esxVI_ProductVersion productVersio
* ESX 5.5 + + + + + 5.5
* GSX 2.0 + + 2.5
*/
- switch (productVersion) {
- case esxVI_ProductVersion_ESX35:
- case esxVI_ProductVersion_VPX25:
- return 4;
-
- case esxVI_ProductVersion_GSX20:
- case esxVI_ProductVersion_ESX40:
- case esxVI_ProductVersion_ESX41:
- case esxVI_ProductVersion_VPX40:
- case esxVI_ProductVersion_VPX41:
+ switch (productLine) {
+ case esxVI_ProductLine_GSX:
return 7;
- case esxVI_ProductVersion_ESX4x:
- case esxVI_ProductVersion_VPX4x:
- return 7;
+ case esxVI_ProductLine_ESX:
+ switch (major) {
+ case 3:
+ return 4;
- case esxVI_ProductVersion_ESX50:
- case esxVI_ProductVersion_VPX50:
- return 8;
+ case 4:
+ return 7;
- case esxVI_ProductVersion_ESX51:
- case esxVI_ProductVersion_ESX5x:
- case esxVI_ProductVersion_VPX51:
- case esxVI_ProductVersion_VPX5x:
- return 8;
+ case 5:
+ default:
+ return 8;
+ }
+
+ case esxVI_ProductLine_VPX:
+ switch (major) {
+ case 2:
+ return 4;
+
+ case 4:
+ return 7;
+
+ case 5:
+ default:
+ return 8;
+ }
default:
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Unexpected product version"));
+ _("Unexpected product line"));
return -1;
}
}
diff --git a/src/esx/esx_vi.h b/src/esx/esx_vi.h
index dac36cd..b7f0160 100644
--- a/src/esx/esx_vi.h
+++ b/src/esx/esx_vi.h
@@ -75,8 +75,7 @@
-typedef enum _esxVI_APIVersion esxVI_APIVersion;
-typedef enum _esxVI_ProductVersion esxVI_ProductVersion;
+typedef enum _esxVI_ProductLine esxVI_ProductLine;
typedef enum _esxVI_Occurrence esxVI_Occurrence;
typedef struct _esxVI_ParsedHostCpuIdInfo esxVI_ParsedHostCpuIdInfo;
typedef struct _esxVI_CURL esxVI_CURL;
@@ -90,45 +89,10 @@ typedef struct _esxVI_List esxVI_List;
-enum _esxVI_APIVersion {
- esxVI_APIVersion_Undefined = 0,
- esxVI_APIVersion_Unknown,
- esxVI_APIVersion_25,
- esxVI_APIVersion_40,
- esxVI_APIVersion_41,
- esxVI_APIVersion_4x, /* > 4.1 */
- esxVI_APIVersion_50,
- esxVI_APIVersion_51,
- esxVI_APIVersion_5x /* > 5.1 */
-};
-
-/*
- * AAAABBBB: where AAAA0000 is the product and BBBB the version. this format
- * allows simple bitmask testing for a product independent of the version
- */
-enum _esxVI_ProductVersion {
- esxVI_ProductVersion_Undefined = 0,
-
- esxVI_ProductVersion_GSX = (1 << 0) << 16,
- esxVI_ProductVersion_GSX20 = esxVI_ProductVersion_GSX | 1,
-
- esxVI_ProductVersion_ESX = (1 << 1) << 16,
- esxVI_ProductVersion_ESX35 = esxVI_ProductVersion_ESX | 1,
- esxVI_ProductVersion_ESX40 = esxVI_ProductVersion_ESX | 2,
- esxVI_ProductVersion_ESX41 = esxVI_ProductVersion_ESX | 3,
- esxVI_ProductVersion_ESX4x = esxVI_ProductVersion_ESX | 4, /* > 4.1 */
- esxVI_ProductVersion_ESX50 = esxVI_ProductVersion_ESX | 5,
- esxVI_ProductVersion_ESX51 = esxVI_ProductVersion_ESX | 6,
- esxVI_ProductVersion_ESX5x = esxVI_ProductVersion_ESX | 7, /* > 5.1 */
-
- esxVI_ProductVersion_VPX = (1 << 2) << 16,
- esxVI_ProductVersion_VPX25 = esxVI_ProductVersion_VPX | 1,
- esxVI_ProductVersion_VPX40 = esxVI_ProductVersion_VPX | 2,
- esxVI_ProductVersion_VPX41 = esxVI_ProductVersion_VPX | 3,
- esxVI_ProductVersion_VPX4x = esxVI_ProductVersion_VPX | 4, /* > 4.1 */
- esxVI_ProductVersion_VPX50 = esxVI_ProductVersion_VPX | 5,
- esxVI_ProductVersion_VPX51 = esxVI_ProductVersion_VPX | 6,
- esxVI_ProductVersion_VPX5x = esxVI_ProductVersion_VPX | 7 /* > 5.1 */
+enum _esxVI_ProductLine {
+ esxVI_ProductLine_GSX = 0,
+ esxVI_ProductLine_ESX,
+ esxVI_ProductLine_VPX
};
enum _esxVI_Occurrence {
@@ -226,8 +190,9 @@ struct _esxVI_Context {
char *username;
char *password;
esxVI_ServiceContent *service;
- esxVI_APIVersion apiVersion;
- esxVI_ProductVersion productVersion;
+ unsigned long apiVersion; /* = 1000000 * major + 1000 * minor + micro */
+ esxVI_ProductLine productLine;
+ unsigned long productVersion; /* = 1000000 * major + 1000 * minor + micro */
esxVI_UserSession *session; /* ... except the session ... */
virMutexPtr sessionLock; /* ... that is protected by this mutex */
esxVI_Datacenter *datacenter;
@@ -536,8 +501,10 @@ int esxVI_WaitForTaskCompletion(esxVI_Context *ctx,
int esxVI_ParseHostCpuIdInfo(esxVI_ParsedHostCpuIdInfo *parsedHostCpuIdInfo,
esxVI_HostCpuIdInfo *hostCpuIdInfo);
+const char *esxVI_ProductLineToDisplayName(esxVI_ProductLine productLine);
+
int esxVI_ProductVersionToDefaultVirtualHWVersion
- (esxVI_ProductVersion productVersion);
+ (esxVI_ProductLine productLine, unsigned long productVersion);
int esxVI_LookupHostInternetScsiHbaStaticTargetByName
(esxVI_Context *ctx, const char *name,
--
1.8.3.2
10 years, 1 month
[libvirt] ANNOUNCE: libguestfs 1.28 released
by Richard W.M. Jones
I'm pleased to announce libguestfs 1.28, a library and set of tools
for accessing and modifying virtual machine disk images.
This release took 7 months of work by a considerable number of people,
and has many new features (see release notes below), including new
'virt-v2v' and 'virt-p2v' tools for importing guests from foreign
hypervisors to KVM, and 'virt-log' which is a tool for extracting log
files from guests (including Windows).
You can get libguestfs 1.28 here:
Main website: http://libguestfs.org/
Source: http://libguestfs.org/download/1.28-stable/
You will also need latest supermin from here:
http://libguestfs.org/download/supermin/
Fedora 21: http://koji.fedoraproject.org/koji/packageinfo?packageID=8391
It will appear as an update for F21 in about a week.
Debian/experimental coming soon, see:
https://packages.debian.org/experimental/libguestfs0
[ From http://libguestfs.org/guestfs-release-notes.1.html ]
RELEASE NOTES FOR LIBGUESTFS 1.28
New features
Tools
virt-v2v(1) and virt-p2v(1) are tools for converting from foreign
hypervisors (such as VMware or Xen) or physical machines, to KVM. These
tools were previously a separate project. The code for both tools has
been integrated into the libguestfs tree. As part of the refactoring,
virt-p2v has been rewritten (from Ruby, now C), and virt-v2v now uses
several modern features of qemu which make it run many times faster
than before. virt-v2v(1) can import from: VMware vCenter, VMware OVA
files, local disk files, libvirt, RHEL 5 Xen. It can output to: oVirt
or Red Hat Enterprise Virtualization (RHEV-M), OpenStack Glance,
libvirt, qemu, local disk files.
virt-log(1) is a new tool for listing log files from guests. It
supports a variety of guests including Linux traditional, Linux using
journal, and Windows event log.
virt-builder(1) has a new --machine-readable option to make it simpler
to consume virt-builder from other programs.
New virt-builder(1) and virt-customize(1) --chmod option.
virt-sysprep(1) will now remove: systemd journals, anaconda logs,
lightdm logs, debian-installer files, apt logs, exim logs, ConsoleKit
logs, firewalld logs, grubby logs, proftpd logs, libvirt/libxml logs,
and several other log files. The virt-sysprep user-account operation is
now able to remove or keep particular user accounts. (Pino Toscano).
New guestmount(1) --fd option, allowing you to run guestmount captive
under another process.
virt-sparsify(1) has a new --tmp option allowing you to precisely
control where temporary files are stored.
virt-sparsify(1) can now write to a block device.
virt-customize(1) and virt-sysprep(1) now support adding firstboot
scripts to Windows guests.
virt-cat(1), virt-edit(1), virt-ls(1) now support the -m option,
allowing you to override automatic inspection of guests and instead
specify where to mount partitions (Pino Toscano).
The virt tools now have coloured output: green for OK, red for errors,
blue for warnings.
Language bindings
You can build a Python distribution using make -C python sdist
Ruby bindings have switched from Test::Unit to MiniTest.
The Java bindings are now compatible with OpenJDK 8 (Pino Toscano).
Inspection
Oracle Linux is returned as oraclelinux (Nikos Skalkotos).
Linux guests which do not have /etc/fstab can now be handled (Pino
Toscano).
Minix is returned as minix (Pino Toscano).
Architectures
Aarch64 (64 bit ARM) support has been added.
Inspection and the guestfs_file_architecture call can now recognize arm
(32 bit) and aarch64 guests.
Security
CVE-2014-0191 Network usage and entity resolution in XML parsing
Libguestfs previously used unsafe libxml2 APIs for parsing libvirt
XML. These APIs defaulted to allowing network connections to be made
when certain XML documents were presented. Using a malformed XML
document it was also possible to exhaust all CPU, memory or file
descriptors on the machine.
Since the libvirt XML comes from a trusted source (the libvirt
daemon) it is not thought that this could have been exploitable.
This was fixed in libguestfs ≥ 1.27.9 and the fix was backported to
stable versions ≥ 1.26.2, ≥ 1.24.9, ≥ 1.22.10 and ≥ 1.20.13. (Thanks:
Dan Berrange, Pino Toscano).
Shellshock (bash CVE-2014-6271)
This bash bug indirectly affects libguestfs. For more information
see:
https://www.redhat.com/archives/libguestfs/2014-September/msg00252.html
API
New APIs
guestfs_clear_backend_setting
guestfs_get_backend_setting
guestfs_set_backend_setting
Use these APIs to set individual backend settings.
guestfs_cpio_out
Convert a directory within the disk image to cpio format.
guestfs_journal_get_realtime_usec
Fetch precise journal times, see sd_journal_get_realtime_usec(3).
guestfs_lstatns
guestfs_lstatnslist
guestfs_statns
Enhanced versions of guestfs_lstat, guestfs_lstatlist, guestfs_stat
which return nanosecond timestamps.
Build changes
Libguestfs can now be built with qemu 2.x.
Add support for packaging the appliance on Mageia (Joseph Wang, Thierry
Vignaud).
Augeas is now a required dependency.
Flex and bison are now required dependencies.
Internals
User-Mode Linux (UML) is no longer a supported backend (although still
available). It will be supported again once someone steps in and fixes
various regressions and brokenness in the UML (Linux) kernel.
You can now connect gdb to qemu by specifying
LIBGUESTFS_BACKEND_SETTINGS=gdb
Serial BIOS (sgabios) is now used by the libvirt backend (on x86 only)
so that we see early BIOS messages.
For the OCaml virt tools, exceptions are now handled and printed by a
common function.
A GCC warning about large stack frames is now enabled by default.
Several places that used large arrays and structures on the stack have
been fixed.
There is now a test for booting the appliance repeatedly. Useful for
finding kernel leaks. See: tests/qemu/qemu-boot.c
There is a test for testing the speed of various qemu features such as
virtio-serial uploads and block device writes. See:
tests/qemu/qemu-speed-test.c
GCC warnings are now enabled for OCaml-C bindings in the OCaml virt
tools.
The code for editing files used by virt-edit(1), guestfish(1) edit
command, virt-customize(1) --edit option and more is now shared between
all these utilities (thanks Pino Toscano).
The FUSE tests were rewritten in C to ensure finer control over how
system calls are tested.
The update-bugs.sh script has been fixed so it should no longer create
an empty BUGS file if the Bugzilla server is unavailable.
The virt-resize(1) tests now use a stochastic method to ensure much
deeper and broader testing.
When the network is enabled, the appliance now uses DHCP to acquire an
IP address.
If libvirt is being used then the appliance will connect to virbr0 (can
be overridden by setting
LIBGUESTFS_BACKEND_SETTINGS=network_bridge=<some_bridge>). This enables
full-featured network connections, with working ICMP, ping and so on.
Bugs fixed
https://bugzilla.redhat.com/1153515
empty (but set) LIBGUESTFS_BACKEND prints libguestfs: error: invalid
backend:
https://bugzilla.redhat.com/1151766
libguestfs-bash-completion package contains file
/usr/share/bash-completion/completions/virt-log, but no _virt_log()
function in that file
https://bugzilla.redhat.com/1151738
typo error in man page of virt-edit
https://bugzilla.redhat.com/1151033
virt-v2v conversions from VMware vCenter server run slowly
https://bugzilla.redhat.com/1150880
virt-v2v: warning: display <graphics type='sdl'> was ignored when
converting rhel5 guest with sdl graphics
https://bugzilla.redhat.com/1150867
'copy-file-to-file /src /dest' create file /dest even if command
'copy-file-to-file /src /dest' failed
https://bugzilla.redhat.com/1150815
Can not find "RECURSIVE LONG LISTING" in 'man virt-diff'
https://bugzilla.redhat.com/1150701
virt-v2v does not fstrim data disks and non-mounted filesystems
https://bugzilla.redhat.com/1150475
Exporting 2+ disk guest to RHEV, only one disk shows after import
https://bugzilla.redhat.com/1148355
virt-filesystems: incorrect LVM vg name when listing Fedora 21 Alpha
Atomic image filesystems
https://bugzilla.redhat.com/1148072
Option missing --no-selinux-relabel
https://bugzilla.redhat.com/1148012
RFE: Allow qemu-bridge-helper to be used to implement
guestfs_set_network
https://bugzilla.redhat.com/1146815
virt-v2v prints warning: /files/etc/fstab/8/spec references unknown
device "cdrom"
https://bugzilla.redhat.com/1146275
regression setting root password with virt-builder/virt-customize
https://bugzilla.redhat.com/1146017
virt-v2v -v -x during windows guest conversion will hang at hivex:
hivex_open: used block id ……
https://bugzilla.redhat.com/1145995
Improve the error info when converting windows guest with unclean
file system
https://bugzilla.redhat.com/1145916
virt-v2v fails to convert win7 guest
https://bugzilla.redhat.com/1144891
RFE: stat calls do not return nanosecond timestamps
https://bugzilla.redhat.com/1144766
futimens() is a no-op via guestmount
https://bugzilla.redhat.com/1144201
guestfish can not restore terminal's output colour when exit
guestfish, if the terminal's background colour is black then it will
make a inconvenient
https://bugzilla.redhat.com/1143949
virt-customize option '--password-crypto' do not work
https://bugzilla.redhat.com/1143887
Warning shows when converting guests to rhev:chown: changing
ownership of ‘/tmp/v2v.u48xag/*.ovf’: Invalid argument
https://bugzilla.redhat.com/1143883
warning shows when converting rhel7 guest:virt-v2v:could not update
grub2 console: aug_get: no matching node (ignored)
https://bugzilla.redhat.com/1143866
virt-v2v fails with error: cannot open Packages index using db5
https://bugzilla.redhat.com/1142416
part-get-name give 'libguestfs: error: part_get_name: parted does not
support the machine output (-m)' error message when run
'part-get-name /dev/sda 1'
https://bugzilla.redhat.com/1142186
virt-sysprep option '--mount-options' don't work well
https://bugzilla.redhat.com/1142158
Illegal command 'part-get-name /dev/sda1 1' cause libguestfs
appliance crashed
https://bugzilla.redhat.com/1142004
virt-v2v prints waring:WARNING:/files/boot/grub/device.map references
unknown device "xvda"
https://bugzilla.redhat.com/1141723
virt-v2v: error: disk sda has no defined format shows when converting
xen hvm guest
https://bugzilla.redhat.com/1141680
[RFE] virt-v2 should support convert a domain with using domain's
UUID instead of domain name
https://bugzilla.redhat.com/1141631
[RFE] virt-v2 should support convert a guest to a dir-pool with using
pool's uuid
https://bugzilla.redhat.com/1141157
virt-sysprep option '--user-accounts' don't work well
https://bugzilla.redhat.com/1141145
virt-v2v fails to convert xen pv guests.
https://bugzilla.redhat.com/1141113
virt-v2v fails to convert esx guests
https://bugzilla.redhat.com/1140946
qemu-img shows error message for backing file twice
https://bugzilla.redhat.com/1140894
No error messages output if append '--format qcow2' after '-a
guest.img', guest.img is a raw format image file
https://bugzilla.redhat.com/1140547
virt-builder option '--format' don't work well
https://bugzilla.redhat.com/1140156
RFE: Export to RHEV data domain
https://bugzilla.redhat.com/1140050
No error shows when multiple conflicting options used with virt-v2v
https://bugzilla.redhat.com/1139973
Improve the error info when converting xen guest with no passwordless
SSH access configured
https://bugzilla.redhat.com/1139543
Improve the error info when converting guest with no space left
https://bugzilla.redhat.com/1138586
No error shows when converting running guest with virt-v2v
https://bugzilla.redhat.com/1138184
virt-v2v will fail when converting guests with initramfs-*kdump.img
under /boot
https://bugzilla.redhat.com/1138182
xen guest will be kernel panic after converted by virt-v2v
https://bugzilla.redhat.com/1130189
Annoying message about permissions of /dev/kvm
https://bugzilla.redhat.com/1123007
libguestfs 'direct' backend should close file descriptors before
exec-ing qemu to avoid leaking !O_CLOEXEC fds
https://bugzilla.redhat.com/1122557
virt-sparsify overwrites block devices if used as output files
https://bugzilla.redhat.com/1113156
Empty fstab breaks libguestfs inspection
https://bugzilla.redhat.com/1111662
Guestfs.Error("vgchange_uuid_all: Volume group has active logical
volumes")
https://bugzilla.redhat.com/1109174
virt-win-reg manual page is corrupted
https://bugzilla.redhat.com/1106548
root gets an error accessing to a non-root dir on a snapshot
guestmount VMDK img
https://bugzilla.redhat.com/1103877
These APIs also need to add to `guestfish -h` command list
https://bugzilla.redhat.com/1102448
mageia package list is incorrect
https://bugzilla.redhat.com/1102447
libguestfs 1.27.13 does not build due to libxml library order
https://bugzilla.redhat.com/1100498
RFE: non-polling mechanism to detect guestmount --no-fork readiness
https://bugzilla.redhat.com/1099490
scrub-file can't handle link file
https://bugzilla.redhat.com/1099284
typo errors in man pages
https://bugzilla.redhat.com/1098718
RFE: virt-builder aliases
https://bugzilla.redhat.com/1096465
virt-builder "proxy=off" setting doesn't turn off the proxy for
downloads
https://bugzilla.redhat.com/1094746
virt-sparsify man failes to mention what happens to snapshots within
a qcow2 image (they are discarded)
https://bugzilla.redhat.com/1092753
virt-builder: If several repos contain the same os-version images,
then they are duplicated in -l output
https://bugzilla.redhat.com/1091803
tar-in-opts execute failed that cause libguestfs appliance crashed
https://bugzilla.redhat.com/1088424
virt-resize: libguestfs error: part_set_name: parted: /dev/sdb: Error
during translation: Invalid or incomplete multibyte or wide character
https://bugzilla.redhat.com/1088262
virt-builder cannot write to a block device
https://bugzilla.redhat.com/1085029
Ruby tests fail with latest Ruby
https://bugzilla.redhat.com/1079210
virt-sparsify --in-place cannot sparsify as much as it should
https://bugzilla.redhat.com/1079182
virt-df cannot report used disk space of windows guest when updated
to 6.5
https://bugzilla.redhat.com/1077817
virt-builder error: "syntax error at line 3: syntax error"
https://bugzilla.redhat.com/1056290
virt-sparsify overwrites block devices if used as output files
https://bugzilla.redhat.com/812970
virt-rescue cannot set ≥<rescue> prompt, on Ubuntu 12.04
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines. Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v
10 years, 1 month
[libvirt] [PATCH] tests: Adding SELINUX_LIBS to fix viridentitytest linker bug.
by Julio Faracco
Recently, I tryed to recompile libvirt in a clean build system, but the
process failed when it tryed to compile the test v:iridentitytest. See the
error below:
[...]
CC viridentitytest.o
CCLD viridentitytest
/usr/bin/ld: viridentitytest.o: undefined reference to symbol
'security_disable'
//lib/x86_64-linux-gnu/libselinux.so.1: error adding symbols: DSO missing
from command line
collect2: error: ld returned 1 exit status
make: *** [viridentitytest] Error 1
So, adding the variable SELINUX_LIBS in viridentitytest rules solved the
issue.
Signed-off-by: Julio Faracco <jcfaracco(a)gmail.com>
---
tests/Makefile.am | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 4c3d4ef..363c902 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -926,11 +926,13 @@ virstoragetest_LDADD = $(LDADDS) \
viridentitytest_SOURCES = \
viridentitytest.c testutils.h testutils.c
-viridentitytest_LDADD = $(LDADDS)
if WITH_SELINUX
+viridentitytest_LDADD = $(LDADDS) $(SELINUX_LIBS)
viridentitytest_DEPENDENCIES = libsecurityselinuxhelper.la \
../src/libvirt.la
-endif WITH_SELINUX
+else ! WITH_SELINUX
+viridentitytest_LDADD = $(LDADDS)
+endif ! WITH_SELINUX
viriscsitest_SOURCES = \
viriscsitest.c testutils.h testutils.c
--
1.9.1
10 years, 1 month
[libvirt] [PATCHv2 0/4] Another attempt at improving virsh autocompletion
by Solly Ross
Version 2: Electric Boogaloo
Version 1: https://www.redhat.com/archives/libvir-list/2014-March/msg01898.html
This version of the patch introduces the following new things:
- Tests (a whole bunch of them, in fact)!
- A new `complete` command to run get newline-separated
completion results from the command line
- Support for completing partial quotes
(e.g. `virsh complete "fake-command ab \"i "`)
- Passing the syntax checks (sorry about that)
A brief overview of the patch set follows:
1. Extract parsing logic from the vshCommandParse
so that it can be used elsewhere. The new method
returns states and sets passed in pointers. Calling
methods can interpret these states and deal with them
as needed (completion ignores many, while
vshCommandParse throws errors).
2. Implement (and test!) an improved completion
engine with support for virsh quoting rules,
flags, positional arguments, no duplication,
and more.
3. Add (and test!) a method for retrieve a global
vshControl object should readline be enabled. This
allows for "smart completion" of options like "domain".
4. Extract the domain listing code from virsh-domain-monitor,
and move it to virsh-completer. Implement a domain completer,
which is then used for all the cases of "domain" options
(note that it current does not have any flags specified for
which commands should list active vs inactive domains,
as this commit is mainly to allow people to test out
"smart completion")
Solly Ross (4):
Improve virsh autocompletion (extract parser)
Improve virsh autocompletion (base framework)
Improve virsh autocompletion (global ctl object)
Improve virsh autocompletion (domain completer)
po/POTFILES.in | 1 +
tests/virshtest.c | 268 +++++++++++++
tools/Makefile.am | 3 +-
tools/virsh-completer.c | 355 +++++++++++++++++
tools/virsh-completer.h | 85 +++++
tools/virsh-domain-monitor.c | 287 +-------------
tools/virsh-domain.c | 72 ++++
tools/virsh-snapshot.c | 11 +
tools/virsh.c | 880 +++++++++++++++++++++++++++++++++++++------
tools/virsh.h | 20 +
10 files changed, 1582 insertions(+), 400 deletions(-)
create mode 100644 tools/virsh-completer.c
create mode 100644 tools/virsh-completer.h
--
1.8.3.2
10 years, 1 month
[libvirt] [PATCH 0/4] Enable spapr-pci-vfio-host-bridge controllers for VFIO passthrough support
by Shivaprasad G Bhat
The following series of patches enable spapr-pci-vfio-host-bridge
controllers on PPC64-pseries machine which is required for supporting
host device passthrough using VFIO.
There were some initial enablement work on the same at
http://www.redhat.com/archives/libvir-list/2013-September/msg00838.html.
The testing revealed contrasting observations and the current patch series
solve the same.
Unlike other architectures, on pseries(ppc64) the vfio host devices(will refer
as hostdevs here on) cannot be assigned to the default emulated pci-host-
bus controller(like the default pci.0).
On pseries, the hostdevs goto spapr-pci-vfio-host-bridge. The hostdevs
belonging to the same iommu group share the same spapr-pci-vfio-host-bridge.
Henceforth, new spapr-pci-host-bridge needs to be added for every hostdev
belonging to any new iommu group. The hostdevs appear in new pci domain inside
the guest.
The spapr-pci-vfio-host-bridge is a generic bridge and it can host both
pci and pci-e host devices. The model pci-root is chosen for this controller
just for convenience.
The patch series take care to add the new controller. Each new controller
creates up a new pci domain in the guest. Every hostdev get their pci address in the
relavent domain.
Tha patch series take care of device addressing in passthrough hostdevs,
SR-IOV interfaces and network interface from SRIOV virtual function pools.
---
Shivaprasad G Bhat (4):
qemu: Add SPAPR_VFIO_HOST_BRIDGE capability for PPC platform
qemu: parse and add spapr-vfio-pci controller into domain
qemu: assign addresses for spapr vfio hostdevices and generate cli
qemu: add test case for spapr-pci-vfio-host-bridge
docs/schemas/domaincommon.rng | 28 ++
src/bhyve/bhyve_domain.c | 2
src/conf/domain_addr.c | 8 -
src/conf/domain_addr.h | 1
src/conf/domain_conf.c | 149 ++++++++++-
src/conf/domain_conf.h | 19 +
src/libvirt_private.syms | 2
src/qemu/qemu_capabilities.c | 2
src/qemu/qemu_capabilities.h | 1
src/qemu/qemu_command.c | 279 +++++++++++++++++++-
src/qemu/qemu_command.h | 17 +
src/qemu/qemu_domain.c | 12 -
src/qemu/qemu_driver.c | 6
tests/qemuhotplugtest.c | 2
.../qemuxml2argv-hostdev-spapr-vfio.args | 16 +
.../qemuxml2argv-hostdev-spapr-vfio.xml | 76 +++++
tests/qemuxml2argvtest.c | 8 +
17 files changed, 591 insertions(+), 37 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hostdev-spapr-vfio.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hostdev-spapr-vfio.xml
--
Signature
10 years, 1 month
[libvirt] Tunneled migration failures
by Gary Hook
So here¹s the thing:
I have an environment running without tunneling. I can move a modestly
sized (3.2GB disk space, 2GB RAM) VM back and forth between two systems
all day long, using peer-peer migration, with these flags set:
VIR_MIGRATE_UNDEFINE_SOURCE
VIR_MIGRATE_PEER2PEER
VIR_MIGRATE_PERSIST_DEST
VIR_MIGRATE_NON_SHARED_INC
By invoking libvirt_domain_migrate_to_uri2() in libvirt-php via apache. We
are not using shared storage, but as stated, the function invocations and
XML appear to be correct insofar as non-tunneled migrations are successful.
As soon as I enable tunneling by adding the VIR_MIGRATE_TUNNELLED to the
above options, the migration fails with this debug message:
qemuMigrationUpdateJobStatus:1788 : operation failed: migration job:
unexpectedly failed
Not very helpful. This is with no other changes to the invoking code.
I have been _trying_ to track down the source of the failure, and in so
doing I have increased the arbitrary timeout value in qemu_domain.c from
30 to 100 seconds. The copy of the disk is successful; nabbing a copy and
booting it in an alternate VM works just fine, so I have every reason to
believe that the disk is being migrated properly.
That said, what I need is to understand how to trace the monitoring thread
over on the destination, to understand where and why it is returning an
error to the source host. The debug output is silent on finding and error
and sending it back to the source system. I¹ve been instrumenting the
calls in src/qemu, but haven¹t located the right code.
A pointer to where I should be looking would be helpful. I can provide
much more detail from tracing (that I have had to add to the code) on the
source side, but the destination side log entries get to virStreamFinish()
and then the thread exits while the sender gets an error back. Ostensibly
from another thread. The migration gets cancelled for no obvious reason,
from no obvious source.
Here¹s the kicker: this exact same scenario using a smaller VM (1.5GB
disk, 2GB RAM) succeeds.
The issue appears to be related to VM size and timeout values?
Again, if a developer could provide a pointer to how I might trace the
monitoring thread on the destination side, that¹d be great.
Thanks in advance.
Gary
10 years, 1 month
[libvirt] [PATCH] fix storage volume creation error messages
by Adam Spiers
It seems that raising of error messages associated with creation of
storage volumes contained copy'n'paste errors due to the code being
copied from network creation code.
Signed-off-by: Adam Spiers <aspiers(a)suse.com>
---
ext/libvirt/storage.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ext/libvirt/storage.c b/ext/libvirt/storage.c
index a01edbc..1703aaf 100644
--- a/ext/libvirt/storage.c
+++ b/ext/libvirt/storage.c
@@ -498,7 +498,7 @@ static VALUE libvirt_storage_pool_create_volume_xml(int argc, VALUE *argv,
vol = virStorageVolCreateXML(pool_get(p), StringValueCStr(xml),
ruby_libvirt_value_to_uint(flags));
- ruby_libvirt_raise_error_if(vol == NULL, e_Error, "virNetworkCreateXML",
+ ruby_libvirt_raise_error_if(vol == NULL, e_Error, "virStorageVolCreateXML",
ruby_libvirt_connect_get(p));
return vol_new(vol, ruby_libvirt_conn_attr(p));
@@ -525,7 +525,7 @@ static VALUE libvirt_storage_pool_create_volume_xml_from(int argc, VALUE *argv,
vol_get(cloneval),
ruby_libvirt_value_to_uint(flags));
ruby_libvirt_raise_error_if(vol == NULL, e_Error,
- "virNetworkCreateXMLFrom",
+ "virStorageVolCreateXMLFrom",
ruby_libvirt_connect_get(p));
return vol_new(vol, ruby_libvirt_conn_attr(p));
--
2.1.2.330.g565301e
10 years, 1 month