[libvirt] [PATCH 0/2] network: bandwidth tuning in session mode revert patch
by Erik Skultety
As Laine noted correctly, we should be testing for privileges on a global scale,
when trying to set bandwidth parameters. Therefore I moved the check from qemu_driver.c
and qemu_command.c into virnetdevbandwidth.c
Erik Skultety (2):
qemu: revert patch - bandwidth tuning in session mode
Iface: disallow network tuning in session mode globally
src/libvirt_private.syms | 4 ++++
src/qemu/qemu_command.c | 11 -----------
src/qemu/qemu_driver.c | 6 ------
src/util/virnetdevbandwidth.c | 31 ++++++++++++++++++++++++-------
src/util/virnetdevbandwidthpriv.h | 36 ++++++++++++++++++++++++++++++++++++
tests/virnetdevbandwidthtest.c | 5 +++--
6 files changed, 67 insertions(+), 26 deletions(-)
create mode 100644 src/util/virnetdevbandwidthpriv.h
--
1.9.3
10 years
[libvirt] ceps-based backing stores
by Lyssa P. Livingston
I have a file with an ceph-based backing store. I run this command:
nova boot vm-clone
where vm-clone is the rbd-backed file. It generates this command:
qemu-img create -f qcow2 -b rbd:rbdpool/disk/instance-00000002.0.disk:conf=/etc/ceph/ceph.conf:id=admin -F raw /mnt/novadisk/nova/instances/3efa8a7b-75a8-4695-8fdd-659185c46b7d/disk
and I am getting this error:
error: internal error: backing store parser is not implemented for protocol rbd
I was under the impression that qemu could work with ceph-based backing stores, so is there something I should run first, or files that I should patch, or ... ??? I am running libvirt 1.2.9. Thanks for any assistance you can provide.
Lyssa
10 years
[libvirt] [PATCH V2 0/2] libxl: user-specified domain config improvements
by Jim Fehlig
V2 of a small series to improve libxl driver's support for user-specified
config
https://www.redhat.com/archives/libvir-list/2014-September/msg01243.html
Patches 1-4 of that series have been pushed. In patch 5, Michal
suggested checking that the user-specified emulator is executable.
Patch 1 of this series is a respin of patch 5 that includes Michal's
suggestion. Patch 2 fixes an issue found while testing.
Jim Fehlig (2):
libxl: Support user-specified <emulator>
libxl: fix double-free of libxl_domain_build_info
src/libxl/libxl_conf.c | 48 +++++++++++++++++++++++++++++++++---------------
1 file changed, 33 insertions(+), 15 deletions(-)
--
1.8.4.5
10 years
[libvirt] [PATCH] Spell TIOCSCTTY right in the error message
by Ján Tomko
---
src/lxc/lxc_container.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Pushed as trivial.
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index 2af2674..f02b959 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -281,7 +281,7 @@ static int lxcContainerSetupFDs(int *ttyfd,
if (ioctl(*ttyfd, TIOCSCTTY, NULL) < 0) {
virReportSystemError(errno, "%s",
- _("ioctl(TIOCSTTY) failed"));
+ _("ioctl(TIOCSCTTY) failed"));
goto cleanup;
}
--
2.0.4
10 years
[libvirt] [PATCH v2 1/2] util: Introduce virPidFileForceCleanupPath
by Martin Kletzander
This function is used to cleanup a pidfile doing whatever it takes, even
killing the owning process.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
v2:
- Don't use "/proc", but simply just try to acquire the pidfile.
- https://www.redhat.com/archives/libvir-list/2014-October/msg00320.html
src/libvirt_private.syms | 1 +
src/util/virpidfile.c | 42 ++++++++++++++++++++++++++++++++++++++++++
src/util/virpidfile.h | 2 ++
3 files changed, 45 insertions(+)
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index d6265ac..30d100d 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -1810,6 +1810,7 @@ virPidFileBuildPath;
virPidFileConstructPath;
virPidFileDelete;
virPidFileDeletePath;
+virPidFileForceCleanupPath;
virPidFileRead;
virPidFileReadIfAlive;
virPidFileReadPath;
diff --git a/src/util/virpidfile.c b/src/util/virpidfile.c
index a3b8846..a64a1cf 100644
--- a/src/util/virpidfile.c
+++ b/src/util/virpidfile.c
@@ -37,6 +37,7 @@
#include "c-ctype.h"
#include "areadlink.h"
#include "virstring.h"
+#include "virprocess.h"
#define VIR_FROM_THIS VIR_FROM_NONE
@@ -567,3 +568,44 @@ virPidFileConstructPath(bool privileged,
VIR_FREE(rundir);
return ret;
}
+
+
+/**
+ * virPidFileForceCleanupPath:
+ *
+ * Check if the pidfile is left around and clean it up whatever it
+ * takes. This doesn't raise an error. This function must not be
+ * called multiple times with the same path, be it in threads or
+ * processes.
+ *
+ * Returns 0 if the pidfile was successfully cleaned up, -1 otherwise.
+ */
+int
+virPidFileForceCleanupPath(const char *path)
+{
+ pid_t pid = 0;
+ int fd = -1;
+
+ if (!virFileExists(path))
+ return 0;
+
+ if (virPidFileReadPath(path, &pid) < 0)
+ return -1;
+
+ if (virPidFileAcquirePath(path, false, 0) == 0) {
+ virPidFileReleasePath(path, fd);
+ } else {
+ virResetLastError();
+
+ /* Only kill the process if the pid is valid one. 0 means
+ * there is somebody else doing the same pidfile cleanup
+ * machinery. */
+ if (pid)
+ virProcessKillPainfully(pid, true);
+
+ if (virPidFileDeletePath(path) < 0)
+ return -1;
+ }
+
+ return 0;
+}
diff --git a/src/util/virpidfile.h b/src/util/virpidfile.h
index ca1dbff..eb6516c 100644
--- a/src/util/virpidfile.h
+++ b/src/util/virpidfile.h
@@ -74,4 +74,6 @@ int virPidFileConstructPath(bool privileged,
const char *progname,
char **pidfile);
+int virPidFileForceCleanupPath(const char *path) ATTRIBUTE_NONNULL(1);
+
#endif /* __VIR_PIDFILE_H__ */
--
2.1.2
10 years
[libvirt] [PATCH] Reject live update of offloading options
by Ján Tomko
https://bugzilla.redhat.com/show_bug.cgi?id=1155441
---
src/qemu/qemu_hotplug.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 33241fb..d3bf392 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -1981,7 +1981,18 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
olddev->driver.virtio.txmode != newdev->driver.virtio.txmode ||
olddev->driver.virtio.ioeventfd != newdev->driver.virtio.ioeventfd ||
olddev->driver.virtio.event_idx != newdev->driver.virtio.event_idx ||
- olddev->driver.virtio.queues != newdev->driver.virtio.queues)) {
+ olddev->driver.virtio.queues != newdev->driver.virtio.queues ||
+ olddev->driver.virtio.host.csum != newdev->driver.virtio.host.csum ||
+ olddev->driver.virtio.host.gso != newdev->driver.virtio.host.gso ||
+ olddev->driver.virtio.host.tso4 != newdev->driver.virtio.host.tso4 ||
+ olddev->driver.virtio.host.tso6 != newdev->driver.virtio.host.tso6 ||
+ olddev->driver.virtio.host.ecn != newdev->driver.virtio.host.ecn ||
+ olddev->driver.virtio.host.ufo != newdev->driver.virtio.host.ufo ||
+ olddev->driver.virtio.guest.csum != newdev->driver.virtio.guest.csum ||
+ olddev->driver.virtio.guest.tso4 != newdev->driver.virtio.guest.tso4 ||
+ olddev->driver.virtio.guest.tso6 != newdev->driver.virtio.guest.tso6 ||
+ olddev->driver.virtio.guest.ecn != newdev->driver.virtio.guest.ecn ||
+ olddev->driver.virtio.guest.ufo != newdev->driver.virtio.guest.ufo)) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("cannot modify virtio network device driver attributes"));
goto cleanup;
--
2.0.4
10 years
[libvirt] [PATCH 00/19] vbox: Rewrite the storage driver
by Taowei Luo
This is the last part of rewriting vbox driver. The approache is almost
the same as the previous.
Some code problems such as copyright and irregular macros are fixed in
this series.
Taowei Luo (19):
vbox: Fix copyright mistake
vbox: Remove VBOX_OBJECT_CHECK macro
vbox: move common codes to vbox_common.h
vbox: Rewrite vbox-independent functions
vbox: Rewrite vboxStoragePoolNumOfVolumes
vbox: Rewrite vboxStoragePoolListVolumes
vbox: Rewrite vboxStorageVolLookupByName
vbox: Rewrite vboxStorageVolLookupByKey
vbox: Make FindMedium support old vbox versions
vbox: Rewrite vboxStorageVolLookupByPath
vbox: Make CreateHardDisk support all vbox versions
vbox: Rewrite vboxStorageVolCreateXML
vbox: Make IMediumAttachment work with vbox2.2 and 3.0
vbox: Rewrite vboxStorageVolDelete
vbox: Rewrite vboxStorageVolGetInfo
vbox: Rewrite vboxStorageVolGetXMLDesc
vbox: Rewrite vboxStorageVolGetPath
vbox: New storage driver
vbox: Remove unused things in vbox_tmpl.c
po/POTFILES.in | 1 +
src/Makefile.am | 11 +-
src/vbox/vbox_common.c | 416 +++++++++------
src/vbox/vbox_common.h | 117 +++-
src/vbox/vbox_driver.c | 99 +---
src/vbox/vbox_get_driver.h | 3 +-
src/vbox/vbox_network.c | 30 +-
src/vbox/vbox_storage.c | 959 +++++++++++++++++++++++++++++++++
src/vbox/vbox_tmpl.c | 1186 ++++++-----------------------------------
src/vbox/vbox_uniformed_api.h | 30 +-
10 files changed, 1555 insertions(+), 1297 deletions(-)
create mode 100644 src/vbox/vbox_storage.c
--
1.7.9.5
10 years
[libvirt] [PATCH v6 0/6] Add non-FreeBSD guest support to Bhyve driver.
by Conrad Meyer
Drvbhyve hardcodes bhyveload(8) as the host bootloader for guests.
bhyveload(8) loader only supports FreeBSD guests.
This patch series adds <bootloader> and <bootloader_args> handling to
bhyve_command, so libvirt can boot non-FreeBSD guests in Bhyve.
Additionally, support for grub-bhyve(1)'s --cons-dev argument is added so that
interactive GRUB menus can be manipulated with the domain-configured serial
device.
See patch logs for further details.
Thanks,
Conrad
Changes in v6:
- Simplified domain schema changes; just add bootloader section to HVM-type
OS, and make the bootloader tag optional.
- Update drvbhyve.html.in copy to explicitly state that interactive
bootloaders are unsupported.
- Move GRUB device.map file creation out of BuildLoadCmd; instead emit
device.map as a string.
- Add devicemap contents tests to bhyvexml2argv.
Conrad Meyer (6):
bhyve: Support /domain/bootloader configuration for non-FreeBSD
guests.
bhyvexml2argv: Add loader argv tests.
domaincommon.rng: Add 'bootloader' to os=hvm schema for Bhyve
bhyvexml2argv: Add tests for domain-configured bootloader, args
bhyve: Add console support for grub-bhyve bootloader
bhyvexml2argv: Add test for grub console support
docs/drvbhyve.html.in | 100 ++++++++++-
docs/formatdomain.html.in | 4 +-
docs/schemas/domaincommon.rng | 17 +-
src/bhyve/bhyve_command.c | 186 +++++++++++++++++++--
src/bhyve/bhyve_command.h | 5 +-
src/bhyve/bhyve_driver.c | 3 +-
src/bhyve/bhyve_process.c | 38 ++++-
.../bhyvexml2argv-acpiapic.ldargs | 1 +
tests/bhyvexml2argvdata/bhyvexml2argv-base.ldargs | 1 +
.../bhyvexml2argv-bhyveload-explicitargs.args | 3 +
.../bhyvexml2argv-bhyveload-explicitargs.ldargs | 1 +
.../bhyvexml2argv-bhyveload-explicitargs.xml | 23 +++
.../bhyvexml2argvdata/bhyvexml2argv-console.ldargs | 1 +
.../bhyvexml2argv-custom-loader.args | 3 +
.../bhyvexml2argv-custom-loader.ldargs | 1 +
.../bhyvexml2argv-custom-loader.xml | 24 +++
.../bhyvexml2argv-disk-cdrom-grub.args | 3 +
.../bhyvexml2argv-disk-cdrom-grub.devmap | 1 +
.../bhyvexml2argv-disk-cdrom-grub.ldargs | 2 +
.../bhyvexml2argv-disk-cdrom-grub.xml | 23 +++
.../bhyvexml2argv-disk-cdrom.ldargs | 1 +
.../bhyvexml2argv-disk-virtio.ldargs | 1 +
.../bhyvexml2argv-grub-defaults.args | 3 +
.../bhyvexml2argv-grub-defaults.devmap | 1 +
.../bhyvexml2argv-grub-defaults.ldargs | 2 +
.../bhyvexml2argv-grub-defaults.xml | 23 +++
.../bhyvexml2argvdata/bhyvexml2argv-macaddr.ldargs | 1 +
.../bhyvexml2argv-serial-grub.args | 4 +
.../bhyvexml2argv-serial-grub.devmap | 1 +
.../bhyvexml2argv-serial-grub.ldargs | 2 +
.../bhyvexml2argv-serial-grub.xml | 26 +++
.../bhyvexml2argvdata/bhyvexml2argv-serial.ldargs | 1 +
tests/bhyvexml2argvtest.c | 65 ++++++-
33 files changed, 532 insertions(+), 39 deletions(-)
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-acpiapic.ldargs
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-base.ldargs
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-explicitargs.args
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-explicitargs.ldargs
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-explicitargs.xml
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-console.ldargs
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-custom-loader.args
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-custom-loader.ldargs
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-custom-loader.xml
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-disk-cdrom-grub.args
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-disk-cdrom-grub.devmap
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-disk-cdrom-grub.ldargs
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-disk-cdrom-grub.xml
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-disk-cdrom.ldargs
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-disk-virtio.ldargs
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-grub-defaults.args
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-grub-defaults.devmap
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-grub-defaults.ldargs
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-grub-defaults.xml
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-macaddr.ldargs
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-serial-grub.args
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-serial-grub.devmap
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-serial-grub.ldargs
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-serial-grub.xml
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-serial.ldargs
--
1.9.3
10 years
[libvirt] [PATCH] Teach virt-aa-helper to use TEMPLATE.qemu if the domain is kvm or kqemu
by Cédric Bosdonnat
Without this patch, kvm and kqemu domains confined with apparmor can't start
due to virt-aa-helper not finding TEMPLATE.kvm or TEMPLATE.kqemu. This patch
points all kvm-related drivers to TEMPLATE.qemu.
---
src/security/virt-aa-helper.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index 9afc8db..6b95fdb 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -341,15 +341,25 @@ create_profile(const char *profile, const char *profile_name,
int tlen, plen;
int fd;
int rc = -1;
+ const char *driver_name = NULL;
if (virFileExists(profile)) {
vah_error(NULL, 0, _("profile exists"));
goto end;
}
+ switch (virtType) {
+ case VIR_DOMAIN_VIRT_QEMU:
+ case VIR_DOMAIN_VIRT_KQEMU:
+ case VIR_DOMAIN_VIRT_KVM:
+ driver_name = "qemu";
+ break;
+ default:
+ driver_name = virDomainVirtTypeToString(virtType);
+ }
if (virAsprintfQuiet(&template, "%s/TEMPLATE.%s", APPARMOR_DIR "/libvirt",
- virDomainVirtTypeToString(virtType)) < 0) {
+ driver_name) < 0) {
vah_error(NULL, 0, _("template name exceeds maximum length"));
goto end;
}
--
1.8.4.5
10 years
[libvirt] [PATCH] vbox: don't register NULL driver
by Martin Kletzander
We were missing check for the fact that the storage driver was found and
in case there is no vbox storage driver available, daemon raised the
following error each start:
error : virRegisterStorageDriver:592 : driver in
virRegisterStorageDriver must not be NULL
Fixing this makes the condition unified with networkDriver registration
in vbox as well.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
src/vbox/vbox_driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/vbox/vbox_driver.c b/src/vbox/vbox_driver.c
index c64d2d6..b2e35e9 100644
--- a/src/vbox/vbox_driver.c
+++ b/src/vbox/vbox_driver.c
@@ -74,7 +74,7 @@ int vboxStorageRegister(void)
if (VBoxCGlueInit(&uVersion) == 0)
storageDriver = vboxGetStorageDriver(uVersion);
- if (virRegisterStorageDriver(storageDriver) < 0)
+ if (storageDriver && virRegisterStorageDriver(storageDriver) < 0)
return -1;
return 0;
}
--
2.1.2
10 years