[libvirt] [PATCH] virnetlink: fix build on non-Linux
by Eric Blake
Commit 4dc04d3a added virNetlinkGetErrorCode, but forgot to provide
a fallback, which kills the build on mingw (among others):
CCLD libvirt.la
Cannot export virNetlinkGetErrorCode: symbol not defined
collect2: error: ld returned 1 exit status
* src/util/virnetlink.c (virNetlinkGetErrorCode): Provide fallback.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
Pushing under the build-breaker rule.
src/util/virnetlink.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/src/util/virnetlink.c b/src/util/virnetlink.c
index 1a2b7a1..d52f66a 100644
--- a/src/util/virnetlink.c
+++ b/src/util/virnetlink.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010-2014 Red Hat, Inc.
+ * Copyright (C) 2010-2015 Red Hat, Inc.
* Copyright (C) 2010-2012 IBM Corporation
*
* This library is free software; you can redistribute it and/or
@@ -276,7 +276,9 @@ int virNetlinkCommand(struct nl_msg *nl_msg,
return ret;
}
-int virNetlinkGetErrorCode(struct nlmsghdr *resp, unsigned int recvbuflen)
+
+int
+virNetlinkGetErrorCode(struct nlmsghdr *resp, unsigned int recvbuflen)
{
struct nlmsgerr *err;
int result = 0;
@@ -314,6 +316,7 @@ int virNetlinkGetErrorCode(struct nlmsghdr *resp, unsigned int recvbuflen)
return -EINVAL;
}
+
static void
virNetlinkEventServerLock(virNetlinkEventSrvPrivatePtr driver)
{
@@ -872,4 +875,13 @@ int virNetlinkEventRemoveClient(int watch ATTRIBUTE_UNUSED,
return -1;
}
+
+int
+virNetlinkGetErrorCode(struct nlmsghdr *resp ATTRIBUTE_UNUSED,
+ unsigned int recvbuflen ATTRIBUTE_UNUSED)
+{
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _(unsupported));
+ return -EINVAL;
+}
+
#endif /* __linux__ */
--
2.1.0
9 years, 11 months
[libvirt] [PATCH RFC] LXC: don't RO mount /proc, /sys when user namespce enabled
by Chen Hanxiao
If we enabled user ns and provided a uid/gid map,
we do not need to mount /proc, /sys as readonly.
Leave it to kernel for protection.
Signed-off-by: Chen Hanxiao <chenhanxiao(a)cn.fujitsu.com>
---
src/lxc/lxc_container.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index 1b9e2f2..3b5845a 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -983,6 +983,12 @@ static int lxcContainerMountBasicFS(bool userns_enabled,
goto cleanup;
}
+ /* don't readonly mount when userns is enabled */
+ if (userns_enabled) {
+ VIR_FREE(mnt_src);
+ continue;
+ }
+
if (bindOverReadonly &&
mount(mnt_src, mnt->dst, NULL,
MS_BIND|MS_REMOUNT|MS_RDONLY, NULL) < 0) {
--
1.9.3
9 years, 11 months
[libvirt] [PATCH] networkGetDHCPLeases: Remove unnecessary error reporting
by Nehal J Wani
Lack of a lease (whether mac is given or not) is a normal expected scenario.
There is no need to raise an error.
Signed-off-by: Nehal J Wani <nehaljw.kkd1(a)gmail.com>
---
src/network/bridge_driver.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 29222d0..6a49a23 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -3654,12 +3654,6 @@ networkGetDHCPLeases(virNetworkPtr network,
VIR_FREE(lease);
}
- if (need_results && mac && !leases_ret) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("no lease with matching MAC address: %s"), mac);
- goto error;
- }
-
if (leases_ret) {
/* NULL terminated array */
ignore_value(VIR_REALLOC_N(leases_ret, nleases + 1));
--
2.1.0
9 years, 11 months
[libvirt] [PATCH] qemu: use a wrong name for guest panic status
by Luyao Huang
https://bugzilla.redhat.com/show_bug.cgi?id=1178652
We will get a warning when we have a guest in paused
status(casue by kernel panic) and restart libvirtd,
warning message like this:
Qemu reported unknown VM status: 'guest-panicked'
and this seems because we set a wrong status name in
qemu_monitor.c, and from qemu qapi-schema.json file
we know this status should named 'guest-panicked'.
Signed-off-by: Luyao Huang <lhuang(a)redhat.com>
---
src/qemu/qemu_monitor.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 100bbd0..57a13ab 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -127,7 +127,7 @@ VIR_ENUM_IMPL(qemuMonitorVMStatus,
QEMU_MONITOR_VM_STATUS_LAST,
"debug", "inmigrate", "internal-error", "io-error", "paused",
"postmigrate", "prelaunch", "finish-migrate", "restore-vm",
- "running", "save-vm", "shutdown", "watchdog", "guest-panic")
+ "running", "save-vm", "shutdown", "watchdog", "guest-panicked")
typedef enum {
QEMU_MONITOR_BLOCK_IO_STATUS_OK,
--
1.8.3.1
9 years, 11 months
[libvirt] [PATCH] Makefile: Fix parallel build after Xen-xl parser introduction
by Michal Privoznik
Well, the parallel build doesn't work as there are not dependencies
set correctly. When running 'make -j' I see this error:
make[2]: Entering directory '/home/zippy/work/libvirt/libvirt.git/src'
GEN util/virkeymaps.h
GEN locking/lock_protocol.h
make[2]: *** No rule to make target 'xenconfig/xen_xl_disk.h', needed by 'all'. Stop.
make[2]: *** Waiting for unfinished jobs....
GEN lxc/lxc_controller_dispatch.h
The fix is to correctly set dependencies by letting make know that .c
and .h are to be generated from .l. Moreover, the section is moved
closer to the other section which uses it.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
I'm not fully satisfied with this patch yet. I mean, for some
reason it creates 'src/.h' file, but hey - it makes parallel
build work again. Any brighter idea appreciated.
src/Makefile.am | 36 +++++++++++++++++++-----------------
1 file changed, 19 insertions(+), 17 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index c6d736e..7619cf0 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1000,23 +1000,6 @@ CPU_SOURCES = \
VMX_SOURCES = \
vmx/vmx.c vmx/vmx.h
-AM_LFLAGS = -Pxl_disk_ --header-file=../$*.h
-LEX_OUTPUT_ROOT = lex.xl_disk_
-BUILT_SOURCES += xenconfig/xen_xl_disk.c xenconfig/xen_xl_disk.h
-# Generated header file is not implicitly added to dist
-EXTRA_DIST += xenconfig/xen_xl_disk.h
-CLEANFILES += xenconfig/xen_xl_disk.h xenconfig/xen_xl_disk.c
-
-XENXLDISKPARSER_SOURCES = xenconfig/xen_xl_disk.l
-
-XENCONFIG_SOURCES = \
- xenconfig/xenxs_private.h \
- xenconfig/xen_common.c xenconfig/xen_common.h \
- xenconfig/xen_sxpr.c xenconfig/xen_sxpr.h \
- xenconfig/xen_xm.c xenconfig/xen_xm.h \
- xenconfig/xen_xl.c xenconfig/xen_xl.h \
- xenconfig/xen_xl_disk.h
-
pkgdata_DATA = cpu/cpu_map.xml
EXTRA_DIST += $(pkgdata_DATA)
@@ -1078,6 +1061,25 @@ libvirt_xenxldiskparser_la_CFLAGS = \
libvirt_xenxldiskparser_la_SOURCES = \
$(XENXLDISKPARSER_SOURCES)
+AM_LFLAGS = -Pxl_disk_ --header-file=../$*.h
+XENXLDISKPARSER_GENERATED = xenconfig/xen_xl_disk.c xenconfig/xen_xl_disk.h
+BUILT_SOURCES += $(XENXLDISKPARSER_GENERATED)
+EXTRA_DIST += $(XENXLDISKPARSER_GENERATED)
+MAINTAINERCLEANFILES += $(XENXLDISKPARSER_GENERATED)
+
+XENXLDISKPARSER_SOURCES = xenconfig/xen_xl_disk.l
+
+$(XENXLDISKPARSER_GENERATED): $(XENXLDISKPARSER_SOURCES)
+ $(SHELL) $(YLWRAP) $< lex.xl_disk_.c $@ -- $(LEXCOMPILE)
+
+XENCONFIG_SOURCES = \
+ xenconfig/xenxs_private.h \
+ xenconfig/xen_common.c xenconfig/xen_common.h \
+ xenconfig/xen_sxpr.c xenconfig/xen_sxpr.h \
+ xenconfig/xen_xm.c xenconfig/xen_xm.h \
+ xenconfig/xen_xl.c xenconfig/xen_xl.h \
+ xenconfig/xen_xl_disk_i.h
+
noinst_LTLIBRARIES += libvirt_xenconfig.la
libvirt_la_BUILT_LIBADD += libvirt_xenconfig.la
libvirt_xenconfig_la_CFLAGS = \
--
2.0.5
9 years, 11 months
[libvirt] [PATCH] maint: update to latest gnulib
by Eric Blake
Another update is required to pick up today's gnulib fix for mingw
builds (now that gnulib turns on mingw's replacement printf that
understands %lld, it must also tell the compiler to respect the
improved definition of PRIdMAX and friends).
* .gnulib: Update to latest.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
Pushing under the build-breaker rule.
* .gnulib 498a1b6...c27f1a3 (3):
> doc: update INSTALL from autoconf
> stdio: fix use of PRIdMAX on modern mingw
> Fix check for pthreads.h pollution on Mingw64
.gnulib | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.gnulib b/.gnulib
index 498a1b6..c27f1a3 160000
--- a/.gnulib
+++ b/.gnulib
@@ -1 +1 @@
-Subproject commit 498a1b6bc7d70f944ca0f939e1bc470889fdce76
+Subproject commit c27f1a356f2f321daa7f971ef276a1dbfa873bf8
--
2.1.0
9 years, 11 months
[libvirt] [PATCH 0/2] Misc fixes
by Cédric Bosdonnat
Hi there,
Here are 2 patches fixing tiny annoying problems. One of them, makes
apparmor profiles handle /usr/lib64 folder and the other one fixes an
uncleaned piece of domain config.
Cédric Bosdonnat (2):
Teach AppArmor, that /usr/lib64 may exist.
Fix error when starting a container after an error
examples/apparmor/libvirt-qemu | 2 +-
examples/apparmor/usr.lib.libvirt.virt-aa-helper | 4 ++--
examples/apparmor/usr.sbin.libvirtd | 4 ++--
src/lxc/lxc_process.c | 1 +
4 files changed, 6 insertions(+), 5 deletions(-)
--
2.1.2
9 years, 11 months
[libvirt] Query: Implementation of virNetworkGetDHCPLeases
by Nehal J Wani
In the method networkGetDHCPLeases inside
./src/network/bridge_driver.c , we have:
if (need_results && mac && !leases_ret) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("no lease with matching MAC address: %s"), mac);
goto error;
}
Is this really required? In my opinion, since we are already filling
rv with nleases (which will be 0, in case no lease corresponding to
given mac is found), user will know that there is no result for his
query. Why to report error?
This results in:
virsh # net-dhcp-leases --mac 00:50:56:c0:00:01 default
error: Failed to get leases info for default
error: internal error: no lease with matching MAC address: 00:50:56:c0:00:01
--
Nehal J Wani
9 years, 11 months
[libvirt] [PATCH] maint: fix date in local gnulib patch
by Daniel P. Berrange
The local gnulib ssize_t.m4.diff patch no longer applied due to
changed context from the date change.
---
gnulib/local/m4/ssize_t.m4.diff | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Pushed as another build breaker fix
diff --git a/gnulib/local/m4/ssize_t.m4.diff b/gnulib/local/m4/ssize_t.m4.diff
index 08c2b9c..12cff12 100644
--- a/gnulib/local/m4/ssize_t.m4.diff
+++ b/gnulib/local/m4/ssize_t.m4.diff
@@ -5,7 +5,7 @@ index 209d64c..5ea72a1 100644
@@ -1,4 +1,4 @@
-# ssize_t.m4 serial 5 (gettext-0.18.2)
+# ssize_t.m4 serial 6 (gettext-0.18.2)
- dnl Copyright (C) 2001-2003, 2006, 2010-2014 Free Software Foundation, Inc.
+ dnl Copyright (C) 2001-2003, 2006, 2010-2015 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -17,7 +17,21 @@ AC_DEFUN([gt_TYPE_SSIZE_T],
--
2.1.0
9 years, 11 months
[libvirt] [PATCH] maint: update to latest gnulib
by Daniel P. Berrange
Sync to latest gnulib to get files updated with 2015 copyright
date to fix syntax-check
* .gnulib: update to latest
* bootstrap: Regenerate from upstream
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
.gnulib | 2 +-
bootstrap | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
Pushed as build-breaker fix for 'make syntax-check' year check
diff --git a/.gnulib b/.gnulib
index 3914f31..498a1b6 160000
--- a/.gnulib
+++ b/.gnulib
@@ -1 +1 @@
-Subproject commit 3914f3153576e9a5ba4002bde27de05211b5a79c
+Subproject commit 498a1b6bc7d70f944ca0f939e1bc470889fdce76
diff --git a/bootstrap b/bootstrap
index e0c4ec2..2fdf267 100755
--- a/bootstrap
+++ b/bootstrap
@@ -4,7 +4,7 @@ scriptversion=2014-12-08.12; # UTC
# Bootstrap this package from checked-out sources.
-# Copyright (C) 2003-2014 Free Software Foundation, Inc.
+# Copyright (C) 2003-2015 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
--
2.1.0
9 years, 11 months