[libvirt] [PATCH] Always specify qcow2 compat level on qemu-img command line
by Ján Tomko
qemu-img is going to switch the default for QCOW2
to QCOW2v3 (compat=1.1) [0]
Extend the probing for qemu-img command line options to check
if -o compat is supported. If the volume definition specifies
the qcow2 format but no compat level and -o compat is supported,
specify -o compat=0.10 to create a QCOW2v2 image.
https://bugzilla.redhat.com/show_bug.cgi?id=997977
---
[0] the switch is not yet upstream. The proposed (incomplete) QEMU patch:
http://lists.nongnu.org/archive/html/qemu-devel/2013-08/msg02549.html
src/storage/storage_backend.c | 47 +++++++++++++++++++---
tests/storagevolxml2argvdata/qcow2-compat.argv | 3 ++
.../qcow2-from-logical-compat.argv | 3 ++
.../qcow2-nobacking-convert-prealloc-compat.argv | 3 ++
.../qcow2-nobacking-prealloc-compat.argv | 3 ++
tests/storagevolxml2argvtest.c | 26 ++++++++++++
6 files changed, 79 insertions(+), 6 deletions(-)
create mode 100644 tests/storagevolxml2argvdata/qcow2-compat.argv
create mode 100644 tests/storagevolxml2argvdata/qcow2-from-logical-compat.argv
create mode 100644 tests/storagevolxml2argvdata/qcow2-nobacking-convert-prealloc-compat.argv
create mode 100644 tests/storagevolxml2argvdata/qcow2-nobacking-prealloc-compat.argv
diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c
index 8d5880e..4ebe11b 100644
--- a/src/storage/storage_backend.c
+++ b/src/storage/storage_backend.c
@@ -581,8 +581,34 @@ enum {
QEMU_IMG_BACKING_FORMAT_NONE = 0,
QEMU_IMG_BACKING_FORMAT_FLAG,
QEMU_IMG_BACKING_FORMAT_OPTIONS,
+ QEMU_IMG_BACKING_FORMAT_OPTIONS_COMPAT,
};
+static bool
+virStorageBackendQemuImgSupportsCompat(const char *qemuimg)
+{
+ bool ret = false;
+ char *output;
+ virCommandPtr cmd = NULL;
+
+ cmd = virCommandNewArgList(qemuimg, "create", "-o", "?", "-f", "qcow2",
+ "/dev/null", NULL);
+
+ virCommandAddEnvString(cmd, "LC_ALL=C");
+ virCommandSetOutputBuffer(cmd, &output);
+
+ if (virCommandRun(cmd, NULL) < 0)
+ goto cleanup;
+
+ if (strstr(output, "\ncompat "))
+ ret = true;
+
+cleanup:
+ virCommandFree(cmd);
+ VIR_FREE(output);
+ return ret;
+}
+
static int
virStorageBackendQEMUImgBackingFormat(const char *qemuimg)
{
@@ -612,12 +638,16 @@ virStorageBackendQEMUImgBackingFormat(const char *qemuimg)
goto cleanup;
}
if (((tmp = strstr(start, "-F fmt")) && tmp < end) ||
- ((tmp = strstr(start, "-F backing_fmt")) && tmp < end))
+ ((tmp = strstr(start, "-F backing_fmt")) && tmp < end)) {
ret = QEMU_IMG_BACKING_FORMAT_FLAG;
- else if ((tmp = strstr(start, "[-o options]")) && tmp < end)
- ret = QEMU_IMG_BACKING_FORMAT_OPTIONS;
- else
+ } else if ((tmp = strstr(start, "[-o options]")) && tmp < end) {
+ if (virStorageBackendQemuImgSupportsCompat(qemuimg))
+ ret = QEMU_IMG_BACKING_FORMAT_OPTIONS_COMPAT;
+ else
+ ret = QEMU_IMG_BACKING_FORMAT_OPTIONS;
+ } else {
ret = QEMU_IMG_BACKING_FORMAT_NONE;
+ }
cleanup:
virCommandFree(cmd);
@@ -705,6 +735,7 @@ virStorageBackendCreateQemuImgCmd(virConnectPtr conn,
const char *backingType = NULL;
const char *inputPath = NULL;
const char *inputType = NULL;
+ const char *compat = vol->target.compat;
char *opts = NULL;
bool convert = false;
bool backing = false;
@@ -854,12 +885,16 @@ virStorageBackendCreateQemuImgCmd(virConnectPtr conn,
if (backing)
virCommandAddArgList(cmd, "-b", vol->backingStore.path, NULL);
- if (imgformat == QEMU_IMG_BACKING_FORMAT_OPTIONS) {
+ if (imgformat >= QEMU_IMG_BACKING_FORMAT_OPTIONS) {
+ if (vol->target.format == VIR_STORAGE_FILE_QCOW2 && !compat &&
+ imgformat == QEMU_IMG_BACKING_FORMAT_OPTIONS_COMPAT)
+ compat = "0.10";
+
if (virStorageBackendCreateQemuImgOpts(&opts,
backing ? backingType : NULL,
do_encryption, preallocate,
vol->target.format,
- vol->target.compat,
+ compat,
vol->target.features) < 0) {
virCommandFree(cmd);
return NULL;
diff --git a/tests/storagevolxml2argvdata/qcow2-compat.argv b/tests/storagevolxml2argvdata/qcow2-compat.argv
new file mode 100644
index 0000000..37ad2c0
--- /dev/null
+++ b/tests/storagevolxml2argvdata/qcow2-compat.argv
@@ -0,0 +1,3 @@
+qemu-img create -f qcow2 -b /dev/null \
+-o backing_fmt=raw,encryption=on,compat=0.10 \
+/var/lib/libvirt/images/OtherDemo.img 5242880K
diff --git a/tests/storagevolxml2argvdata/qcow2-from-logical-compat.argv b/tests/storagevolxml2argvdata/qcow2-from-logical-compat.argv
new file mode 100644
index 0000000..5f365b1
--- /dev/null
+++ b/tests/storagevolxml2argvdata/qcow2-from-logical-compat.argv
@@ -0,0 +1,3 @@
+qemu-img convert -f raw -O qcow2 \
+-o encryption=on,compat=0.10 \
+/dev/HostVG/Swap /var/lib/libvirt/images/OtherDemo.img
diff --git a/tests/storagevolxml2argvdata/qcow2-nobacking-convert-prealloc-compat.argv b/tests/storagevolxml2argvdata/qcow2-nobacking-convert-prealloc-compat.argv
new file mode 100644
index 0000000..3d93ec8
--- /dev/null
+++ b/tests/storagevolxml2argvdata/qcow2-nobacking-convert-prealloc-compat.argv
@@ -0,0 +1,3 @@
+qemu-img convert -f raw -O qcow2 \
+-o encryption=on,preallocation=metadata,compat=0.10 \
+/var/lib/libvirt/images/sparse.img /var/lib/libvirt/images/OtherDemo.img
diff --git a/tests/storagevolxml2argvdata/qcow2-nobacking-prealloc-compat.argv b/tests/storagevolxml2argvdata/qcow2-nobacking-prealloc-compat.argv
new file mode 100644
index 0000000..903c94e
--- /dev/null
+++ b/tests/storagevolxml2argvdata/qcow2-nobacking-prealloc-compat.argv
@@ -0,0 +1,3 @@
+qemu-img create -f qcow2 \
+-o encryption=on,preallocation=metadata,compat=0.10 \
+/var/lib/libvirt/images/OtherDemo.img 5242880K
diff --git a/tests/storagevolxml2argvtest.c b/tests/storagevolxml2argvtest.c
index b1cf09f..cafcaad 100644
--- a/tests/storagevolxml2argvtest.c
+++ b/tests/storagevolxml2argvtest.c
@@ -195,6 +195,7 @@ enum {
FMT_NONE = 0,
FMT_FLAG,
FMT_OPTIONS,
+ FMT_COMPAT,
};
@@ -271,6 +272,31 @@ mymain(void)
"pool-dir", "vol-qcow2-nobacking",
"logical-from-qcow2", 0, FMT_OPTIONS);
+ DO_TEST("pool-dir", "vol-qcow2",
+ NULL, NULL,
+ "qcow2-compat", 0, FMT_COMPAT);
+ DO_TEST("pool-dir", "vol-qcow2-nobacking",
+ NULL, NULL,
+ "qcow2-nobacking-prealloc-compat", flags, FMT_COMPAT);
+ DO_TEST("pool-dir", "vol-qcow2-nobacking",
+ "pool-dir", "vol-file",
+ "qcow2-nobacking-convert-prealloc-compat", flags, FMT_COMPAT);
+ DO_TEST("pool-dir", "vol-qcow2-lazy",
+ NULL, NULL,
+ "qcow2-lazy", 0, FMT_COMPAT);
+ DO_TEST("pool-dir", "vol-qcow2-1.1",
+ NULL, NULL,
+ "qcow2-1.1", 0, FMT_COMPAT);
+ DO_TEST_FAIL("pool-dir", "vol-qcow2-0.10-lazy",
+ NULL, NULL,
+ "qcow2-0.10-lazy", 0, FMT_COMPAT);
+ DO_TEST("pool-dir", "vol-qcow2-nobacking",
+ "pool-logical", "vol-logical",
+ "qcow2-from-logical-compat", 0, FMT_COMPAT);
+ DO_TEST("pool-logical", "vol-logical",
+ "pool-dir", "vol-qcow2-nobacking",
+ "logical-from-qcow2", 0, FMT_COMPAT);
+
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
--
1.8.1.5
11 years, 2 months
[libvirt] [PATCH 00/17] Add tests for disk hotplug
by Jiri Denemark
This series adds tests for hotplugging all supported disk types.
Jiri Denemark (17):
qemu: Typedef monitor callbacks
qemu: Avoid using global qemu_driver in event handlers
qemu: Move qemuDomainAttachDeviceDiskLive to qemu_hotplug.c
qemu: Move qemuDomainDetachDeviceDiskLive to qemu_hotplug.c
qemuhotplugtest: Generate better output
qemuhotplugtest: Compare domain XML after device hotplug
qemuhotplugtest: Define QMP_OK for the most common reply
qemuxml2argvtest: Add XML for testing device hotplug
qemuhotplugtest: Add tests for virtio disk hotplug
tests: Add support for passing vm to qemu monitor
tests: Add support for passing driver to qemu monitor
qemu: Export qemuProcessHandleDeviceDeleted for tests
qemu: Let tests override waiting time for device unplug
qemuhotplugtest: Add support for DEVICE_DELETED event
qemuhotplugtest: Add tests for async virtio disk detach
qemuhotplugtest: Add tests for USB disk hotplug
qemuhotplugtest: Add tests for virtio SCSI disk hotplug
src/Makefile.am | 2 +
src/qemu/qemu_capabilities.c | 5 +-
src/qemu/qemu_driver.c | 166 ---------------
src/qemu/qemu_hotplug.c | 219 +++++++++++++++++--
src/qemu/qemu_hotplug.h | 25 +--
src/qemu/qemu_hotplugpriv.h | 31 +++
src/qemu/qemu_monitor.c | 30 +--
src/qemu/qemu_monitor.h | 198 +++++++++++-------
src/qemu/qemu_process.c | 104 +++++----
src/qemu/qemu_process.h | 2 +-
src/qemu/qemu_processpriv.h | 37 ++++
tests/qemuhotplugtest.c | 232 +++++++++++++++++----
...qemuhotplug-console-compat-2+console-virtio.xml | 127 +++++++++++
.../qemuhotplugtestdata/qemuhotplug-disk-scsi.xml | 7 +
tests/qemuhotplugtestdata/qemuhotplug-disk-usb.xml | 7 +
.../qemuhotplug-disk-virtio.xml | 7 +
.../qemuhotplug-hotplug-base+disk-scsi.xml | 46 ++++
.../qemuhotplug-hotplug-base+disk-usb.xml | 45 ++++
.../qemuhotplug-hotplug-base+disk-virtio.xml | 46 ++++
tests/qemumonitorjsontest.c | 26 +--
tests/qemumonitortestutils.c | 31 ++-
tests/qemumonitortestutils.h | 8 +-
.../qemuxml2argv-hotplug-base.args | 7 +
.../qemuxml2argvdata/qemuxml2argv-hotplug-base.xml | 38 ++++
tests/qemuxml2argvtest.c | 4 +
25 files changed, 1047 insertions(+), 403 deletions(-)
create mode 100644 src/qemu/qemu_hotplugpriv.h
create mode 100644 src/qemu/qemu_processpriv.h
create mode 100644 tests/qemuhotplugtestdata/qemuhotplug-console-compat-2+console-virtio.xml
create mode 100644 tests/qemuhotplugtestdata/qemuhotplug-disk-scsi.xml
create mode 100644 tests/qemuhotplugtestdata/qemuhotplug-disk-usb.xml
create mode 100644 tests/qemuhotplugtestdata/qemuhotplug-disk-virtio.xml
create mode 100644 tests/qemuhotplugtestdata/qemuhotplug-hotplug-base+disk-scsi.xml
create mode 100644 tests/qemuhotplugtestdata/qemuhotplug-hotplug-base+disk-usb.xml
create mode 100644 tests/qemuhotplugtestdata/qemuhotplug-hotplug-base+disk-virtio.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hotplug-base.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hotplug-base.xml
--
1.8.3.2
11 years, 2 months
[libvirt] [PATCH] virsh: fix return value error of cpu-stats
by Guannan Ren
virsh cpu-stats guest --start 0 --count 3
It outputs right but the return value is 1 rather than 0
echo $?
1
Found by running libvirt-autotest
./run -t libvirt --tests virsh_cpu_stats
---
tools/virsh-domain.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index b29f934..bcf495c 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -6350,7 +6350,9 @@ cmdCPUStats(vshControl *ctl, const vshCmd *cmd)
if (!nparams) {
vshPrint(ctl, "%s", _("No per-CPU stats available"));
- goto do_show_total;
+ if (show_total)
+ goto do_show_total;
+ goto cleanup;
}
if (VIR_ALLOC_N(params, nparams * MIN(show_count, 128)) < 0)
@@ -6389,10 +6391,12 @@ cmdCPUStats(vshControl *ctl, const vshCmd *cmd)
}
VIR_FREE(params);
-do_show_total:
- if (!show_total)
+ if (!show_total) {
+ ret = true;
goto cleanup;
+ }
+do_show_total:
/* get supported num of parameter for total statistics */
if ((nparams = virDomainGetCPUStats(dom, NULL, 0, -1, 1, flags)) < 0)
goto failed_stats;
--
1.8.3.1
11 years, 3 months
[libvirt] [RFC PATCH] qemu: Don't set migration bandwidth if user not specify it.
by Li Wei
Since commit 6cfdeaac("qemu: Migrate at unlimited speed by default"),
we set an unlimited migration bandwidth unconditionally, this change will
cause problem when doing "--copy-storage-all" migration, qemu will
submit as much block aio request as bandwidth allowed and use too much
memory and finally killed by the oom-killer.
Actually, we should only set migration speed when user specified it,
otherwise, we let qemu use its default settings.
Signed-off-by: Li Wei <lw(a)cn.fujitsu.com>
---
src/qemu/qemu_domain.c | 2 --
src/qemu/qemu_migration.c | 2 +-
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 7f4d17d..b56e6c0 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -226,8 +226,6 @@ qemuDomainObjPrivateAlloc(void)
if (!(priv->devs = virChrdevAlloc()))
goto error;
- priv->migMaxBandwidth = QEMU_DOMAIN_MIG_BANDWIDTH_MAX;
-
return priv;
error:
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index b905459..8d60e3d 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -3139,7 +3139,7 @@ qemuMigrationRun(virQEMUDriverPtr driver,
goto cleanup;
}
- if (qemuMonitorSetMigrationSpeed(priv->mon, migrate_speed) < 0) {
+ if (migrate_speed && qemuMonitorSetMigrationSpeed(priv->mon, migrate_speed) < 0) {
qemuDomainObjExitMonitor(driver, vm);
goto cleanup;
}
--
1.8.3.1
11 years, 3 months
[libvirt] [PATCH] Fix a memory leak in cmdSchedInfoUpdateOne
by hwbi2008@gmail.com
From: hwbi <hwbi2008(a)gmail.com>
The param needs to be virTypedParamsFree()'d in cmdSchedInfoUpdateOne().
---
tools/virsh-domain.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index b29f934..d704053 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -4085,7 +4085,7 @@ cmdSchedInfoUpdateOne(vshControl *ctl,
int *nparams, int *maxparams,
const char *field, const char *value)
{
- virTypedParameterPtr param;
+ virTypedParameterPtr param = NULL;
int ret = -1;
size_t i;
@@ -4109,6 +4109,7 @@ cmdSchedInfoUpdateOne(vshControl *ctl,
vshError(ctl, _("invalid scheduler option: %s"), field);
cleanup:
+ virTypedParamsFree(param, *nparams);
return ret;
}
--
1.7.1
11 years, 3 months
[libvirt] [PATCH] qemuDomainAttachHostPciDevice: Fall back to mem balloon if there's no hard_limit
by Michal Privoznik
If there's no hard_limit set and domain uses VFIO we still must lock
the guest memory (prerequisite from qemu). Hence, we should compute
the amount to be locked from max_balloon.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_hotplug.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 9727410..f028df6 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -1020,6 +1020,8 @@ int qemuDomainAttachHostPciDevice(virQEMUDriverPtr driver,
if (hostdev->source.subsys.u.pci.backend
== VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO) {
+ unsigned long long memKB;
+
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE_VFIO_PCI)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("VFIO PCI device assignment is not "
@@ -1032,8 +1034,9 @@ int qemuDomainAttachHostPciDevice(virQEMUDriverPtr driver,
* doesn't hurt to "change" the limit to the same value.
*/
vm->def->hostdevs[vm->def->nhostdevs++] = hostdev;
- virProcessSetMaxMemLock(vm->pid,
- vm->def->mem.hard_limit * 1024);
+ memKB = def->mem.hard_limit ?
+ def->mem.hard_limit : def->mem.max_balloon + 1024 * 1024;
+ virProcessSetMaxMemLock(vm->pid, memKB);
vm->def->hostdevs[vm->def->nhostdevs--] = NULL;
}
--
1.8.1.5
11 years, 3 months
Re: [libvirt] [PATCH] netns: unix: only allow to find out unix socket in same net namespace
by Gao feng
cc libvirt-list
On 08/21/2013 01:30 PM, Eric W. Biederman wrote:
> Gao feng <gaofeng(a)cn.fujitsu.com> writes:
>
>> Unix sockets are private resources of net namespace,
>> allowing one net namespace to access to other netns's unix
>> sockets is meaningless.
>
> Allowing one net namespace to access another netns's unix socket is
> deliberate behavior. This is a desired and useful feature, and
> only a misconfiguration of visible files would allow this to be a
> problem.
>
>> I'm researching a problem about shutdown from container,
>> if the cotainer shares the same file /run/systemd/private
>> with host, when we run shutdown -h xxx in container, the
>> shutdown message will be send to the systemd-shutdownd
>> through unix socket /run/systemd/private, and because
>> systemd-shutdownd is running in host, so finally, the host
>> will become shutdown.
>
> The simple answer is don't do that then. I can see no reason
> to share /run outside of the container unless you want this kind of
> behavior.
>
> Quite frankly I want this behavior if I am using network namespaces
> to support multiple routing contexts. That is if I am using scripts
> like:
>
> ip netns add other
> ip netns exec other script
>
> I don't want to have to remember to say
> ip netns orig exec shutdown -h now
>
> There are more compelling uses and there is no cost in supporting this
> in the kernel.
>
> What kind of misconfiguration caused someone to complain about this?
>
libvirt lxc allows user to set up a container which shares the same root
directory with host.
seems like the unix sockets whose sun_path is an abstract socket address
are net namespace aware.
Should we use "abstract" type of address instead of a file system pathname
for systemd in this case?
11 years, 3 months
[libvirt] [PATCH] schema: Allow dots in device aliases
by Jiri Denemark
Commit 01b88127 changed aliases for PCI controller devices to "pcie.0" or
"pci.%u". Thus device aliases may now contain dots.
---
docs/schemas/domaincommon.rng | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index dfcd61c..b537fee 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -4302,7 +4302,7 @@
</define>
<define name='aliasName'>
<data type="string">
- <param name="pattern">[a-zA-Z0-9_\-]+</param>
+ <param name="pattern">[a-zA-Z0-9_\-.]+</param>
</data>
</define>
<define name='alias'>
--
1.8.3.2
11 years, 3 months
[libvirt] [PATCH] qemu: Don't update count of vCPUs if hot-plug fails silently
by Peter Krempa
When cpu hotplug fails without reporting an error, we would fail the
command but update the count of vCPUs anyways.
Commit 761fc481365703b861429d73a341bde352ba8d41 fixed the case when CPU
hot-unplug failed silently, but forgot to fix up the value in this case.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1000357
---
src/qemu/qemu_driver.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 0a8e518..c39f04d 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -3982,6 +3982,7 @@ static int qemuDomainHotplugVcpus(virQEMUDriverPtr driver,
_("got wrong number of vCPU pids from QEMU monitor. "
"got %d, wanted %d"),
ncpupids, vcpus);
+ vcpus = oldvcpus;
ret = -1;
goto cleanup;
}
--
1.8.3.2
11 years, 3 months
[libvirt] [PATCH] Fix loosing the pidfile string of struct _qemuDomainObjPrivate after libvirtd service restarted.
by Wangyufei (A)
*src/qemu/qemu_domain.c (qemuDomainObjPrivateXMLFormat): Add codes of saving pidfile string to vm'state file.
*src/qemu/qemu_domain.c (qemuDomainObjPrivateXMLParse): Add codes of loading pidfile path saved in vm's state file to the pidfile string.
Signed-off-by: Xu Chao <xuchao1(a)huawei.com>
---
src/qemu/qemu_domain.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 7f4d17d..3c792ab 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -294,6 +294,7 @@ qemuDomainObjPrivateXMLFormat(virBufferPtr buf, void *data)
virDomainChrTypeToString(priv->monConfig->type));
}
+ virBufferEscapeString(buf, " <pidfile path='%s'/>\n", priv->pidfile);
if (priv->nvcpupids) {
size_t i;
@@ -398,6 +399,13 @@ qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, void *data)
goto error;
}
+ if (!(priv->pidfile =
+ virXPathString("string(./pid[1]/@path)", ctxt))) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("no pidfile path"));
+ goto error;
+ }
+
n = virXPathNodeSet("./vcpus/vcpu", ctxt, &nodes);
if (n < 0)
goto error;
Best Regards,
-WangYufei
11 years, 3 months