[libvirt] [PATCH] apparmor: Adjust path to domain monitor socket
by Guido Günther
f1f68ca33 moved the monitor socket to a per domain directory. Adjust the
path accordingly.
---
It'd be nice to have this in 1.2.19 since it unbreaks starting qemu based domains.
src/security/virt-aa-helper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index b4a8f27..5de56e5 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -1361,7 +1361,7 @@ main(int argc, char **argv)
ctl->def->virtType == VIR_DOMAIN_VIRT_KVM) {
virBufferAsprintf(&buf, " \"%s/log/libvirt/**/%s.log\" w,\n",
LOCALSTATEDIR, ctl->def->name);
- virBufferAsprintf(&buf, " \"%s/lib/libvirt/**/%s.monitor\" rw,\n",
+ virBufferAsprintf(&buf, " \"%s/lib/libvirt/qemu/domain-%s/monitor.sock\" rw,\n",
LOCALSTATEDIR, ctl->def->name);
virBufferAsprintf(&buf, " \"%s/run/libvirt/**/%s.pid\" rwk,\n",
LOCALSTATEDIR, ctl->def->name);
--
2.1.4
9 years, 2 months
[libvirt] libvirt 1.2.19-rc1 can't configure
by Vasiliy Tolstov
I'm try to configure libvirt 1.2.19-rc1 but get strange error.
configure ended with:
checking whether <pthread.h> pollutes the namespace... no
checking for pthread_t... yes
checking for pthread_spinlock_t... yes
checking for library containing pthread_create and pthread_join... -pthread
checking for pthread_sigmask in -pthread... yes
checking whether pthread_sigmask is only a macro... no
complete log:
https://gist.github.com/raw/f8dc44de0ed7b0675755
--
Vasiliy Tolstov,
e-mail: v.tolstov(a)selfip.ru
9 years, 2 months
[libvirt] [PATCH] Revert "LXC: show used memory as 0 when domain is not active"
by Jim Fehlig
This reverts commit 1ce7c1d20cfd5afb26d2dbc88201085d52415d0e,
which introduced a significant semantic change to the
virDomainGetInfo() API. Additionally, the change was only
made to 2 of the 15 virt drivers.
Conflicts:
src/qemu/qemu_driver.c
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
src/lxc/lxc_driver.c | 2 +-
src/qemu/qemu_driver.c | 12 ++++++------
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index d8d5119..5b0a757 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -597,7 +597,7 @@ static int lxcDomainGetInfo(virDomainPtr dom,
if (!virDomainObjIsActive(vm)) {
info->cpuTime = 0;
- info->memory = 0;
+ info->memory = vm->def->mem.cur_balloon;
} else {
if (virCgroupGetCpuacctUsage(priv->cgroup, &(info->cpuTime)) < 0) {
virReportError(VIR_ERR_OPERATION_FAILED,
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 6998e12..48cc534 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -2641,13 +2641,13 @@ qemuDomainGetInfo(virDomainPtr dom,
goto cleanup;
}
- if (virDomainObjIsActive(vm)) {
- if (VIR_ASSIGN_IS_OVERFLOW(info->memory, vm->def->mem.cur_balloon)) {
- virReportError(VIR_ERR_OVERFLOW, "%s",
- _("Current memory size too large"));
- goto cleanup;
- }
+ if (VIR_ASSIGN_IS_OVERFLOW(info->memory, vm->def->mem.cur_balloon)) {
+ virReportError(VIR_ERR_OVERFLOW, "%s",
+ _("Current memory size too large"));
+ goto cleanup;
+ }
+ if (virDomainObjIsActive(vm)) {
if (qemuGetProcessInfo(&(info->cpuTime), NULL, NULL, vm->pid, 0) < 0) {
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("cannot read cputime for domain"));
--
2.1.4
9 years, 2 months
[libvirt] [PATCH] network type ethernet not needs to be reconnected
by Vasiliy Tolstov
libvirt docs says that network type ethernet not fully
managed by libvirt, so don't check for ip.
This fixes issue when no ip assigned to interface in libvirt domain xml
and somebody want to change link state of interface.
Signed-off-by: Vasiliy Tolstov <v.tolstov(a)selfip.ru>
---
src/qemu/qemu_hotplug.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index aabdb78..db4fdda 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -2394,10 +2394,7 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
case VIR_DOMAIN_NET_TYPE_ETHERNET:
if (STRNEQ_NULLABLE(olddev->data.ethernet.dev,
- newdev->data.ethernet.dev) ||
- olddev->nips == 0 || newdev->nips == 0 ||
- !virSocketAddrEqual(&olddev->ips[0]->address,
- &newdev->ips[0]->address)) {
+ newdev->data.ethernet.dev)) {
needReconnect = true;
}
break;
--
2.5.0
9 years, 2 months
[libvirt] Should external snapshots be possible with type volume image files?
by Stefan Bader
At least up to libvirt version 1.2.16 an external snapshot fails when the image
file (supported type like QCOW2) is not specified as type='file' by as
type='volume' to a pool that consists of image files (type directory).
The reason there is that the source element of the disk definition does not
contain the full path but only references to pool and volume name. Which would
require an additional indirection in order to find that it actually is a file
and what the path is. And that would make things more complicated.
So my question is whether this should work and needs fixing in code or was never
meant to be used that way. If the latter, then maybe needs a clarification in
the documentation. At least the wiki did read for me as only requiring to be a
image file of a supported type. And we got at least one bug report about it.
Thanks,
Stefan
9 years, 2 months
[libvirt] [PATCH V2 0/3] libxl: a few small migration fixes
by Jim Fehlig
This series fixes a few issues found while testing migration with
latest Xen and libvirt. See the individual patches for details.
V2: rebased to latest git master and address Olaf's comment
from V1.
Jim Fehlig (3):
libxl: fix ref counting of libxlMigrationDstArgs
libxl: don't attempt to resume domain when suspend fails
libxl: acquire a job when receiving a migrating domain
src/libxl/libxl_migration.c | 54 +++++++++++++++++++--------------------------
1 file changed, 23 insertions(+), 31 deletions(-)
--
2.3.7
9 years, 2 months
[libvirt] [PATCH 0/9] qemu: assign addresses to USB devices
by Ján Tomko
For https://bugzilla.redhat.com/show_bug.cgi?id=1215968
For domains started without the addresses specified on the command line,
QEMU makes up the addresses and adds USB hubs if the device is added
to the second-to-last USB port.
A domain started with these exact ports and hubs specified on the command line
is not compatible with this domain.
This series only generates the addresses for new domains, to avoid breaking
migrating already existing domains.
Ján Tomko (9):
Remove dead code from qemuDomainAttachControllerDevice
Remove unused virDomainVirtioSerialAddrSetRemoveController
Store USB port path as an array of integers
Add newDomain parameter to qemuDomainAssignAddresses
Introduce virDomainUSBAddressSet
Add functions for adding usb controllers to addrs
Reserve existing USB addresses
Assign addresses to USB devices
Assign addresses on USB device hotplug
src/conf/domain_addr.c | 406 +++++++++++++++++++--
src/conf/domain_addr.h | 53 ++-
src/conf/domain_conf.c | 29 +-
src/conf/domain_conf.h | 4 +-
src/libvirt_private.syms | 10 +-
src/qemu/qemu_command.c | 235 +++++++++++-
src/qemu/qemu_command.h | 3 +-
src/qemu/qemu_domain.h | 1 +
src/qemu/qemu_driver.c | 22 +-
src/qemu/qemu_hotplug.c | 57 ++-
src/qemu/qemu_process.c | 6 +-
tests/qemuhotplugtest.c | 2 +-
...qemuhotplug-console-compat-2+console-virtio.xml | 4 +-
.../qemuhotplug-hotplug-base+disk-usb.xml | 1 +
.../qemuxml2argvdata/qemuxml2argv-bios-nvram.args | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-bios.args | 2 +-
.../qemuxml2argv-console-compat-2.xml | 4 +-
.../qemuxml2argv-controller-order.args | 7 +-
.../qemuxml2argv-controller-order.xml | 2 +
.../qemuxml2argv-disk-usb-device-removable.args | 3 +-
.../qemuxml2argv-disk-usb-device.args | 3 +-
.../qemuxml2argv-graphics-spice-timeout.args | 2 +-
...muxml2argv-hostdev-usb-address-device-boot.args | 2 +-
.../qemuxml2argv-hostdev-usb-address-device.args | 3 +-
.../qemuxml2argv-hugepages-numa.args | 2 +-
.../qemuxml2argv-input-usbmouse-addr.args | 2 +-
.../qemuxml2argv-input-usbmouse-addr.xml | 2 +-
.../qemuxml2argv-pseries-usb-kbd.args | 2 +-
.../qemuxml2argv-serial-spiceport.args | 2 +-
.../qemuxml2argv-smartcard-controller.args | 2 +-
.../qemuxml2argv-smartcard-host-certificates.args | 2 +-
.../qemuxml2argv-smartcard-host.args | 2 +-
...emuxml2argv-smartcard-passthrough-spicevmc.args | 3 +-
.../qemuxml2argv-smartcard-passthrough-tcp.args | 2 +-
.../qemuxml2argv-sound-device.args | 2 +-
.../qemuxml2argv-usb-hub-conflict.xml | 22 ++
.../qemuxml2argv-usb-port-autoassign.args | 15 +
.../qemuxml2argv-usb-port-autoassign.xml | 27 ++
tests/qemuxml2argvtest.c | 11 +-
tests/qemuxmlnstest.c | 2 +-
40 files changed, 854 insertions(+), 109 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-usb-hub-conflict.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-usb-port-autoassign.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-usb-port-autoassign.xml
--
2.4.6
9 years, 2 months
[libvirt] [PATCH] lxc: ensure setns() syscall is defined
by Daniel P. Berrange
Older versions of glibc don't provide the setns() syscall
function wrapper, so we must define it ourselves to prevent
build failure on old distros.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
Pushed as a RHEL-6 build-break fix
---
src/lxc/lxc_container.c | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index 8011ed0..feb8fad 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -95,6 +95,40 @@ VIR_LOG_INIT("lxc.lxc_container");
# define CLONE_NEWNET 0x40000000 /* New network namespace */
#endif
+/*
+ * Workaround older glibc. While kernel may support the setns
+ * syscall, the glibc wrapper might not exist. If that's the
+ * case, use our own.
+ */
+#ifndef __NR_setns
+# if defined(__x86_64__)
+# define __NR_setns 308
+# elif defined(__i386__)
+# define __NR_setns 346
+# elif defined(__arm__)
+# define __NR_setns 375
+# elif defined(__aarch64__)
+# define __NR_setns 375
+# elif defined(__powerpc__)
+# define __NR_setns 350
+# elif defined(__s390__)
+# define __NR_setns 339
+# endif
+#endif
+
+#ifndef HAVE_SETNS
+# if defined(__NR_setns)
+# include <sys/syscall.h>
+
+static inline int setns(int fd, int nstype)
+{
+ return syscall(__NR_setns, fd, nstype);
+}
+# else /* !__NR_setns */
+# error Please determine the syscall number for setns on your architecture
+# endif
+#endif
+
/* messages between parent and container */
typedef char lxc_message_t;
#define LXC_CONTINUE_MSG 'c'
--
2.4.3
9 years, 2 months
[libvirt] [PATCH 0/4] Couple of LXC fixes
by Michal Privoznik
After Dan's eff95ac8fce in which he's fixing the build on RHEL-6,
I've realized we can do better. We don't need to copy our code
around.
Michal Privoznik (4):
util: Allow virProcessSetNamespaces() to have sparse FD list
libvirt_lxc: Claim success for --help
lxc_container: Turn lxcAttachNS into calling virProcessSetNamespaces
Revert "lxc: ensure setns() syscall is defined"
src/lxc/lxc_container.c | 56 +++---------------------------------------------
src/lxc/lxc_controller.c | 1 +
src/util/virprocess.c | 3 +++
3 files changed, 7 insertions(+), 53 deletions(-)
--
2.4.6
9 years, 2 months