[libvirt] [sec-notice PATCH 1/2] maint: typo fixes
by Eric Blake
Noticed this while working on some additions.
* docs/schema.txt: Typo fixes.
* README: Refer to the schema.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
README | 5 +++--
docs/schema.txt | 6 +++---
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/README b/README
index 426d9ca..fa7f103 100644
--- a/README
+++ b/README
@@ -5,11 +5,12 @@ This repository records all Libvirt Security Notices that are
issued.
Notices must only added to this repository once any embargo is
-lifted, since the GIT repository is fully public
+lifted, since the GIT repository is fully public.
Notices are written in XML in a file "notices/$YEAR/$NUM.xml"
eg notices/2014/0001.xml. Assign numbers incrementally as
-new issues are reported.
+new issues are reported. More details on the XML format can
+be found in "docs/schema.txt".
When a new notice is published for the first time, send the
text rendering of the notice to the libvirt-announce(a)redhat.com
diff --git a/docs/schema.txt b/docs/schema.txt
index ca8203a..189abef 100644
--- a/docs/schema.txt
+++ b/docs/schema.txt
@@ -2,7 +2,7 @@
==============================
The top level element of a libvirt security notice has
-a name of "security-notice" and is in a XML namespace
+a name of "security-notice" and is in an XML namespace
of http://security.libvirt.org/xmlns/security-notice/1.0
Basic metadata
@@ -45,7 +45,7 @@ resources. It will have one or more child elements which
can be either "advisory" or "bug". An "advisory" element
includes a "type" and "id" attribute where "type" is
currently allowed to be "CVE" and "id" is the identifier
-of the report. A "bug" elements incudes "tracker" and
+of the report. A "bug" elements includes "tracker" and
"id" attribute where "tracker" is allowed to be "redhat",
"debian" or a short name for another vendors' bug tracker.
@@ -74,7 +74,7 @@ Product data
The "product" element provides information about the codebase
of the affected products. The "name" attribute is the name of
a libvirt product, typically based on the tar.gz archive name
-with the suffice stripped. This contains a child "repository"
+with the suffix stripped. This contains a child "repository"
element which is a URL to the master GIT repository. There is
then one or more "branch" elements which details the state of
affected branches.
--
1.8.4.2
11 years, 3 months
[libvirt] [PATCH]qemu:sheepdog Permit qemu to access sheepdog volume on sheepdog's pool
by joel SIMOES
From: Joël Simoes <jsimoes@jsimoes>
---
src/qemu/qemu_conf.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 62 insertions(+), 4 deletions(-)
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 4378791..2d2f428 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -1185,6 +1185,56 @@ int qemuDriverAllocateID(virQEMUDriverPtr driver)
return virAtomicIntInc(&driver->nextvmid);
}
+
+static int
+qemuAddSheepPoolSourceHost(virDomainDiskDefPtr def,
+ virStoragePoolDefPtr pooldef)
+{
+ int ret = -1;
+ char **tokens = NULL;
+
+ /* Only support one host */
+ if (pooldef->source.nhost != 1) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("Expected exactly 1 host for the storage pool"));
+ goto cleanup;
+ }
+
+ /* iscsi pool only supports one host */
+ def->nhosts = 1;
+
+ if (VIR_ALLOC_N(def->hosts, def->nhosts) < 0)
+ goto cleanup;
+
+ if (VIR_STRDUP(def->hosts[0].name, pooldef->source.hosts[0].name) < 0)
+ goto cleanup;
+
+ if (virAsprintf(&def->hosts[0].port, "%d",
+ pooldef->source.hosts[0].port ?
+ pooldef->source.hosts[0].port :
+ 7000) < 0)
+ goto cleanup;
+
+
+
+
+
+ /* Storage pool have not supported these 2 attributes yet,
+ * use the defaults.
+ */
+ def->hosts[0].transport = VIR_DOMAIN_DISK_PROTO_TRANS_TCP;
+ def->hosts[0].socket = NULL;
+
+
+ def->protocol = VIR_DOMAIN_DISK_PROTOCOL_SHEEPDOG;
+
+ ret = 0;
+
+cleanup:
+ virStringFreeList(tokens);
+ return ret;
+}
+
static int
qemuAddISCSIPoolSourceHost(virDomainDiskDefPtr def,
virStoragePoolDefPtr pooldef)
@@ -1353,10 +1403,10 @@ qemuTranslateDiskSourcePool(virConnectPtr conn,
def->srcpool->pooltype = pooldef->type;
def->srcpool->voltype = info.type;
- if (def->srcpool->mode && pooldef->type != VIR_STORAGE_POOL_ISCSI) {
+ if ((def->srcpool->mode && pooldef->type != VIR_STORAGE_POOL_ISCSI) || (def->srcpool->mode != VIR_DOMAIN_DISK_SOURCE_POOL_MODE_DIRECT && pooldef->type == VIR_STORAGE_POOL_SHEEPDOG ) ) {
virReportError(VIR_ERR_XML_ERROR, "%s",
_("disk source mode is only valid when "
- "storage pool is of iscsi type"));
+ "storage pool is of iscsi type or only direct for sheepdog "));
goto cleanup;
}
@@ -1439,9 +1489,17 @@ qemuTranslateDiskSourcePool(virConnectPtr conn,
}
break;
- case VIR_STORAGE_POOL_MPATH:
- case VIR_STORAGE_POOL_RBD:
case VIR_STORAGE_POOL_SHEEPDOG:
+ def->srcpool->actualtype = VIR_DOMAIN_DISK_TYPE_NETWORK;
+ // force direct mode
+ def->srcpool->mode = VIR_DOMAIN_DISK_SOURCE_POOL_MODE_DIRECT;
+ def->protocol = VIR_DOMAIN_DISK_PROTOCOL_SHEEPDOG;
+ def->src = virStorageVolGetPath(vol);
+
+ qemuAddSheepPoolSourceHost(def, pooldef);
+ break;
+ case VIR_STORAGE_POOL_MPATH:
+ case VIR_STORAGE_POOL_RBD:
case VIR_STORAGE_POOL_GLUSTER:
case VIR_STORAGE_POOL_LAST:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
--
1.8.3.2
11 years, 3 months
[libvirt] [PATCH]qemu:sheepdog Permit qemu to access sheepdog volume on sheepdog's pool
by joel SIMOES
From: Joel SIMOES <joel.simoes(a)laposte.net>
---
src/qemu/qemu_conf.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 62 insertions(+), 4 deletions(-)
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 4378791..2d2f428 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -1185,6 +1185,56 @@ int qemuDriverAllocateID(virQEMUDriverPtr driver)
return virAtomicIntInc(&driver->nextvmid);
}
+
+static int
+qemuAddSheepPoolSourceHost(virDomainDiskDefPtr def,
+ virStoragePoolDefPtr pooldef)
+{
+ int ret = -1;
+ char **tokens = NULL;
+
+ /* Only support one host */
+ if (pooldef->source.nhost != 1) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("Expected exactly 1 host for the storage pool"));
+ goto cleanup;
+ }
+
+ /* iscsi pool only supports one host */
+ def->nhosts = 1;
+
+ if (VIR_ALLOC_N(def->hosts, def->nhosts) < 0)
+ goto cleanup;
+
+ if (VIR_STRDUP(def->hosts[0].name, pooldef->source.hosts[0].name) < 0)
+ goto cleanup;
+
+ if (virAsprintf(&def->hosts[0].port, "%d",
+ pooldef->source.hosts[0].port ?
+ pooldef->source.hosts[0].port :
+ 7000) < 0)
+ goto cleanup;
+
+
+
+
+
+ /* Storage pool have not supported these 2 attributes yet,
+ * use the defaults.
+ */
+ def->hosts[0].transport = VIR_DOMAIN_DISK_PROTO_TRANS_TCP;
+ def->hosts[0].socket = NULL;
+
+
+ def->protocol = VIR_DOMAIN_DISK_PROTOCOL_SHEEPDOG;
+
+ ret = 0;
+
+cleanup:
+ virStringFreeList(tokens);
+ return ret;
+}
+
static int
qemuAddISCSIPoolSourceHost(virDomainDiskDefPtr def,
virStoragePoolDefPtr pooldef)
@@ -1353,10 +1403,10 @@ qemuTranslateDiskSourcePool(virConnectPtr conn,
def->srcpool->pooltype = pooldef->type;
def->srcpool->voltype = info.type;
- if (def->srcpool->mode && pooldef->type != VIR_STORAGE_POOL_ISCSI) {
+ if ((def->srcpool->mode && pooldef->type != VIR_STORAGE_POOL_ISCSI) || (def->srcpool->mode != VIR_DOMAIN_DISK_SOURCE_POOL_MODE_DIRECT && pooldef->type == VIR_STORAGE_POOL_SHEEPDOG ) ) {
virReportError(VIR_ERR_XML_ERROR, "%s",
_("disk source mode is only valid when "
- "storage pool is of iscsi type"));
+ "storage pool is of iscsi type or only direct for sheepdog "));
goto cleanup;
}
@@ -1439,9 +1489,17 @@ qemuTranslateDiskSourcePool(virConnectPtr conn,
}
break;
- case VIR_STORAGE_POOL_MPATH:
- case VIR_STORAGE_POOL_RBD:
case VIR_STORAGE_POOL_SHEEPDOG:
+ def->srcpool->actualtype = VIR_DOMAIN_DISK_TYPE_NETWORK;
+ // force direct mode
+ def->srcpool->mode = VIR_DOMAIN_DISK_SOURCE_POOL_MODE_DIRECT;
+ def->protocol = VIR_DOMAIN_DISK_PROTOCOL_SHEEPDOG;
+ def->src = virStorageVolGetPath(vol);
+
+ qemuAddSheepPoolSourceHost(def, pooldef);
+ break;
+ case VIR_STORAGE_POOL_MPATH:
+ case VIR_STORAGE_POOL_RBD:
case VIR_STORAGE_POOL_GLUSTER:
case VIR_STORAGE_POOL_LAST:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
--
1.8.3.2
11 years, 3 months
[libvirt] [PATCHv2 0/2] Add a test for linuxNodeGetCPUStats
by Ján Tomko
v1: https://www.redhat.com/archives/libvir-list/2014-January/msg00951.html
v2:
use ticks instead of nsecs in test data
Ján Tomko (2):
Add test for linuxNodeGetCPUStats
Simplify linuxNodeGetCPUStats
src/libvirt_linux.syms | 1 +
src/nodeinfo.c | 83 +++++++--------
tests/nodeinfodata/linux-cpustat-24cpu.out | 150 ++++++++++++++++++++++++++++
tests/nodeinfodata/linux-cpustat-24cpu.stat | 25 +++++
tests/nodeinfotest.c | 131 ++++++++++++++++++++++++
5 files changed, 342 insertions(+), 48 deletions(-)
create mode 100644 tests/nodeinfodata/linux-cpustat-24cpu.out
create mode 100644 tests/nodeinfodata/linux-cpustat-24cpu.stat
--
1.8.3.2
11 years, 3 months
[libvirt] [PATCH] qemu: Avoid crash in qemuDiskGetActualType
by Peter Krempa
Libvirtd would crash if a domain contained an empty cdrom drive of
type='volume' as the disk def->srcpool member would be dereferenced. Fix
it by checking if the source pool is present before dereferencing it.
Also alter tests to catch this issue in the future.
Reported by: Kevin Shanahan
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1056328
---
src/qemu/qemu_conf.c | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.args | 2 ++
tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.xml | 6 ++++++
3 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 4378791..ac53f6d 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -1302,7 +1302,7 @@ cleanup:
int
qemuDiskGetActualType(virDomainDiskDefPtr def)
{
- if (def->type == VIR_DOMAIN_DISK_TYPE_VOLUME)
+ if (def->type == VIR_DOMAIN_DISK_TYPE_VOLUME && def->srcpool)
return def->srcpool->actualtype;
return def->type;
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.args
index da87ad9..6b409b7 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.args
@@ -3,6 +3,8 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb -drive \
file=/some/block/device/cdrom,if=none,media=cdrom,id=drive-ide0-0-1 -device \
ide-drive,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1 -drive \
+if=none,media=cdrom,id=drive-ide0-1-0 -device \
+ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -drive \
file=/tmp/idedisk.img,if=none,id=drive-ide0-0-2 -device \
ide-drive,bus=ide.0,unit=2,drive=drive-ide0-0-2,id=ide0-0-2 -device \
virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.xml
index 6ca5cf7..e96f76e 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.xml
@@ -24,6 +24,12 @@
<readonly/>
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
</disk>
+ <disk type='volume' device='cdrom'>
+ <driver name='qemu' type='raw'/>
+ <target dev='hdc' bus='ide'/>
+ <readonly/>
+ <address type='drive' controller='0' bus='1' target='0' unit='0'/>
+ </disk>
<disk type='file' device='disk'>
<source file='/tmp/idedisk.img'/>
<target dev='hdc' bus='ide'/>
--
1.8.5.3
11 years, 3 months
[libvirt] [PATCH 0/3] Doc fixes
by Osier Yang
*** BLURB HERE ***
Osier Yang (3):
virsh: Fix the string breaking style
Doc: Improve the document for nodesuspend
Doc: Add "note" for node-memory-tune
tools/virsh-host.c | 6 +++---
tools/virsh.pod | 16 +++++++++++-----
2 files changed, 14 insertions(+), 8 deletions(-)
--
1.8.1.4
11 years, 3 months
[libvirt] [PATCH v2] virtlockd: make re-exec more robust
by Michael Chapman
- Use $XDG_RUNTIME_DIR for re-exec state file when running unprivileged.
- argv[0] may not contain a full path to the binary, however it should
contain something that can be looked up in the PATH. Use execvp() to
do path lookup on re-exec.
- As per list discussion [1], ignore --daemon on re-exec.
[1] https://www.redhat.com/archives/libvir-list/2013-December/msg00514.html
Signed-off-by: Michael Chapman <mike(a)very.puzzling.org>
---
src/locking/lock_daemon.c | 128 ++++++++++++++++++++++++++++++++++------------
1 file changed, 94 insertions(+), 34 deletions(-)
diff --git a/src/locking/lock_daemon.c b/src/locking/lock_daemon.c
index a6be43c..b405e3a 100644
--- a/src/locking/lock_daemon.c
+++ b/src/locking/lock_daemon.c
@@ -925,7 +925,41 @@ error:
}
-#define VIR_LOCK_DAEMON_RESTART_EXEC_FILE LOCALSTATEDIR "/run/virtlockd-restart-exec.json"
+static int
+virLockDaemonExecRestartStatePath(bool privileged,
+ char **state_file)
+{
+ if (privileged) {
+ if (VIR_STRDUP(*state_file, LOCALSTATEDIR "/run/virtlockd-restart-exec.json") < 0)
+ goto error;
+ } else {
+ char *rundir = NULL;
+ mode_t old_umask;
+
+ if (!(rundir = virGetUserRuntimeDirectory()))
+ goto error;
+
+ old_umask = umask(077);
+ if (virFileMakePath(rundir) < 0) {
+ umask(old_umask);
+ goto error;
+ }
+ umask(old_umask);
+
+ if (virAsprintf(state_file, "%s/virtlockd-restart-exec.json", rundir) < 0) {
+ VIR_FREE(rundir);
+ goto error;
+ }
+
+ VIR_FREE(rundir);
+ }
+
+ return 0;
+
+error:
+ return -1;
+}
+
static char *
virLockDaemonGetExecRestartMagic(void)
@@ -938,7 +972,10 @@ virLockDaemonGetExecRestartMagic(void)
static int
-virLockDaemonPostExecRestart(bool privileged)
+virLockDaemonPostExecRestart(const char *state_file,
+ const char *pid_file,
+ int *pid_file_fd,
+ bool privileged)
{
const char *gotmagic;
char *wantmagic = NULL;
@@ -948,14 +985,14 @@ virLockDaemonPostExecRestart(bool privileged)
VIR_DEBUG("Running post-restart exec");
- if (!virFileExists(VIR_LOCK_DAEMON_RESTART_EXEC_FILE)) {
- VIR_DEBUG("No restart file %s present",
- VIR_LOCK_DAEMON_RESTART_EXEC_FILE);
+ if (!virFileExists(state_file)) {
+ VIR_DEBUG("No restart state file %s present",
+ state_file);
ret = 0;
goto cleanup;
}
- if (virFileReadAll(VIR_LOCK_DAEMON_RESTART_EXEC_FILE,
+ if (virFileReadAll(state_file,
1024 * 1024 * 10, /* 10 MB */
&state) < 0)
goto cleanup;
@@ -982,13 +1019,18 @@ virLockDaemonPostExecRestart(bool privileged)
goto cleanup;
}
+ /* Re-claim PID file now as we will not be daemonizing */
+ if (pid_file &&
+ (*pid_file_fd = virPidFileAcquirePath(pid_file, getpid())) < 0)
+ goto cleanup;
+
if (!(lockDaemon = virLockDaemonNewPostExecRestart(object, privileged)))
goto cleanup;
ret = 1;
cleanup:
- unlink(VIR_LOCK_DAEMON_RESTART_EXEC_FILE);
+ unlink(state_file);
VIR_FREE(wantmagic);
VIR_FREE(state);
virJSONValueFree(object);
@@ -997,7 +1039,8 @@ cleanup:
static int
-virLockDaemonPreExecRestart(virNetServerPtr srv,
+virLockDaemonPreExecRestart(const char *state_file,
+ virNetServerPtr srv,
char **argv)
{
virJSONValuePtr child;
@@ -1065,15 +1108,15 @@ virLockDaemonPreExecRestart(virNetServerPtr srv,
VIR_DEBUG("Saving state %s", state);
- if (virFileWriteStr(VIR_LOCK_DAEMON_RESTART_EXEC_FILE,
+ if (virFileWriteStr(state_file,
state, 0700) < 0) {
virReportSystemError(errno,
_("Unable to save state file %s"),
- VIR_LOCK_DAEMON_RESTART_EXEC_FILE);
+ state_file);
goto cleanup;
}
- if (execv(argv[0], argv) < 0) {
+ if (execvp(argv[0], argv) < 0) {
virReportSystemError(errno, "%s",
_("Unable to restart self"));
goto cleanup;
@@ -1153,6 +1196,7 @@ int main(int argc, char **argv) {
char *pid_file = NULL;
int pid_file_fd = -1;
char *sock_file = NULL;
+ char *state_file = NULL;
bool implicit_conf = false;
mode_t old_umask;
bool privileged = false;
@@ -1276,21 +1320,13 @@ int main(int argc, char **argv) {
VIR_DEBUG("Decided on socket paths '%s'",
sock_file);
- if (godaemon) {
- char ebuf[1024];
-
- if (chdir("/") < 0) {
- VIR_ERROR(_("cannot change to root directory: %s"),
- virStrerror(errno, ebuf, sizeof(ebuf)));
- goto cleanup;
- }
-
- if ((statuswrite = virLockDaemonForkIntoBackground(argv[0])) < 0) {
- VIR_ERROR(_("Failed to fork as daemon: %s"),
- virStrerror(errno, ebuf, sizeof(ebuf)));
- goto cleanup;
- }
+ if (virLockDaemonExecRestartStatePath(privileged,
+ &state_file) < 0) {
+ VIR_ERROR(_("Can't determine restart state file path"));
+ exit(EXIT_FAILURE);
}
+ VIR_DEBUG("Decided on restart state file path '%s'",
+ state_file);
/* Ensure the rundir exists (on tmpfs on some systems) */
if (privileged) {
@@ -1317,20 +1353,41 @@ int main(int argc, char **argv) {
}
umask(old_umask);
- /* If we have a pidfile set, claim it now, exiting if already taken */
- if ((pid_file_fd = virPidFileAcquirePath(pid_file, getpid())) < 0) {
- ret = VIR_LOCK_DAEMON_ERR_PIDFILE;
- goto cleanup;
- }
-
- if ((rv = virLockDaemonPostExecRestart(privileged)) < 0) {
+ if ((rv = virLockDaemonPostExecRestart(state_file,
+ pid_file,
+ &pid_file_fd,
+ privileged)) < 0) {
ret = VIR_LOCK_DAEMON_ERR_INIT;
goto cleanup;
}
/* rv == 1, means we setup everything from saved state,
- * so we only setup stuff from scratch if rv == 0 */
+ * so only (possibly) daemonize and setup stuff from
+ * scratch if rv == 0
+ */
if (rv == 0) {
+ if (godaemon) {
+ char ebuf[1024];
+
+ if (chdir("/") < 0) {
+ VIR_ERROR(_("cannot change to root directory: %s"),
+ virStrerror(errno, ebuf, sizeof(ebuf)));
+ goto cleanup;
+ }
+
+ if ((statuswrite = virLockDaemonForkIntoBackground(argv[0])) < 0) {
+ VIR_ERROR(_("Failed to fork as daemon: %s"),
+ virStrerror(errno, ebuf, sizeof(ebuf)));
+ goto cleanup;
+ }
+ }
+
+ /* If we have a pidfile set, claim it now, exiting if already taken */
+ if ((pid_file_fd = virPidFileAcquirePath(pid_file, getpid())) < 0) {
+ ret = VIR_LOCK_DAEMON_ERR_PIDFILE;
+ goto cleanup;
+ }
+
if (!(lockDaemon = virLockDaemonNew(config, privileged))) {
ret = VIR_LOCK_DAEMON_ERR_INIT;
goto cleanup;
@@ -1388,7 +1445,9 @@ int main(int argc, char **argv) {
virNetServerRun(lockDaemon->srv);
if (execRestart &&
- virLockDaemonPreExecRestart(lockDaemon->srv, argv) < 0)
+ virLockDaemonPreExecRestart(state_file,
+ lockDaemon->srv,
+ argv) < 0)
ret = VIR_LOCK_DAEMON_ERR_REEXEC;
else
ret = 0;
@@ -1410,6 +1469,7 @@ cleanup:
virPidFileReleasePath(pid_file, pid_file_fd);
VIR_FREE(pid_file);
VIR_FREE(sock_file);
+ VIR_FREE(state_file);
VIR_FREE(run_dir);
return ret;
--
1.8.4.2
11 years, 3 months
[libvirt] [PATCH] docs: refer to the correct event ID for DomainEventIOErrorReasonCallback
by Claudio Bley
s/_ID_IO_ERROR/_ID_IO_ERROR_REASON/
Signed-off-by: Claudio Bley <cbley(a)av-test.de>
---
Pushed under the trivial rule.
include/libvirt/libvirt.h.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
index a448411..47a896b 100644
--- a/include/libvirt/libvirt.h.in
+++ b/include/libvirt/libvirt.h.in
@@ -4664,7 +4664,7 @@ typedef void (*virConnectDomainEventIOErrorCallback)(virConnectPtr conn,
* @opaque: application specified data
*
* The callback signature to use when registering for an event of type
- * VIR_DOMAIN_EVENT_ID_IO_ERROR with virConnectDomainEventRegisterAny()
+ * VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON with virConnectDomainEventRegisterAny()
*
*/
typedef void (*virConnectDomainEventIOErrorReasonCallback)(virConnectPtr conn,
--
1.7.9.5
11 years, 3 months
[libvirt] [PATCH 0/2] Add a test for linuxNodeGetCPUStats
by Ján Tomko
Ján Tomko (2):
Add test for linuxNodeGetCPUStats
Simplify linuxNodeGetCPUStats
src/libvirt_linux.syms | 1 +
src/nodeinfo.c | 83 +++++++--------
tests/nodeinfodata/linux-cpustat-24cpu.out | 150 ++++++++++++++++++++++++++++
tests/nodeinfodata/linux-cpustat-24cpu.stat | 25 +++++
tests/nodeinfotest.c | 128 ++++++++++++++++++++++++
5 files changed, 339 insertions(+), 48 deletions(-)
create mode 100644 tests/nodeinfodata/linux-cpustat-24cpu.out
create mode 100644 tests/nodeinfodata/linux-cpustat-24cpu.stat
--
1.8.3.2
11 years, 3 months
[libvirt] [PATCH] qemu: snapshot: Forbid snapshots when backing is a scsi passthrough disk
by Peter Krempa
https://bugzilla.redhat.com/show_bug.cgi?id=1034993
SCSI passthrough disks (<disk .. device="lun">) can't be used as backing
for snapshots. Currently with upstream qemu the vm crashes on such
attempt.
This patch adds a early check to catch an attempt to do such a snapshot
and rejects it right away. qemu will fix the issue but this will let us
control the error message.
---
Notes:
You need a domain with a similar disk config to test this patch:
<disk type='block' device='lun'>
<driver name='qemu' type='raw'/>
<source dev='/dev/disk/by-path/ip-192.168.122.223:3260-iscsi-iqn.2011-03.org.example.istgt:test-lun-0'/>
<target dev='sda' bus='scsi'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<controller type='scsi' index='0' model='virtio-scsi'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
</controller>
src/qemu/qemu_driver.c | 24 ++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index b101d77..bc29714 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -12206,7 +12206,7 @@ endjob:
}
static int
-qemuDomainSnapshotPrepareDiskExternalBacking(virDomainDiskDefPtr disk)
+qemuDomainSnapshotPrepareDiskExternalBackingInactive(virDomainDiskDefPtr disk)
{
int actualType = qemuDiskGetActualType(disk);
@@ -12250,6 +12250,23 @@ qemuDomainSnapshotPrepareDiskExternalBacking(virDomainDiskDefPtr disk)
static int
+qemuDomainSnapshotPrepareDiskExternalBackingActive(virDomainDiskDefPtr disk)
+{
+ int actualType = qemuDiskGetActualType(disk);
+
+ if (actualType == VIR_DOMAIN_DISK_TYPE_BLOCK &&
+ disk->device == VIR_DOMAIN_DISK_DEVICE_LUN) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("external active snapshots are not supported on scsi "
+ "passthrough devices"));
+ return -1;
+ }
+
+ return 0;
+}
+
+
+static int
qemuDomainSnapshotPrepareDiskExternalOverlayActive(virDomainSnapshotDiskDefPtr disk)
{
int actualType = qemuSnapshotDiskGetActualType(disk);
@@ -12315,12 +12332,15 @@ qemuDomainSnapshotPrepareDiskExternal(virConnectPtr conn,
if (qemuTranslateDiskSourcePool(conn, disk) < 0)
return -1;
- if (qemuDomainSnapshotPrepareDiskExternalBacking(disk) < 0)
+ if (qemuDomainSnapshotPrepareDiskExternalBackingInactive(disk) < 0)
return -1;
if (qemuDomainSnapshotPrepareDiskExternalOverlayInactive(snapdisk) < 0)
return -1;
} else {
+ if (qemuDomainSnapshotPrepareDiskExternalBackingActive(disk) < 0)
+ return -1;
+
if (qemuDomainSnapshotPrepareDiskExternalOverlayActive(snapdisk) < 0)
return -1;
}
--
1.8.5.3
11 years, 3 months