[libvirt] [PATCH 1/2] build: fix build on cygwin
by Eric Blake
On cygwin:
CC libvirt_util_la-cgroup.lo
util/cgroup.c: In function 'virCgroupKillRecursiveInternal':
util/cgroup.c:1458: warning: implicit declaration of function 'virCgroupNew' [-Wimplicit-function-declaration]
* src/util/cgroup.c (virCgroupKill): Don't build on platforms
where virCgroupNew is unsupported.
---
Pushing under the build-breaker rule. And this time, it really
was a cygwin failure ;)
src/util/cgroup.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/util/cgroup.c b/src/util/cgroup.c
index c5b8cdd..8551acd 100644
--- a/src/util/cgroup.c
+++ b/src/util/cgroup.c
@@ -1308,7 +1308,7 @@ int virCgroupGetFreezerState(virCgroupPtr group, char **state)
}
-#ifdef HAVE_KILL
+#if defined HAVE_KILL && defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R
static int virCgroupKillInternal(virCgroupPtr group, int signum, virHashTablePtr pids)
{
int rc;
@@ -1523,7 +1523,7 @@ int virCgroupKillPainfully(virCgroupPtr group)
return rc;
}
-#else /* HAVE_KILL */
+#else /* !(HAVE_KILL, HAVE_MNTENT_H, HAVE_GETMNTENT_R) */
int virCgroupKill(virCgroupPtr group ATTRIBUTE_UNUSED,
int signum ATTRIBUTE_UNUSED)
{
@@ -1539,4 +1539,4 @@ int virCgroupKillPainfully(virCgroupPtr group ATTRIBUTE_UNUSED)
{
return -ENOSYS;
}
-#endif /* HAVE_KILL */
+#endif /* HAVE_KILL, HAVE_MNTENT_H, HAVE_GETMNTENT_R */
--
1.7.4
13 years, 8 months
[libvirt] [PATCH] build: fix building error when building without libvirtd
by Wen Congyang
When building libvirt without libvirtd, I receive the following errors:
make[1]: Leaving directory `/home/wency/source/test/libvirt/src'
(cd daemon && make top_distdir=../libvirt-0.8.8 distdir=../libvirt-0.8.8/daemon \
am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[1]: Entering directory `/home/wency/source/test/libvirt/daemon'
make[1]: *** No rule to make target `libvirtd.8.in', needed by `distdir'. Stop.
make[1]: Leaving directory `/home/wency/source/test/libvirt/daemon'
make: *** [distdir] Error 1
This bug was caused by commit 6db98a2d.
Signed-off-by: Wen Congyang <wency(a)cn.fujitsu.com>
---
daemon/Makefile.am | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
index 912440c..b4880a9 100644
--- a/daemon/Makefile.am
+++ b/daemon/Makefile.am
@@ -38,7 +38,6 @@ EXTRA_DIST = \
test_libvirtd.aug \
THREADING.txt \
libvirtd.pod.in \
- libvirtd.8.in \
libvirtd.stp \
$(AVAHI_SOURCES) \
$(DAEMON_SOURCES)
@@ -47,6 +46,8 @@ BUILT_SOURCES =
if WITH_LIBVIRTD
+EXTRA_DIST += libvirtd.8.in
+
man8_MANS = libvirtd.8
sbin_PROGRAMS = libvirtd
--
1.7.1
13 years, 8 months
[libvirt] [RFC PATCH] cgroup: allow fine-tuning of device ACL permissions
by Eric Blake
Adding audit points showed that we were granting too much privilege
to qemu; it should not need any mknod rights to recreate any
devices other than ptys. On the other hand, lxc should have all
device privileges. The solution is adding a flag parameter.
* src/util/cgroup.h (virCgroup*Device*): Adjust prototypes.
* src/util/cgroup.c (virCgroupAllowDevice)
(virCgroupAllowDeviceMajor, virCgroupAllowDevicePath)
(virCgroupDenyDevice, virCgroupDenyDeviceMajor)
(virCgroupDenyDevicePath): Add parameter.
* src/qemu/qemu_cgroup.c: Update clients.
* src/qemu/qemu_driver.c (qemudDomainSaveFlag): Likewise.
* src/lxc/lxc_controller.c (lxcSetContainerResources): Likewise.
---
https://bugzilla.redhat.com/show_bug.cgi?id=683163 was created
based on my audit patches.
RFC for two reasons:
This patch won't apply unless you have my other pending qemu audit
patches in place (I still need to post those, but ran out of time
for now...)
I need to do a followup patch to also restrict write access to
a disk explicitly marked read-only from qemu's point of view.
But I wanted to at least get this email posted to start feedback.
src/lxc/lxc_controller.c | 9 +++++--
src/qemu/qemu_cgroup.c | 23 +++++++++++-------
src/qemu/qemu_driver.c | 9 +++++--
src/util/cgroup.c | 55 +++++++++++++++++++++++++++++++++------------
src/util/cgroup.h | 26 ++++++++++++++++-----
5 files changed, 86 insertions(+), 36 deletions(-)
diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c
index d2b113c..296b302 100644
--- a/src/lxc/lxc_controller.c
+++ b/src/lxc/lxc_controller.c
@@ -1,5 +1,6 @@
/*
- * Copyright (C) 2010 Red Hat, Inc. Copyright IBM Corp. 2008
+ * Copyright (C) 2010-2011 Red Hat, Inc.
+ * Copyright IBM Corp. 2008
*
* lxc_controller.c: linux container process controller
*
@@ -168,7 +169,8 @@ static int lxcSetContainerResources(virDomainDefPtr def)
rc = virCgroupAllowDevice(cgroup,
dev->type,
dev->major,
- dev->minor);
+ dev->minor,
+ VIR_CGROUP_DEVICE_RWM);
if (rc != 0) {
virReportSystemError(-rc,
_("Unable to allow device %c:%d:%d for domain %s"),
@@ -177,7 +179,8 @@ static int lxcSetContainerResources(virDomainDefPtr def)
}
}
- rc = virCgroupAllowDeviceMajor(cgroup, 'c', LXC_DEV_MAJ_PTY);
+ rc = virCgroupAllowDeviceMajor(cgroup, 'c', LXC_DEV_MAJ_PTY,
+ VIR_CGROUP_DEVICE_RWM);
if (rc != 0) {
virReportSystemError(-rc,
_("Unable to allow PYT devices for domain %s"),
diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
index ebf9ad5..3c124fd 100644
--- a/src/qemu/qemu_cgroup.c
+++ b/src/qemu/qemu_cgroup.c
@@ -66,7 +66,8 @@ qemuSetupDiskPathAllow(virDomainDiskDefPtr disk ATTRIBUTE_UNUSED,
VIR_DEBUG("Process path %s for disk", path);
/* XXX RO vs RW */
- rc = virCgroupAllowDevicePath(data->cgroup, path);
+ rc = virCgroupAllowDevicePath(data->cgroup, path,
+ VIR_CGROUP_DEVICE_RW);
qemuAuditCgroupPath(data->vm, data->cgroup, "allow", path, rc);
if (rc < 0) {
if (rc == -EACCES) { /* Get this for root squash NFS */
@@ -106,8 +107,8 @@ qemuTeardownDiskPathDeny(virDomainDiskDefPtr disk ATTRIBUTE_UNUSED,
int rc;
VIR_DEBUG("Process path %s for disk", path);
- /* XXX RO vs RW */
- rc = virCgroupDenyDevicePath(data->cgroup, path);
+ rc = virCgroupDenyDevicePath(data->cgroup, path,
+ VIR_CGROUP_DEVICE_RWM);
qemuAuditCgroupPath(data->vm, data->cgroup, "deny", path, rc);
if (rc < 0) {
if (rc == -EACCES) { /* Get this for root squash NFS */
@@ -150,7 +151,8 @@ qemuSetupChardevCgroup(virDomainDefPtr def,
VIR_DEBUG("Process path '%s' for disk", dev->source.data.file.path);
- rc = virCgroupAllowDevicePath(data->cgroup, dev->source.data.file.path);
+ rc = virCgroupAllowDevicePath(data->cgroup, dev->source.data.file.path,
+ VIR_CGROUP_DEVICE_RW);
qemuAuditCgroupPath(data->vm, data->cgroup, "allow",
dev->source.data.file.path, rc);
if (rc < 0) {
@@ -172,7 +174,8 @@ int qemuSetupHostUsbDeviceCgroup(usbDevice *dev ATTRIBUTE_UNUSED,
int rc;
VIR_DEBUG("Process path '%s' for USB device", path);
- rc = virCgroupAllowDevicePath(data->cgroup, path);
+ rc = virCgroupAllowDevicePath(data->cgroup, path,
+ VIR_CGROUP_DEVICE_RW);
qemuAuditCgroupPath(data->vm, data->cgroup, "allow", path, rc);
if (rc < 0) {
virReportSystemError(-rc,
@@ -226,7 +229,8 @@ int qemuSetupCgroup(struct qemud_driver *driver,
goto cleanup;
}
- rc = virCgroupAllowDeviceMajor(cgroup, 'c', DEVICE_PTY_MAJOR);
+ rc = virCgroupAllowDeviceMajor(cgroup, 'c', DEVICE_PTY_MAJOR,
+ VIR_CGROUP_DEVICE_RWM);
qemuAuditCgroupMajor(vm, cgroup, "allow", DEVICE_PTY_MAJOR,
"pty", rc == 0);
if (rc != 0) {
@@ -240,7 +244,8 @@ int qemuSetupCgroup(struct qemud_driver *driver,
((vm->def->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC &&
driver->vncAllowHostAudio) ||
(vm->def->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_SDL)))) {
- rc = virCgroupAllowDeviceMajor(cgroup, 'c', DEVICE_SND_MAJOR);
+ rc = virCgroupAllowDeviceMajor(cgroup, 'c', DEVICE_SND_MAJOR,
+ VIR_CGROUP_DEVICE_RWM);
qemuAuditCgroupMajor(vm, cgroup, "allow", DEVICE_SND_MAJOR,
"sound", rc == 0);
if (rc != 0) {
@@ -251,8 +256,8 @@ int qemuSetupCgroup(struct qemud_driver *driver,
}
for (i = 0; deviceACL[i] != NULL ; i++) {
- rc = virCgroupAllowDevicePath(cgroup,
- deviceACL[i]);
+ rc = virCgroupAllowDevicePath(cgroup, deviceACL[i],
+ VIR_CGROUP_DEVICE_RW);
qemuAuditCgroupPath(vm, cgroup, "allow", deviceACL[i], rc);
if (rc < 0 &&
rc != -ENOENT) {
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 1981cdf..7b4edc5 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -1962,7 +1962,8 @@ static int qemudDomainSaveFlag(struct qemud_driver *driver, virDomainPtr dom,
vm->def->name);
goto endjob;
}
- rc = virCgroupAllowDevicePath(cgroup, path);
+ rc = virCgroupAllowDevicePath(cgroup, path,
+ VIR_CGROUP_DEVICE_RW);
qemuAuditCgroupPath(vm, cgroup, "allow", path, rc);
if (rc < 0) {
virReportSystemError(-rc,
@@ -2012,7 +2013,8 @@ static int qemudDomainSaveFlag(struct qemud_driver *driver, virDomainPtr dom,
VIR_WARN("failed to restore save state label on %s", path);
if (cgroup != NULL) {
- rc = virCgroupDenyDevicePath(cgroup, path);
+ rc = virCgroupDenyDevicePath(cgroup, path,
+ VIR_CGROUP_DEVICE_RWM);
qemuAuditCgroupPath(vm, cgroup, "deny", path, rc);
if (rc < 0)
VIR_WARN("Unable to deny device %s for %s %d",
@@ -2044,7 +2046,8 @@ endjob:
}
if (cgroup != NULL) {
- rc = virCgroupDenyDevicePath(cgroup, path);
+ rc = virCgroupDenyDevicePath(cgroup, path,
+ VIR_CGROUP_DEVICE_RWM);
qemuAuditCgroupPath(vm, cgroup, "deny", path, rc);
if (rc < 0)
VIR_WARN("Unable to deny device %s for %s: %d",
diff --git a/src/util/cgroup.c b/src/util/cgroup.c
index a16b1ab..10e3143 100644
--- a/src/util/cgroup.c
+++ b/src/util/cgroup.c
@@ -1081,7 +1081,7 @@ int virCgroupGetSwapHardLimit(virCgroupPtr group, unsigned long long *kb)
/**
* virCgroupDenyAllDevices:
*
- * @group: The cgroup to deny devices for
+ * @group: The cgroup to deny all permissions, for all devices
*
* Returns: 0 on success
*/
@@ -1100,15 +1100,20 @@ int virCgroupDenyAllDevices(virCgroupPtr group)
* @type: The device type (i.e., 'c' or 'b')
* @major: The major number of the device
* @minor: The minor number of the device
+ * @perms: Bitwise or of VIR_CGROUP_DEVICE permission bits to allow
*
* Returns: 0 on success
*/
-int virCgroupAllowDevice(virCgroupPtr group, char type, int major, int minor)
+int virCgroupAllowDevice(virCgroupPtr group, char type, int major, int minor,
+ int perms)
{
int rc;
char *devstr = NULL;
- if (virAsprintf(&devstr, "%c %i:%i rwm", type, major, minor) == -1) {
+ if (virAsprintf(&devstr, "%c %i:%i %s%s%s", type, major, minor,
+ perms & VIR_CGROUP_DEVICE_READ ? "r" : "",
+ perms & VIR_CGROUP_DEVICE_WRITE ? "w" : "",
+ perms & VIR_CGROUP_DEVICE_MKNOD ? "m" : "") == -1) {
rc = -ENOMEM;
goto out;
}
@@ -1129,15 +1134,20 @@ out:
* @group: The cgroup to allow an entire device major type for
* @type: The device type (i.e., 'c' or 'b')
* @major: The major number of the device type
+ * @perms: Bitwise or of VIR_CGROUP_DEVICE permission bits to allow
*
* Returns: 0 on success
*/
-int virCgroupAllowDeviceMajor(virCgroupPtr group, char type, int major)
+int virCgroupAllowDeviceMajor(virCgroupPtr group, char type, int major,
+ int perms)
{
int rc;
char *devstr = NULL;
- if (virAsprintf(&devstr, "%c %i:* rwm", type, major) == -1) {
+ if (virAsprintf(&devstr, "%c %i:* %s%s%s", type, major,
+ perms & VIR_CGROUP_DEVICE_READ ? "r" : "",
+ perms & VIR_CGROUP_DEVICE_WRITE ? "w" : "",
+ perms & VIR_CGROUP_DEVICE_MKNOD ? "m" : "") == -1) {
rc = -ENOMEM;
goto out;
}
@@ -1157,6 +1167,7 @@ int virCgroupAllowDeviceMajor(virCgroupPtr group, char type, int major)
*
* @group: The cgroup to allow the device for
* @path: the device to allow
+ * @perms: Bitwise or of VIR_CGROUP_DEVICE permission bits to allow
*
* Queries the type of device and its major/minor number, and
* adds that to the cgroup ACL
@@ -1165,7 +1176,7 @@ int virCgroupAllowDeviceMajor(virCgroupPtr group, char type, int major)
* negative errno value on failure
*/
#if defined(major) && defined(minor)
-int virCgroupAllowDevicePath(virCgroupPtr group, const char *path)
+int virCgroupAllowDevicePath(virCgroupPtr group, const char *path, int perms)
{
struct stat sb;
@@ -1178,11 +1189,13 @@ int virCgroupAllowDevicePath(virCgroupPtr group, const char *path)
return virCgroupAllowDevice(group,
S_ISCHR(sb.st_mode) ? 'c' : 'b',
major(sb.st_rdev),
- minor(sb.st_rdev));
+ minor(sb.st_rdev),
+ perms);
}
#else
int virCgroupAllowDevicePath(virCgroupPtr group ATTRIBUTE_UNUSED,
- const char *path ATTRIBUTE_UNUSED)
+ const char *path ATTRIBUTE_UNUSED,
+ int perms ATTRIBUTE_UNUSED)
{
return -ENOSYS;
}
@@ -1196,15 +1209,20 @@ int virCgroupAllowDevicePath(virCgroupPtr group ATTRIBUTE_UNUSED,
* @type: The device type (i.e., 'c' or 'b')
* @major: The major number of the device
* @minor: The minor number of the device
+ * @perms: Bitwise or of VIR_CGROUP_DEVICE permission bits to deny
*
* Returns: 0 on success
*/
-int virCgroupDenyDevice(virCgroupPtr group, char type, int major, int minor)
+int virCgroupDenyDevice(virCgroupPtr group, char type, int major, int minor,
+ int perms)
{
int rc;
char *devstr = NULL;
- if (virAsprintf(&devstr, "%c %i:%i rwm", type, major, minor) == -1) {
+ if (virAsprintf(&devstr, "%c %i:%i %s%s%s", type, major, minor,
+ perms & VIR_CGROUP_DEVICE_READ ? "r" : "",
+ perms & VIR_CGROUP_DEVICE_WRITE ? "w" : "",
+ perms & VIR_CGROUP_DEVICE_MKNOD ? "m" : "") == -1) {
rc = -ENOMEM;
goto out;
}
@@ -1225,15 +1243,20 @@ out:
* @group: The cgroup to deny an entire device major type for
* @type: The device type (i.e., 'c' or 'b')
* @major: The major number of the device type
+ * @perms: Bitwise or of VIR_CGROUP_DEVICE permission bits to deny
*
* Returns: 0 on success
*/
-int virCgroupDenyDeviceMajor(virCgroupPtr group, char type, int major)
+int virCgroupDenyDeviceMajor(virCgroupPtr group, char type, int major,
+ int perms)
{
int rc;
char *devstr = NULL;
- if (virAsprintf(&devstr, "%c %i:* rwm", type, major) == -1) {
+ if (virAsprintf(&devstr, "%c %i:* %s%s%s", type, major,
+ perms & VIR_CGROUP_DEVICE_READ ? "r" : "",
+ perms & VIR_CGROUP_DEVICE_WRITE ? "w" : "",
+ perms & VIR_CGROUP_DEVICE_MKNOD ? "m" : "") == -1) {
rc = -ENOMEM;
goto out;
}
@@ -1249,7 +1272,7 @@ int virCgroupDenyDeviceMajor(virCgroupPtr group, char type, int major)
}
#if defined(major) && defined(minor)
-int virCgroupDenyDevicePath(virCgroupPtr group, const char *path)
+int virCgroupDenyDevicePath(virCgroupPtr group, const char *path, int perms)
{
struct stat sb;
@@ -1262,11 +1285,13 @@ int virCgroupDenyDevicePath(virCgroupPtr group, const char *path)
return virCgroupDenyDevice(group,
S_ISCHR(sb.st_mode) ? 'c' : 'b',
major(sb.st_rdev),
- minor(sb.st_rdev));
+ minor(sb.st_rdev),
+ perms);
}
#else
int virCgroupDenyDevicePath(virCgroupPtr group ATTRIBUTE_UNUSED,
- const char *path ATTRIBUTE_UNUSED)
+ const char *path ATTRIBUTE_UNUSED,
+ int perms ATTRIBUTE_UNUSED)
{
return -ENOSYS;
}
diff --git a/src/util/cgroup.h b/src/util/cgroup.h
index b3c5f27..16ffb46 100644
--- a/src/util/cgroup.h
+++ b/src/util/cgroup.h
@@ -60,27 +60,41 @@ int virCgroupGetMemorySoftLimit(virCgroupPtr group, unsigned long long *kb);
int virCgroupSetSwapHardLimit(virCgroupPtr group, unsigned long long kb);
int virCgroupGetSwapHardLimit(virCgroupPtr group, unsigned long long *kb);
+enum {
+ VIR_CGROUP_DEVICE_READ = 1,
+ VIR_CGROUP_DEVICE_WRITE = 2,
+ VIR_CGROUP_DEVICE_MKNOD = 4,
+ VIR_CGROUP_DEVICE_RW = VIR_CGROUP_DEVICE_READ | VIR_CGROUP_DEVICE_WRITE,
+ VIR_CGROUP_DEVICE_RWM = VIR_CGROUP_DEVICE_RW | VIR_CGROUP_DEVICE_MKNOD,
+};
+
int virCgroupDenyAllDevices(virCgroupPtr group);
int virCgroupAllowDevice(virCgroupPtr group,
char type,
int major,
- int minor);
+ int minor,
+ int perms);
int virCgroupAllowDeviceMajor(virCgroupPtr group,
char type,
- int major);
+ int major,
+ int perms);
int virCgroupAllowDevicePath(virCgroupPtr group,
- const char *path);
+ const char *path,
+ int perms);
int virCgroupDenyDevice(virCgroupPtr group,
char type,
int major,
- int minor);
+ int minor,
+ int perms);
int virCgroupDenyDeviceMajor(virCgroupPtr group,
char type,
- int major);
+ int major,
+ int perms);
int virCgroupDenyDevicePath(virCgroupPtr group,
- const char *path);
+ const char *path,
+ int perms);
int virCgroupSetCpuShares(virCgroupPtr group, unsigned long long shares);
int virCgroupGetCpuShares(virCgroupPtr group, unsigned long long *shares);
--
1.7.4
13 years, 8 months
[libvirt] Fix cygwin build
by Daniel Veillard
In virLogEmergencyDumpAll I was using SIGBUS and SIGUSR2, and
apparently they arent; defined on cygwin signal.h header. I decided to
make the code conditional for all of them and not just those two for
portability sake. I resisted doing this on the daemon side because as
far as I know we don't compile it on WIN32. So I just pushed the
following under the build breaking rule,
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
daniel(a)veillard.com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
13 years, 8 months
[libvirt] [PATCH 1/2] virsh: Remove indirect link against libxml2
by Guido Günther
as described at
http://wiki.debian.org/ToolChain/DSOLinking
https://fedoraproject.org/wiki/UnderstandingDSOLinkChange
otherwise the build fails on current Debian unstable with:
CCLD virsh
/usr/bin/ld: virsh-virsh.o: undefined reference to symbol 'xmlSaveTree@(a)LIBXML2_2.6.8'
/usr/bin/ld: note: 'xmlSaveTree@(a)LIBXML2_2.6.8' is defined in DSO //usr/lib/libxml2.so.2 so try adding it to the linker command line
//usr/lib/libxml2.so.2: could not read symbols: Invalid operation
O.k. to apply?
-- Guido
---
tools/Makefile.am | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 68471ea..3e31dbd 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -47,6 +47,7 @@ virsh_LDADD = \
../src/libvirt.la \
../src/libvirt-qemu.la \
../gnulib/lib/libgnu.la \
+ $(LIBXML_LIBS) \
$(VIRSH_LIBS)
virsh_CFLAGS = \
-I$(top_srcdir)/gnulib/lib -I../gnulib/lib \
--
1.7.4.1
13 years, 8 months
[libvirt] [PATCH 0/2] virsh: Change command option parsing
by Michal Privoznik
This series changes some of vshCommandOpt* functions to return tri-state result
according to cases if argument was found and valid and permutations.
In addition, we ensure const-correctness of vshCommandOptString function and
related code.
Michal Privoznik (2):
virsh: change vshCommandOptString return type and fix
const-correctness
virsh: Change option parsing functions to return tri-state
information.
tools/virsh.c | 717 +++++++++++++++++++++++++++------------------------------
1 files changed, 335 insertions(+), 382 deletions(-)
--
1.7.4
13 years, 8 months
[libvirt] [RFC PATCH 0/5] Allow data upload/download to/from storage volumes
by Daniel P. Berrange
This patch series introduces two new APIs to allow data upload/download
to/from storage volumes, using the streams APIs. Mostly I wrote this so
I had an easier way to test the streams handling in my RPC patch series
than using QEMU tunnelled migration code. Cole has expressed an interest
in this kind of functionality in the past to allow virt-manager to upload
kernel/initrd to remote hosts for provisioning guests.
Most of the code here is pretty boring & trivial. The first patch is the
one that is remotely interesting. One might argue we should just spawn
'dd' instead of this, but dd has some annoying aspects (you can't control
its write offset in units smaller than the block size) and this could be
useful more broadly.
13 years, 8 months
[libvirt] [PATCH] docs/formatdomain: Add release info for disk <driver> attributes
by Cole Robinson
---
docs/formatdomain.html.in | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 84b1cab..9b9ab29 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -785,8 +785,7 @@
<dd>
The optional driver element allows specifying further details
related to the hypervisor driver used to provide the disk.
- <span class="since">Since 0.1.8; <code>io</code> attribute
- since 0.8.8</span>
+ <span class="since">Since 0.1.8</span>
<ul>
<li>
If the hypervisor supports multiple backend drivers, then
@@ -802,16 +801,18 @@
The optional <code>cache</code> attribute controls the
cache mechanism, possible values are "default", "none",
"writethrough" and "writeback".
+ <span class="since">Since 0.6.0</span>
</li>
<li>
The optional <code>error_policy</code> attribute controls
how the hypervisor will behave on an error, possible
values are "stop", "ignore", and "enospace".
+ <span class="since">Since 0.8.0</span>
</li>
<li>
The optional <code>io</code> attribute controls specific
policies on I/O; qemu guests support "threads" and
- "native".
+ "native". <span class="since">Since 0.8.8</span>
</li>
</ul>
</dd>
--
1.7.4
13 years, 8 months
[libvirt] [PATCH 0/3] device-detaching with generated mac
by Michal Privoznik
When detaching interface via detach-device or virDomainDetachDevice() we
parse input XML and (probably) generate a random MAC. This leads then into
not finding interface and thus error. When a mac wasn't specified and domain
has exactly one interface, semantic is clear. Otherwise we require <mac> in
input XML.
Michal Privoznik (3):
Introduce flag representing if MAC address of interface was generated
or not.
qemu: Check for generated MACs while detaching interface
xen: Check for generated MACs while detaching interface
src/conf/domain_conf.c | 2 ++
src/conf/domain_conf.h | 1 +
src/qemu/qemu_hotplug.c | 26 ++++++++++++++++++++------
src/xen/xm_internal.c | 3 ++-
4 files changed, 25 insertions(+), 7 deletions(-)
--
1.7.4
13 years, 8 months
[libvirt] [PATCH v2 0/4] Support domain snapshots with current QMP
by Jiri Denemark
This version 2 of this series implements the third alternative (suggested by
Dan Berrange) for falling back to HMP if appropriate snapshot command does not
exist in QMP.
Version 2:
- refactor text monitor commands into parts which can be called directly from
json monitor code
- implement HMP fallback for loadvm and delvm in addition to savevm
Jiri Denemark (4):
qemu: Refactor text monitor snapshot commands
qemu: Fallback to HMP when savevm QMP command is not found
qemu: Refactor qemuDomainSnapshotCreateXML
qemu: Stop guest CPUs before creating a snapshot
src/qemu/qemu_driver.c | 156 ++++++++++++++++++++++----------
src/qemu/qemu_monitor_json.c | 204 +++++++++++++++++++++++++++++++++++-------
src/qemu/qemu_monitor_text.c | 179 ++++++++++++++++++++++++++-----------
src/qemu/qemu_monitor_text.h | 8 ++
4 files changed, 411 insertions(+), 136 deletions(-)
--
1.7.4.1
13 years, 8 months