[libvirt] [PATCH v2] virsh: Fix to list online cpus using virsh capabilities
by Kothapally Madhu Pavan
Virsh capabilities will list offline cpus as online when
libvirt is compiled with numactl option disabled. This
fix will list correct set of online cpus.
---
src/nodeinfo.c | 43 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)
diff --git a/src/nodeinfo.c b/src/nodeinfo.c
index 22df95c..410c9de 100644
--- a/src/nodeinfo.c
+++ b/src/nodeinfo.c
@@ -1651,6 +1651,47 @@ nodeCapsInitNUMAFake(virCapsPtr caps ATTRIBUTE_UNUSED)
if (VIR_ALLOC_N(cpus, ncpus) < 0)
return -1;
+#ifdef __linux__
+ {
+ int cid = 0;
+ int onlinecpus = nodeinfo.cpus;
+
+ id = 0;
+ for (s = 0; s < nodeinfo.sockets; s++) {
+ for (c = 0; c < nodeinfo.cores; c++) {
+ for (t = 0; t < nodeinfo.threads; t++) {
+ if (virNodeGetCpuValue(SYSFS_CPU_PATH, id, "online", 1)) {
+ cpus[cid].id = id;
+ cpus[cid].socket_id = s;
+ cpus[cid].core_id = c;
+ if (!(cpus[cid].siblings = virBitmapNew(ncpus)))
+ goto error;
+ ignore_value(virBitmapSetBit(cpus[cid].siblings, id));
+ cid++;
+ }
+
+ id++;
+ }
+ }
+ }
+
+ if (virCapabilitiesAddHostNUMACell(caps, 0,
+ nodeinfo.memory,
+ onlinecpus, cpus,
+ 0, NULL,
+ 0, NULL) < 0)
+ goto error;
+
+ return 0;
+
+ error:
+ for (; cid >= 0; cid--)
+ virBitmapFree(cpus[cid].siblings);
+ VIR_FREE(cpus);
+ return -1;
+ }
+#else
+ {
id = 0;
for (s = 0; s < nodeinfo.sockets; s++) {
for (c = 0; c < nodeinfo.cores; c++) {
@@ -1680,6 +1721,8 @@ nodeCapsInitNUMAFake(virCapsPtr caps ATTRIBUTE_UNUSED)
virBitmapFree(cpus[id].siblings);
VIR_FREE(cpus);
return -1;
+ }
+#endif
}
static int
9 years, 7 months
[libvirt] [PATCH] conf: Ignore panic device on pSeries.
by Andrea Bolognani
The guest firmware already provides the same functionality, so we can
just safely drop the <panic/> element from the domain definition.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1182388
---
src/conf/domain_conf.c | 17 +++++++-----
.../qemuxml2argv-pseries-panic.args | 7 +++++
.../qemuxml2argv-pseries-panic.xml | 30 ++++++++++++++++++++++
tests/qemuxml2argvtest.c | 2 ++
.../qemuxml2xmlout-pseries-panic.xml | 29 +++++++++++++++++++++
tests/qemuxml2xmltest.c | 1 +
6 files changed, 80 insertions(+), 6 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-panic.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-panic.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic.xml
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 4cd36a1..a7d4efa 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -15478,13 +15478,18 @@ virDomainDefParseXML(xmlDocPtr xml,
goto error;
}
if (n > 0) {
- virDomainPanicDefPtr panic =
- virDomainPanicDefParseXML(nodes[0]);
- if (!panic)
- goto error;
+ /* Ignore the panic device on pSeries, as the guest
+ * firmware already provides the same functionality */
+ if (!(ARCH_IS_PPC64(def->os.arch) &&
+ STRPREFIX(def->os.machine, "pseries"))) {
+ virDomainPanicDefPtr panic =
+ virDomainPanicDefParseXML(nodes[0]);
+ if (!panic)
+ goto error;
- def->panic = panic;
- VIR_FREE(nodes);
+ def->panic = panic;
+ VIR_FREE(nodes);
+ }
}
/* analysis of the shmem devices */
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-panic.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-panic.args
new file mode 100644
index 0000000..30e4b43
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-panic.args
@@ -0,0 +1,7 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-ppc64 -S -M pseries -m 512 -smp 1 -nographic \
+-nodefconfig -nodefaults \
+-chardev socket,id=charmonitor,path=/tmp/test-monitor,server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=readline -no-acpi -boot c -usb \
+-chardev pty,id=charserial0 \
+-device spapr-vty,chardev=charserial0,reg=0x30000000
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-panic.xml b/tests/qemuxml2argvdata/qemuxml2argv-pseries-panic.xml
new file mode 100644
index 0000000..9312975
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-panic.xml
@@ -0,0 +1,30 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
+ <memory unit='KiB'>524288</memory>
+ <currentMemory unit='KiB'>524288</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='ppc64' machine='pseries'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-ppc64</emulator>
+ <controller type='usb' index='0'/>
+ <controller type='pci' index='0' model='pci-root'/>
+ <serial type='pty'>
+ <target port='0'/>
+ <address type='spapr-vio'/>
+ </serial>
+ <console type='pty'>
+ <target type='serial' port='0'/>
+ <address type='spapr-vio'/>
+ </console>
+ <memballoon model='none'/>
+ <panic/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 97c7fba..5719d70 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1360,6 +1360,8 @@ mymain(void)
QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
DO_TEST("pseries-cpu-le", QEMU_CAPS_KVM, QEMU_CAPS_CPU_HOST,
QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
+ DO_TEST("pseries-panic",
+ QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
DO_TEST("disk-ide-drive-split",
QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG,
QEMU_CAPS_IDE_CD);
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic.xml
new file mode 100644
index 0000000..8980847
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic.xml
@@ -0,0 +1,29 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
+ <memory unit='KiB'>524288</memory>
+ <currentMemory unit='KiB'>524288</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='ppc64' machine='pseries'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-ppc64</emulator>
+ <controller type='usb' index='0'/>
+ <controller type='pci' index='0' model='pci-root'/>
+ <serial type='pty'>
+ <target port='0'/>
+ <address type='spapr-vio'/>
+ </serial>
+ <console type='pty'>
+ <target type='serial' port='0'/>
+ <address type='spapr-vio'/>
+ </console>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index b611afd..5db6341 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -534,6 +534,7 @@ mymain(void)
DO_TEST("virtio-rng-egd");
DO_TEST("pseries-nvram");
+ DO_TEST_DIFFERENT("pseries-panic");
/* These tests generate different XML */
DO_TEST_DIFFERENT("balloon-device-auto");
--
2.1.0
9 years, 7 months
[libvirt] [PATCH] storage: Report error when using metadata prealloc with non-qcow2 volumes
by Erik Skultety
We already report error from backend (virStorageBackendCreateRaw,
virStorageBackendCreateBlockFrom), but we should also report the same
error (applies to raw formated volumes and block type volumes as
well) when creating a volume from a XML, not only from an existing
volume.
---
src/storage/storage_driver.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
index ac4a74a..b519011 100644
--- a/src/storage/storage_driver.c
+++ b/src/storage/storage_driver.c
@@ -1803,6 +1803,22 @@ storageVolCreateXML(virStoragePoolPtr obj,
goto cleanup;
}
+ if (flags & VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA) {
+ if (voldef->target.format == VIR_STORAGE_FILE_RAW) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ "%s", _("metadata preallocation is not supported for "
+ "raw volumes"));
+ goto cleanup;
+ }
+
+ if (voldef->type == VIR_STORAGE_VOL_BLOCK) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ "%s", _("metadata preallocation is not supported for "
+ "block volumes"));
+ goto cleanup;
+ }
+ }
+
if (virStorageVolCreateXMLEnsureACL(obj->conn, pool->def, voldef) < 0)
goto cleanup;
--
1.9.3
9 years, 7 months
[libvirt] [PATCH 0/3] volume resize fixes
by Ján Tomko
First two patches fix bugs and are applicable for the freeze.
Ján Tomko (3):
Simplify allocation check in storageVolResize
Fix shrinking volumes with the delta flag
virsh: make negative values with vol-resize more convenient
src/storage/storage_driver.c | 26 +++++++++-----------------
tools/virsh-volume.c | 15 ++++++++-------
2 files changed, 17 insertions(+), 24 deletions(-)
--
2.3.6
9 years, 7 months
[libvirt] [PATCH] Fix the event name in vshEventTrayChangePrint
by Ján Tomko
https://bugzilla.redhat.com/show_bug.cgi?id=1206114#c5
Reported by: zhenfeng wang <zhwang(a)redhat.com>
---
tools/virsh-domain.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Pushed as trivial.
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 91a1ca2..fc4d1fc 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -12076,7 +12076,7 @@ vshEventTrayChangePrint(virConnectPtr conn ATTRIBUTE_UNUSED,
if (!data->loop && *data->count)
return;
vshPrint(data->ctl,
- _("event 'disk-change' for domain %s disk %s: %s\n"),
+ _("event 'tray-change' for domain %s disk %s: %s\n"),
virDomainGetName(dom), alias,
vshDomainEventTrayChangeToString(reason));
(*data->count)++;
--
2.3.6
9 years, 7 months
[libvirt] [PATCH] lxc: properly clean up qemu-nbd
by Cédric Bosdonnat
Add the qemu-nbd tasks to the container cgroup to make sure those will
be killed when the container is stopped. In order to reliably get the
qemu-nbd tasks PIDs, we use /sys/devices/virtual/block/<DEV>/pid as
qemu-nbd is daemonizing itself.
---
src/libvirt_private.syms | 1 +
src/lxc/lxc_controller.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++
src/util/virprocess.c | 45 ++++++++++++++++++++++++++++++++++++++
src/util/virprocess.h | 2 ++
4 files changed, 104 insertions(+)
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 8c50ea2..409bb4f 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -1973,6 +1973,7 @@ virProcessAbort;
virProcessExitWithStatus;
virProcessGetAffinity;
virProcessGetNamespaces;
+virProcessGetPids;
virProcessGetStartTime;
virProcessKill;
virProcessKillPainfully;
diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c
index e144c2d..14d873e 100644
--- a/src/lxc/lxc_controller.c
+++ b/src/lxc/lxc_controller.c
@@ -107,6 +107,9 @@ struct _virLXCController {
pid_t initpid;
+ size_t nnbdpids;
+ pid_t *nbdpids;
+
size_t nveths;
char **veths;
@@ -283,6 +286,8 @@ static void virLXCControllerFree(virLXCControllerPtr ctrl)
virObjectUnref(ctrl->server);
virLXCControllerFreeFuse(ctrl);
+ VIR_FREE(ctrl->nbdpids);
+
virCgroupFree(&ctrl->cgroup);
/* This must always be the last thing to be closed */
@@ -471,6 +476,9 @@ static int virLXCControllerSetupNBDDeviceFS(virDomainFSDefPtr fs)
return -1;
}
+ /* The NBD device will be cleaned up while the cgroup will end.
+ * For this we need to remember the qemu-nbd pid and add it to
+ * the cgroup*/
if (virFileNBDDeviceAssociate(fs->src,
fs->format,
fs->readonly,
@@ -503,6 +511,9 @@ static int virLXCControllerSetupNBDDeviceDisk(virDomainDiskDefPtr disk)
return -1;
}
+ /* The NBD device will be cleaned up while the cgroup will end.
+ * For this we need to remember the qemu-nbd pid and add it to
+ * the cgroup*/
if (virFileNBDDeviceAssociate(src,
format,
disk->src->readonly,
@@ -525,6 +536,38 @@ static int virLXCControllerSetupNBDDeviceDisk(virDomainDiskDefPtr disk)
return 0;
}
+static int virLXCControllerAppendNBDPids(virLXCControllerPtr ctrl,
+ const char *dev)
+{
+ char *pidpath = NULL;
+ pid_t *pids;
+ size_t npids;
+ size_t i;
+ int ret = -1;
+ pid_t pid;
+
+ if (!STRPREFIX(dev, "/dev/") ||
+ virAsprintf(&pidpath, "/sys/devices/virtual/block/%s/pid", dev + 5) < 0)
+ goto cleanup;
+
+ if (virPidFileReadPath(pidpath, &pid) < 0)
+ goto cleanup;
+
+ if (virProcessGetPids(pid, &npids, &pids) < 0)
+ goto cleanup;
+
+ for (i = 0; i < npids; i++) {
+ if (VIR_APPEND_ELEMENT(ctrl->nbdpids, ctrl->nnbdpids, pids[i]) < 0)
+ goto cleanup;
+ }
+
+ ret = 0;
+
+ cleanup:
+ VIR_FREE(pids);
+ VIR_FREE(pidpath);
+ return ret;
+}
static int virLXCControllerSetupLoopDevices(virLXCControllerPtr ctrl)
{
@@ -570,6 +613,9 @@ static int virLXCControllerSetupLoopDevices(virLXCControllerPtr ctrl)
} else if (fs->fsdriver == VIR_DOMAIN_FS_DRIVER_TYPE_NBD) {
if (virLXCControllerSetupNBDDeviceFS(fs) < 0)
goto cleanup;
+
+ if (virLXCControllerAppendNBDPids(ctrl, fs->src) < 0)
+ goto cleanup;
} else {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("fs driver %s is not supported"),
@@ -629,6 +675,9 @@ static int virLXCControllerSetupLoopDevices(virLXCControllerPtr ctrl)
}
if (virLXCControllerSetupNBDDeviceDisk(disk) < 0)
goto cleanup;
+
+ if (virLXCControllerAppendNBDPids(ctrl, virDomainDiskGetSource(disk)) < 0)
+ goto cleanup;
} else {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("disk driver %s is not supported"),
@@ -781,6 +830,7 @@ static int virLXCControllerSetupCgroupLimits(virLXCControllerPtr ctrl)
virBitmapPtr auto_nodeset = NULL;
int ret = -1;
virBitmapPtr nodeset = NULL;
+ size_t i;
VIR_DEBUG("Setting up cgroup resource limits");
@@ -798,6 +848,12 @@ static int virLXCControllerSetupCgroupLimits(virLXCControllerPtr ctrl)
if (virCgroupAddTask(ctrl->cgroup, getpid()) < 0)
goto cleanup;
+ /* Add all qemu-nbd tasks to the cgroup */
+ for (i = 0; i < ctrl->nnbdpids; i++) {
+ if (virCgroupAddTask(ctrl->cgroup, ctrl->nbdpids[i]) < 0)
+ goto cleanup;
+ }
+
if (virLXCCgroupSetup(ctrl->def, ctrl->cgroup, nodeset) < 0)
goto cleanup;
diff --git a/src/util/virprocess.c b/src/util/virprocess.c
index 7a79970..8b4b32f 100644
--- a/src/util/virprocess.c
+++ b/src/util/virprocess.c
@@ -607,6 +607,51 @@ int virProcessGetAffinity(pid_t pid ATTRIBUTE_UNUSED,
}
#endif /* HAVE_SCHED_GETAFFINITY */
+int virProcessGetPids(pid_t pid, size_t *npids, pid_t **pids)
+{
+ int ret = -1;
+ char *taskPath = NULL;
+ DIR *dir = NULL;
+ int value;
+ struct dirent *ent;
+
+ *npids = 0;
+ *pids = NULL;
+
+ if (virAsprintf(&taskPath, "/proc/%llu/task",
+ (unsigned long long)pid) < 0)
+ goto cleanup;
+
+ if (!(dir = opendir(taskPath)))
+ goto cleanup;
+
+ while ((value = virDirRead(dir, &ent, taskPath)) > 0) {
+ pid_t tmp_pid;
+
+ /* Skip . and .. */
+ if (STRPREFIX(ent->d_name, "."))
+ continue;
+
+ if (virStrToLong_i(ent->d_name, NULL, 10, &tmp_pid) < 0)
+ goto cleanup;
+
+ if (VIR_APPEND_ELEMENT(*pids, *npids, tmp_pid) < 0)
+ goto cleanup;
+ }
+
+ if (value < 0)
+ goto cleanup;
+
+ ret = 0;
+
+ cleanup:
+ if (!dir)
+ closedir(dir);
+ VIR_FREE(taskPath);
+ if (ret < 0)
+ VIR_FREE(*pids);
+ return ret;
+}
int virProcessGetNamespaces(pid_t pid,
size_t *nfdlist,
diff --git a/src/util/virprocess.h b/src/util/virprocess.h
index c812882..86a633d 100644
--- a/src/util/virprocess.h
+++ b/src/util/virprocess.h
@@ -62,6 +62,8 @@ int virProcessGetAffinity(pid_t pid,
virBitmapPtr *map,
int maxcpu);
+int virProcessGetPids(pid_t pid, size_t *npids, pid_t **pids);
+
int virProcessGetStartTime(pid_t pid,
unsigned long long *timestamp);
--
2.1.4
9 years, 7 months
[libvirt] [PATCH] parallels: suppress console output from parallels SDK
by Maxim Nestratov
It is necessary to have unpolluted screen when connecting to
parallels driver via virsh.
Otherwise a lot of unexpected output one will get on the console.
Signed-off-by: Maxim Nestratov <mnestratov(a)parallels.com>
---
src/parallels/parallels_sdk.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/parallels/parallels_sdk.c b/src/parallels/parallels_sdk.c
index 542e09e..b717ccf 100644
--- a/src/parallels/parallels_sdk.c
+++ b/src/parallels/parallels_sdk.c
@@ -205,6 +205,9 @@ prlsdkInit(void)
{
PRL_RESULT ret;
+ /* Disable console output */
+ PrlApi_SwitchConsoleLogging(0);
+
ret = PrlApi_InitEx(PARALLELS_API_VER, PAM_SERVER, 0, 0);
if (PRL_FAILED(ret)) {
logPrlError(ret);
--
2.1.0
9 years, 7 months
[libvirt] [PATCH] node_device: more informative error log when device isn't found
by Laine Stump
In a couple of cases, the node device driver (and the test node device
driver which likely copied it) was only logging "Node device not
found" when it couldn't find the requested device. This patch changes
those cases to log the name (and in the case when it's relevant, the
wwnn and wwpn) as well.
---
src/node_device/node_device_driver.c | 14 ++++++++++----
src/test/test_driver.c | 8 ++++++--
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c
index 34ba1fa..768db7f 100644
--- a/src/node_device/node_device_driver.c
+++ b/src/node_device/node_device_driver.c
@@ -248,7 +248,9 @@ nodeDeviceLookupByName(virConnectPtr conn, const char *name)
nodeDeviceUnlock();
if (!obj) {
- virReportError(VIR_ERR_NO_NODE_DEVICE, NULL);
+ virReportError(VIR_ERR_NO_NODE_DEVICE,
+ _("no node device with matching name '%s'"),
+ name);
goto cleanup;
}
@@ -597,8 +599,10 @@ nodeDeviceCreateXML(virConnectPtr conn,
* we're returning what we get... */
if (dev == NULL)
- virReportError(VIR_ERR_NO_NODE_DEVICE, NULL);
-
+ virReportError(VIR_ERR_NO_NODE_DEVICE,
+ _("no node device for '%s' with matching "
+ "wwnn '%s' and wwpn '%s'"),
+ def->name, wwnn, wwpn);
cleanup:
nodeDeviceUnlock();
virNodeDeviceDefFree(def);
@@ -621,7 +625,9 @@ nodeDeviceDestroy(virNodeDevicePtr dev)
nodeDeviceUnlock();
if (!obj) {
- virReportError(VIR_ERR_NO_NODE_DEVICE, NULL);
+ virReportError(VIR_ERR_NO_NODE_DEVICE,
+ _("no node device with matching name '%s'"),
+ dev->name);
goto out;
}
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 038b2b8..d1f0af3 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -5673,7 +5673,9 @@ testNodeDeviceLookupByName(virConnectPtr conn, const char *name)
testDriverUnlock(driver);
if (!obj) {
- virReportError(VIR_ERR_NO_NODE_DEVICE, NULL);
+ virReportError(VIR_ERR_NO_NODE_DEVICE,
+ _("no node device with matching name '%s'"),
+ name);
goto cleanup;
}
@@ -5893,7 +5895,9 @@ testNodeDeviceDestroy(virNodeDevicePtr dev)
testDriverUnlock(driver);
if (!obj) {
- virReportError(VIR_ERR_NO_NODE_DEVICE, NULL);
+ virReportError(VIR_ERR_NO_NODE_DEVICE,
+ _("no node device with matching name '%s'"),
+ dev->name);
goto out;
}
--
2.1.0
9 years, 7 months
[libvirt] [PATCH] qemu: Only issue the rtc-reset-reinjection QMP command on x86.
by Andrea Bolognani
The command is only defined in QEMU for TARGET_I386, so issuing it on
any other architecture can't possibly work.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1211938
---
src/qemu/qemu_driver.c | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index aa0acde..743ca6e 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -18945,7 +18945,10 @@ qemuDomainSetTime(virDomainPtr dom,
goto endjob;
}
- if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_RTC_RESET_REINJECTION)) {
+ /* The rtc-reset-reinjection QMP command is only available on x86 */
+ if (ARCH_IS_X86(vm->def->os.arch) &&
+ !virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_RTC_RESET_REINJECTION))
+ {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("cannot set time: qemu doesn't support "
"rtc-reset-reinjection command"));
@@ -18968,13 +18971,16 @@ qemuDomainSetTime(virDomainPtr dom,
goto endjob;
}
- qemuDomainObjEnterMonitor(driver, vm);
- rv = qemuMonitorRTCResetReinjection(priv->mon);
- if (qemuDomainObjExitMonitor(driver, vm) < 0)
- goto endjob;
+ /* The rtc-reset-reinjection QMP command is only available on x86 */
+ if (ARCH_IS_X86(vm->def->os.arch)) {
+ qemuDomainObjEnterMonitor(driver, vm);
+ rv = qemuMonitorRTCResetReinjection(priv->mon);
+ if (qemuDomainObjExitMonitor(driver, vm) < 0)
+ goto endjob;
- if (rv < 0)
- goto endjob;
+ if (rv < 0)
+ goto endjob;
+ }
ret = 0;
--
2.1.0
9 years, 7 months