[libvirt] regression ?
by Harsh Bora
Hi, I was testing an under-development patch on upstream libvirt using
domxml-to-native and domxml-from-native and realised that the
domxml-from-native fails for a successfully generated qemu cmd line
using domxml-to-native.
To isolate the issue, I tried generating the qemu cmd line for
tests/qemuxml2argvdata/qemuxml2argv-disk-virtio.xml like this:
$virsh domxml-to-native qemu-argv
tests/qemuxml2argvdata/qemuxml2argv-disk-virtio.xml > qemu-args
Now, when I try to generate the XML back for the same CLI, it fails:
$virsh domxml-from-native qemu-argv qem-args
error: internal error missing index/unit/bus parameter in drive
'file=/dev/HostVG/QEMUGuest1,if=none,id=drive-ide0-0-0,format=raw'
Does anyone have any idea, what could be causing this ?
regards,
Harsh
12 years, 5 months
[libvirt] [PATCH] virsh: Use virXPath wrappers for vncdisplay cmd
by Doug Goldstein
Update the vncdisplay command to use the virXPath wrappers as well as
check if the domain is up rather than using the port set to -1 to mean
the domain is not up.
Signed-off-by: Doug Goldstein <cardoe(a)cardoe.com>
---
tools/virsh.c | 30 +++++++++++++++---------------
1 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c
index 0354822..a6649f4 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -13844,12 +13844,12 @@ static bool
cmdVNCDisplay(vshControl *ctl, const vshCmd *cmd)
{
xmlDocPtr xml = NULL;
- xmlXPathObjectPtr obj = NULL;
xmlXPathContextPtr ctxt = NULL;
virDomainPtr dom;
bool ret = false;
int port = 0;
char *doc;
+ char *listen_addr;
if (!vshConnectionUsability(ctl, ctl->conn))
return false;
@@ -13857,6 +13857,12 @@ cmdVNCDisplay(vshControl *ctl, const vshCmd *cmd)
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
return false;
+ /* Check if the domain is active and don't rely on -1 for this */
+ if (!virDomainIsActive(dom)) {
+ vshError(ctl, _("Domain is not running"));
+ goto cleanup;
+ }
+
doc = virDomainGetXMLDesc(dom, 0);
if (!doc)
goto cleanup;
@@ -13866,29 +13872,23 @@ cmdVNCDisplay(vshControl *ctl, const vshCmd *cmd)
if (!xml)
goto cleanup;
- obj = xmlXPathEval(BAD_CAST "string(/domain/devices/graphics[@type='vnc']/@port)", ctxt);
- if (obj == NULL || obj->type != XPATH_STRING ||
- obj->stringval == NULL || obj->stringval[0] == 0) {
+ /* Get the VNC port */
+ if (virXPathInt("string(/domain/devices/graphics[@type='vnc']/@port)",
+ ctxt, &port)) {
+ vshError(ctl, _("Failed to get VNC port. Is this domain using VNC?"));
goto cleanup;
}
- if (virStrToLong_i((const char *)obj->stringval, NULL, 10, &port) || port < 0)
- goto cleanup;
- xmlXPathFreeObject(obj);
- obj = xmlXPathEval(BAD_CAST "string(/domain/devices/graphics[@type='vnc']/@listen)", ctxt);
- if (obj == NULL || obj->type != XPATH_STRING ||
- obj->stringval == NULL || obj->stringval[0] == 0 ||
- STREQ((const char*)obj->stringval, "0.0.0.0")) {
+ listen_addr = virXPathString("string(/domain/devices/graphics"
+ "[@type='vnc']/@listen)", ctxt);
+ if (listen_addr == NULL || STREQ((const char *)listen_addr, "0.0.0.0")) {
vshPrint(ctl, ":%d\n", port-5900);
} else {
- vshPrint(ctl, "%s:%d\n", (const char *)obj->stringval, port-5900);
+ vshPrint(ctl, "%s:%d\n", (const char *)listen_addr, port-5900);
}
- xmlXPathFreeObject(obj);
- obj = NULL;
ret = true;
cleanup:
- xmlXPathFreeObject(obj);
xmlXPathFreeContext(ctxt);
xmlFreeDoc(xml);
virDomainFree(dom);
--
1.7.3.4
12 years, 5 months
[libvirt] [PATCH] Add support for guest bind mounts with LXC
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
Currently you can configure LXC to bind a host directory to
a guest directory, but not to bind a guest directory to a
guest directory. While the guest container init could do
this itself, allowing it in the libvirt XML means a stricter
SELinux policy can be written
---
src/conf/domain_conf.c | 7 +++++--
src/conf/domain_conf.h | 11 ++++++-----
src/lxc/lxc_container.c | 7 +++++++
3 files changed, 18 insertions(+), 7 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index a653fe6..8ce122e 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -263,7 +263,8 @@ VIR_ENUM_IMPL(virDomainFS, VIR_DOMAIN_FS_TYPE_LAST,
"block",
"file",
"template",
- "ram")
+ "ram",
+ "bind")
VIR_ENUM_IMPL(virDomainFSDriverType, VIR_DOMAIN_FS_DRIVER_TYPE_LAST,
"default",
@@ -4260,7 +4261,8 @@ virDomainFSDefParseXML(xmlNodePtr node,
if (!source &&
xmlStrEqual(cur->name, BAD_CAST "source")) {
- if (def->type == VIR_DOMAIN_FS_TYPE_MOUNT)
+ if (def->type == VIR_DOMAIN_FS_TYPE_MOUNT ||
+ def->type == VIR_DOMAIN_FS_TYPE_BIND)
source = virXMLPropString(cur, "dir");
else if (def->type == VIR_DOMAIN_FS_TYPE_FILE)
source = virXMLPropString(cur, "file");
@@ -11335,6 +11337,7 @@ virDomainFSDefFormat(virBufferPtr buf,
switch (def->type) {
case VIR_DOMAIN_FS_TYPE_MOUNT:
+ case VIR_DOMAIN_FS_TYPE_BIND:
virBufferEscapeString(buf, " <source dir='%s'/>\n",
def->src);
break;
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index b8d9c87..bdb1f75 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -656,11 +656,12 @@ struct _virDomainControllerDef {
/* Two types of disk backends */
enum virDomainFSType {
- VIR_DOMAIN_FS_TYPE_MOUNT, /* Better named 'bind' */
- VIR_DOMAIN_FS_TYPE_BLOCK,
- VIR_DOMAIN_FS_TYPE_FILE,
- VIR_DOMAIN_FS_TYPE_TEMPLATE,
- VIR_DOMAIN_FS_TYPE_RAM,
+ VIR_DOMAIN_FS_TYPE_MOUNT, /* Mounts (binds) a host dir on a guest dir */
+ VIR_DOMAIN_FS_TYPE_BLOCK, /* Mounts a host block dev on a guest dir */
+ VIR_DOMAIN_FS_TYPE_FILE, /* Loopback mounts a host file on a guest dir */
+ VIR_DOMAIN_FS_TYPE_TEMPLATE, /* Expands a OS template to a guest dir */
+ VIR_DOMAIN_FS_TYPE_RAM, /* Mount a RAM filesystem on a guest dir */
+ VIR_DOMAIN_FS_TYPE_BIND, /* Binds a guest dir to another guest dir */
VIR_DOMAIN_FS_TYPE_LAST
};
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index b69255e..bf67ba1 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -1025,7 +1025,14 @@ static int lxcContainerMountFS(virDomainFSDefPtr fs,
if (lxcContainerMountFSTmpfs(fs) < 0)
return -1;
break;
+ case VIR_DOMAIN_FS_TYPE_BIND:
+ if (lxcContainerMountFSBind(fs, "") < 0)
+ return -1;
+ break;
case VIR_DOMAIN_FS_TYPE_FILE:
+ /* We do actually support this, but the lxc controller
+ * should have associated the file with a loopback
+ * device and changed this to TYPE_BLOCK for us */
lxcError(VIR_ERR_INTERNAL_ERROR,
_("Unexpected filesystem type %s"),
virDomainFSTypeToString(fs->type));
--
1.7.10.2
12 years, 5 months
[libvirt] [PATCH] qemu: Support attaching controller device persistently
by Osier Yang
src/conf/domain_conf.*: (Introduce virDomainControllerFind)
src/libvirt_private.syms: (Add virDomainControllerFind to private symbol)
src/qemu/qemu_driver.c: (Use of virDomainControllerFind)
src/qemu/qemu_driver.c: (Support attaching controller device persistently)
---
src/conf/domain_conf.c | 17 +++++++++++++++++
src/conf/domain_conf.h | 2 +-
src/libvirt_private.syms | 1 +
src/qemu/qemu_driver.c | 17 +++++++++++++++++
src/qemu/qemu_hotplug.c | 14 +++++---------
5 files changed, 41 insertions(+), 10 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 4651765..f2e8271 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -7520,6 +7520,23 @@ void virDomainControllerInsertPreAlloced(virDomainDefPtr def,
def->ncontrollers++;
}
+bool
+virDomainControllerFind(virDomainDefPtr def,
+ virDomainControllerDefPtr controller)
+{
+ int i;
+ bool found = false;
+
+ for (i = 0 ; i < def->ncontrollers ; i++) {
+ if ((def->controllers[i]->type == controller->type) &&
+ (def->controllers[i]->idx == controller->idx)) {
+ found = true;
+ break;
+ }
+ }
+
+ return found;
+}
int virDomainLeaseIndex(virDomainDefPtr def,
virDomainLeaseDefPtr lease)
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 3712785..f7e7dca 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2036,7 +2036,7 @@ int virDomainControllerInsert(virDomainDefPtr def,
virDomainControllerDefPtr controller);
void virDomainControllerInsertPreAlloced(virDomainDefPtr def,
virDomainControllerDefPtr controller);
-
+bool virDomainControllerFind(virDomainDefPtr def, virDomainControllerDefPtr controller);
int virDomainLeaseIndex(virDomainDefPtr def,
virDomainLeaseDefPtr lease);
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 2fe5068..a75086b 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -263,6 +263,7 @@ virDomainClockOffsetTypeFromString;
virDomainClockOffsetTypeToString;
virDomainConfigFile;
virDomainControllerDefFree;
+virDomainControllerFind;
virDomainControllerInsert;
virDomainControllerInsertPreAlloced;
virDomainControllerModelSCSITypeFromString;
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 2177c30..5713650 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -5529,6 +5529,7 @@ qemuDomainAttachDeviceConfig(virDomainDefPtr vmdef,
virDomainNetDefPtr net;
virDomainHostdevDefPtr hostdev;
virDomainLeaseDefPtr lease;
+ virDomainControllerDefPtr controller;
switch (dev->type) {
case VIR_DOMAIN_DEVICE_DISK:
@@ -5600,6 +5601,22 @@ qemuDomainAttachDeviceConfig(virDomainDefPtr vmdef,
dev->data.lease = NULL;
break;
+ case VIR_DOMAIN_DEVICE_CONTROLLER:
+ controller = dev->data.controller;
+ if (virDomainControllerFind(vmdef, controller)) {
+ qemuReportError(VIR_ERR_INVALID_ARG,
+ _("Target already exists"));
+ return -1;
+ }
+
+ if (virDomainControllerInsert(vmdef, controller) < 0)
+ return -1;
+ dev->data.controller = NULL;
+
+ if (qemuDomainAssignAddresses(vmdef) < 0)
+ return -1;
+ break;
+
default:
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("persistent attach of device is not supported"));
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index c2fa75b..a9d9ff9 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -308,21 +308,17 @@ int qemuDomainAttachPciControllerDevice(struct qemud_driver *driver,
virDomainObjPtr vm,
virDomainControllerDefPtr controller)
{
- int i;
int ret = -1;
const char* type = virDomainControllerTypeToString(controller->type);
char *devstr = NULL;
qemuDomainObjPrivatePtr priv = vm->privateData;
bool releaseaddr = false;
- for (i = 0 ; i < vm->def->ncontrollers ; i++) {
- if ((vm->def->controllers[i]->type == controller->type) &&
- (vm->def->controllers[i]->idx == controller->idx)) {
- qemuReportError(VIR_ERR_OPERATION_FAILED,
- _("target %s:%d already exists"),
- type, controller->idx);
- return -1;
- }
+ if (virDomainControllerFind(vm->def, controller)) {
+ qemuReportError(VIR_ERR_OPERATION_FAILED,
+ _("target %s:%d already exists"),
+ type, controller->idx);
+ return -1;
}
if (qemuCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
--
1.7.7.3
12 years, 5 months
[libvirt] [PATCH] Add support for RAM filesystems for LXC
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
Introduce a new syntax for filesystems to allow use of a RAM
filesystem
<filesystem type='ram'>
<source usage='10' units='MiB'/>
<target dir='/mnt'/>
</filesystem>
The usage units default to KiB to limit consumption of host memory.
* docs/formatdomain.html.in: Document new syntax
* docs/schemas/domaincommon.rng: Add new attributes
* src/conf/domain_conf.c: Parsing/formatting of RAM filesystems
* src/lxc/lxc_container.c: Mounting of RAM filesystems
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
docs/formatdomain.html.in | 9 ++++++-
docs/schemas/domaincommon.rng | 18 +++++++++++++
src/conf/domain_conf.c | 58 +++++++++++++++++++++++++++--------------
src/conf/domain_conf.h | 5 ++++
src/lxc/lxc_container.c | 49 ++++++++++++++++++++++++++++++++++
5 files changed, 118 insertions(+), 21 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 1f30772..99ca26e 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -1630,6 +1630,12 @@
format will be autodetected. Only used by LXC driver
<span class="since">(since 0.9.5)</span>.
</dd>
+ <dt><code>type='ram'</code></dt>
+ <dd>
+ An in-memory filesystem, using memory from the host OS.
+ The source element has a single attribute <code>usage</code>
+ which gives the memory usage limit in kibibytes.
+ <span class="since"> (since 0.9.13)</span></dd>
</dl>
The filesystem block has an optional attribute <code>accessmode</code>
@@ -1669,7 +1675,8 @@
The resource on the host that is being accessed in the guest. The
<code>name</code> attribute must be used with
<code>type='template'</code>, and the <code>dir</code> attribute must
- be used with <code>type='mount'</code>
+ be used with <code>type='mount'</code>. The <code>usage</code> attribute
+ is used with <code>type='ram'</code> to set the memory limit in KB.
</dd>
<dt><code>target</code></dt>
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 46e539d..4a04a65 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -1289,6 +1289,24 @@
</element>
</interleave>
</group>
+ <group>
+ <attribute name="type">
+ <value>ram</value>
+ </attribute>
+ <interleave>
+ <element name="source">
+ <attribute name="usage">
+ <ref name="unsignedLong"/>
+ </attribute>
+ <optional>
+ <attribute name='unit'>
+ <ref name='unit'/>
+ </attribute>
+ </optional>
+ <empty/>
+ </element>
+ </interleave>
+ </group>
</choice>
<interleave>
<element name="target">
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 5ea264f..a653fe6 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -262,7 +262,8 @@ VIR_ENUM_IMPL(virDomainFS, VIR_DOMAIN_FS_TYPE_LAST,
"mount",
"block",
"file",
- "template")
+ "template",
+ "ram")
VIR_ENUM_IMPL(virDomainFSDriverType, VIR_DOMAIN_FS_DRIVER_TYPE_LAST,
"default",
@@ -4210,6 +4211,7 @@ virDomainFSDefParseXML(xmlNodePtr node,
char *target = NULL;
char *accessmode = NULL;
char *wrpolicy = NULL;
+ char *usage = NULL;
ctxt->node = node;
@@ -4297,7 +4299,8 @@ virDomainFSDefParseXML(xmlNodePtr node,
def->wrpolicy = VIR_DOMAIN_FS_WRPOLICY_DEFAULT;
}
- if (source == NULL) {
+ if (source == NULL &&
+ def->type != VIR_DOMAIN_FS_TYPE_RAM) {
virDomainReportError(VIR_ERR_NO_SOURCE,
target ? "%s" : NULL, target);
goto error;
@@ -4309,6 +4312,16 @@ virDomainFSDefParseXML(xmlNodePtr node,
goto error;
}
+ if (def->type == VIR_DOMAIN_FS_TYPE_RAM) {
+ def->usage = VIR_DOMAIN_FS_RAM_DEFAULT_USAGE;
+ if (virDomainParseScaledValue("./source[0]", ctxt,
+ &def->usage,
+ 1024,
+ ULONG_LONG_MAX,
+ false) < 0)
+ goto error;
+ }
+
def->src = source;
source = NULL;
def->dst = target;
@@ -4325,6 +4338,7 @@ cleanup:
VIR_FREE(source);
VIR_FREE(accessmode);
VIR_FREE(wrpolicy);
+ VIR_FREE(usage);
return def;
@@ -11319,27 +11333,31 @@ virDomainFSDefFormat(virBufferPtr buf,
virBufferAddLit(buf, "/>\n");
}
- if (def->src) {
- switch (def->type) {
- case VIR_DOMAIN_FS_TYPE_MOUNT:
- virBufferEscapeString(buf, " <source dir='%s'/>\n",
- def->src);
- break;
+ switch (def->type) {
+ case VIR_DOMAIN_FS_TYPE_MOUNT:
+ virBufferEscapeString(buf, " <source dir='%s'/>\n",
+ def->src);
+ break;
- case VIR_DOMAIN_FS_TYPE_BLOCK:
- virBufferEscapeString(buf, " <source dev='%s'/>\n",
- def->src);
- break;
+ case VIR_DOMAIN_FS_TYPE_BLOCK:
+ virBufferEscapeString(buf, " <source dev='%s'/>\n",
+ def->src);
+ break;
- case VIR_DOMAIN_FS_TYPE_FILE:
- virBufferEscapeString(buf, " <source file='%s'/>\n",
- def->src);
- break;
+ case VIR_DOMAIN_FS_TYPE_FILE:
+ virBufferEscapeString(buf, " <source file='%s'/>\n",
+ def->src);
+ break;
- case VIR_DOMAIN_FS_TYPE_TEMPLATE:
- virBufferEscapeString(buf, " <source name='%s'/>\n",
- def->src);
- }
+ case VIR_DOMAIN_FS_TYPE_TEMPLATE:
+ virBufferEscapeString(buf, " <source name='%s'/>\n",
+ def->src);
+ break;
+
+ case VIR_DOMAIN_FS_TYPE_RAM:
+ virBufferAsprintf(buf, " <source usage='%lld' units='KiB'/>\n",
+ def->usage);
+ break;
}
virBufferEscapeString(buf, " <target dir='%s'/>\n",
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 86c1e63..b8d9c87 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -660,6 +660,7 @@ enum virDomainFSType {
VIR_DOMAIN_FS_TYPE_BLOCK,
VIR_DOMAIN_FS_TYPE_FILE,
VIR_DOMAIN_FS_TYPE_TEMPLATE,
+ VIR_DOMAIN_FS_TYPE_RAM,
VIR_DOMAIN_FS_TYPE_LAST
};
@@ -690,11 +691,15 @@ enum virDomainFSWrpolicy {
VIR_DOMAIN_FS_WRPOLICY_LAST
};
+/* Allow 2 MB ram usage */
+#define VIR_DOMAIN_FS_RAM_DEFAULT_USAGE (1024 * 2)
+
struct _virDomainFSDef {
int type;
int fsdriver;
int accessmode;
int wrpolicy; /* enum virDomainFSWrpolicy */
+ unsigned long long usage;
char *src;
char *dst;
unsigned int readonly : 1;
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index 24b1017..b69255e 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -335,6 +335,8 @@ static int lxcContainerPivotRoot(virDomainFSDefPtr root)
ret = -1;
+ VIR_DEBUG("Pivot via %s", root->src);
+
/* root->parent must be private, so make / private. */
if (mount("", "/", NULL, MS_PRIVATE|MS_REC, NULL) < 0) {
virReportSystemError(errno, "%s",
@@ -966,6 +968,47 @@ cleanup:
}
+static int lxcContainerMountFSTmpfs(virDomainFSDefPtr fs)
+{
+ int ret = -1;
+ char *data = NULL;
+
+ if (virAsprintf(&data, "size=%lldk", fs->usage) < 0) {
+ virReportOOMError();
+ goto cleanup;
+ }
+
+ if (virFileMakePath(fs->dst) < 0) {
+ virReportSystemError(errno,
+ _("Failed to create %s"),
+ fs->dst);
+ goto cleanup;
+ }
+
+ if (mount("tmpfs", fs->dst, "tmpfs", MS_NOSUID|MS_NODEV, data) < 0) {
+ virReportSystemError(errno,
+ _("Failed to mount directory %s as tmpfs"),
+ fs->dst);
+ goto cleanup;
+ }
+
+ if (fs->readonly) {
+ VIR_DEBUG("Binding %s readonly", fs->dst);
+ if (mount(fs->dst, fs->dst, NULL, MS_BIND|MS_REMOUNT|MS_RDONLY, NULL) < 0) {
+ virReportSystemError(errno,
+ _("Failed to make directory %s readonly"),
+ fs->dst);
+ }
+ }
+
+ ret = 0;
+
+cleanup:
+ VIR_FREE(data);
+ return ret;
+}
+
+
static int lxcContainerMountFS(virDomainFSDefPtr fs,
const char *srcprefix)
{
@@ -978,6 +1021,10 @@ static int lxcContainerMountFS(virDomainFSDefPtr fs,
if (lxcContainerMountFSBlock(fs, srcprefix) < 0)
return -1;
break;
+ case VIR_DOMAIN_FS_TYPE_RAM:
+ if (lxcContainerMountFSTmpfs(fs) < 0)
+ return -1;
+ break;
case VIR_DOMAIN_FS_TYPE_FILE:
lxcError(VIR_ERR_INTERNAL_ERROR,
_("Unexpected filesystem type %s"),
@@ -1441,6 +1488,8 @@ static int lxcContainerResolveSymlinks(virDomainDefPtr vmDef)
for (i = 0 ; i < vmDef->nfss ; i++) {
virDomainFSDefPtr fs = vmDef->fss[i];
+ if (!fs->src)
+ continue;
if (virFileResolveAllLinks(fs->src, &newroot) < 0)
return -1;
--
1.7.10.2
12 years, 5 months
[libvirt] [PATCH] [libvirt-test-API] modify test dir and log dir path in autotest.
by Lin Qing
In autotest,test dir match test class name,which should be
'libvirt_test_api'
for libvirt-test-api test suit.And the default tar extract is 'src'.So
we should
modify the autotest_testdir as 'tests/libvirt_test_api',and autotetst
log dir as
'tests/libvirt_test_api/src/log'.Otherwise,libvirt-test-api can not work in
autotest.
Signed-off-by: Qing Lin<qinglbj(a)linux.vnet.ibm.com>
Signed-off-by: Li Zhang<zhlcindy(a)linux.vnet.ibm.com>
---
libvirt-test-api | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libvirt-test-api b/libvirt-test-api
index cec7679..017343c 100755
--- a/libvirt-test-api
+++ b/libvirt-test-api
@@ -141,8 +141,8 @@ class Main(object):
testid = logname[-3:]
log_xml_parser.add_test_xml(testrunid, testid)
if os.environ.has_key('AUTODIR'):
- autotest_testdir =
os.path.join(os.environ['AUTODIR'],'tests/libvirt_test_API')
- logfile = os.path.join('%s/libvirt-test-API/log/%s' %
(autotest_testdir, testrunid), logname)
+ autotest_testdir =
os.path.join(os.environ['AUTODIR'],'tests/libvirt_test_api')
+ logfile = os.path.join('%s/src/log/%s' %
(autotest_testdir, testrunid), logname)
else:
logfile = os.path.join('log/%s' % testrunid, logname)
procs.append(generator.FuncGen(cases_func_ref_dict,
--
1.7.10.2
12 years, 5 months
[libvirt] libvirtd deadlock on shutdown
by Jim Fehlig
I'm looking into a libvirtd deadlock on daemon shutdown. The deadlock
occurs when shutting down virNetServer. If the handling of a job is in
flight in virNetServerHandleJob(), the virNetServer lock is acquired
when freeing job->prog (src/rpc/virnetserver.c:167). But the lock is
already held in virNetServerFree(), which is blocked in
virThreadPoolFree() waiting for all the workers to finish. No progress
can be made.
The attached hack fixes the problem, but I'm not convinced this is an
appropriate fix. Is it necessary to hold the virNetServer lock when
calling virNetServerProgramFree(job->prog)? I notice the lock is not
held in the error path of virNetServerHandleJob().
Thanks,
Jim
12 years, 5 months
[libvirt] qemu -numa option and non-contiguous CPU ranges
by Eduardo Habkost
Hi,
I just noticed libvirt tries to use the -numa option in a way that qemu
never understood: if a node is configured to have a non-contiguous set
of CPUs, it tries to generate a command-line option that looks like:
"-numa node,nodeid=...,cpus=0,2,4,mem=..."
^^^^^
But this format was never supported by qemu. This format is even a bit
weird, as "," is an option separator, and it is being used as a
separator _inside_ an option.
My question is: should we support this option format in qemu, or should
we change libvirt to use another format (that has yet to be implemented,
because currently there's no way to specify a non-contiguous set of CPUs
for a NUMA node).
Any suggestions?
--
Eduardo
12 years, 5 months
[libvirt] [PATCHv2 0/5] Virtio support for S390
by Viktor Mihajlovski
Resending as a thread, same content. Please ignore previous submission.
This series adds support for the s390 flavor of virtio devices.
Since the s390 virtio devices are not implemented as PCI devices
it is necessary to refactor some of the device address assignment
code.
Viktor Mihajlovski (5):
S390: Extended qemuDomainAssignAddresses to be callable from
everywhere.
S390: Change tests to use (modified) qemuDomainAssignAddresses
S390: Add support for virtio-s390 devices.
S390: Domain Schema for s390-virtio machines.
S390: Adding testcases for s390
docs/schemas/domaincommon.rng | 20 +++
src/conf/domain_conf.c | 11 +-
src/conf/domain_conf.h | 1 +
src/qemu/qemu_capabilities.c | 7 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 140 ++++++++++++++++++--
src/qemu/qemu_command.h | 6 +-
src/qemu/qemu_driver.c | 14 +-
src/qemu/qemu_process.c | 42 +------
.../qemuxml2argv-console-virtio-s390.args | 9 ++
.../qemuxml2argv-console-virtio-s390.xml | 24 ++++
.../qemuxml2argv-disk-virtio-s390.args | 5 +
.../qemuxml2argv-disk-virtio-s390.xml | 22 +++
.../qemuxml2argv-minimal-s390.args | 5 +
.../qemuxml2argvdata/qemuxml2argv-minimal-s390.xml | 21 +++
.../qemuxml2argv-net-virtio-s390.args | 5 +
.../qemuxml2argv-net-virtio-s390.xml | 22 +++
tests/qemuxml2argvtest.c | 20 ++--
tests/qemuxmlnstest.c | 13 +--
tests/testutilsqemu.c | 31 +++++
20 files changed, 333 insertions(+), 86 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-console-virtio-s390.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-console-virtio-s390.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-s390.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-s390.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-minimal-s390.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-minimal-s390.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-net-virtio-s390.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-net-virtio-s390.xml
12 years, 5 months
[libvirt] [PATCH 0/5] Basic Enablement of s390
by Viktor Mihajlovski
Hi,
although there's already some code in libvirt for qemu on s390
it has experienced a certain level of degradation over time.
Or, to put it short: it is not compatible with upstream
qemu/kvm.
This is the first series of patches aimed to enable libvirt to
manage qemu/kvm domains hosted on the s390 platform.
The patches in this series address s390 specifics of node and
hypervisor.
Patches 2,3 and 5 are written by Thang Pham <thang.pham(a)us.ibm.com>
the others are my doing. Since they all should go together, I am
sending in Thang's as well, hoping to facilitate the review a bit
this way.
Thang Pham (3):
S390: CPU support for s390(x)
S390: Fixed Parser for /proc/cpuinfo needs to be adapted for your
architecture
S390: Added sysinfo for host on s390x.
Viktor Mihajlovski (2):
S390: Override QEMU_CAPS_NO_ACPI for s390x
S390: Fixed core identification for s390
src/Makefile.am | 1 +
src/cpu/cpu.c | 2 +
src/cpu/cpu_s390x.c | 80 ++++++++++++++++++++++
src/cpu/cpu_s390x.h | 31 +++++++++
src/nodeinfo.c | 11 +++
src/qemu/qemu_capabilities.c | 5 ++
src/util/sysinfo.c | 154 ++++++++++++++++++++++++++++++++++++++++++
7 files changed, 284 insertions(+), 0 deletions(-)
create mode 100644 src/cpu/cpu_s390x.c
create mode 100644 src/cpu/cpu_s390x.h
--
Mit freundlichen Grüßen/Kind Regards
Viktor Mihajlovski
IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294
12 years, 5 months