[libvirt] [PATCH] python: add virConnectGetCPUModelNames to skip_impl
by Doug Goldstein
In commit de51dc9c9, we removed virConnectGetCPUModelNames from
skip_impl but without this the module will always generate a symbol for
libvirt_virConnectGetCPUModelNames which we don't always want.
CC: Giuseppe Scrivano <gscrivan(a)redhat.com>
---
I don't really understand the generator enough to know why this was
removed but without this change the module will always generate the
symbol. Maybe someone more knowledgable with the code can explain?
I've CC'd the original author as well.
---
python/generator.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/python/generator.py b/python/generator.py
index 87ecf5a..99bf965 100755
--- a/python/generator.py
+++ b/python/generator.py
@@ -450,6 +450,7 @@ skip_impl = (
'virNodeGetCPUMap',
'virDomainMigrate3',
'virDomainMigrateToURI3',
+ 'virConnectGetCPUModelNames',
)
lxc_skip_impl = (
--
1.8.3.2
11 years, 1 month
[libvirt] [PATCH] libvirt-guests: Run only after libvirtd (bug 906009)
by Cole Robinson
Possible fix for occasional libvirt-guests failure at boot time.
---
tools/libvirt-guests.service.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/libvirt-guests.service.in b/tools/libvirt-guests.service.in
index d41bf2b..8153418 100644
--- a/tools/libvirt-guests.service.in
+++ b/tools/libvirt-guests.service.in
@@ -1,6 +1,6 @@
[Unit]
Description=Suspend Active Libvirt Guests
-After=syslog.target network.target
+After=syslog.target network.target libvirtd.service
[Service]
EnvironmentFile=-/etc/sysconfig/libvirt-guests
--
1.8.4.2
11 years, 1 month
[libvirt] [PATCH] spec: fix libvirt-docs subpackage on RHEL
by Michael Chapman
RHEL's rpmbuild wipes the docdir for a (sub-)package if any %doc
directives are present, prior to copying in the marked documentation.
This means we can't prepopulate this directory with the HTML
documentation during the %install phase.
Instead, move the HTML documentation to a temporary directory during
%install and mark the contents of this temporary directory with %doc.
Signed-off-by: Michael Chapman <mike(a)very.puzzling.org>
---
libvirt.spec.in | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 72815f4..a5b01df 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -1491,8 +1491,8 @@ rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.lxc
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.uml
%endif
-mv $RPM_BUILD_ROOT%{_datadir}/doc/libvirt-%{version} \
- $RPM_BUILD_ROOT%{_datadir}/doc/libvirt-docs-%{version}
+# Copied into libvirt-docs subpackage eventually
+mv $RPM_BUILD_ROOT%{_datadir}/doc/libvirt-%{version} libvirt-docs
%if %{with_dtrace}
%ifarch %{power64} s390x x86_64 ia64 alpha sparc64
@@ -1732,12 +1732,7 @@ fi
%files docs
%defattr(-, root, root)
-%doc AUTHORS ChangeLog.gz NEWS README TODO
-
-# Website
-%dir %{_datadir}/doc/libvirt-docs-%{version}
-%dir %{_datadir}/doc/libvirt-docs-%{version}/html
-%{_datadir}/doc/libvirt-docs-%{version}/html/*
+%doc AUTHORS ChangeLog.gz NEWS README TODO libvirt-docs/*
# API docs
%dir %{_datadir}/gtk-doc/html/libvirt/
--
1.8.4.2
11 years, 1 month
[libvirt] [PATCH 0/2] Test JSON parsing with invalid input
by Ján Tomko
Ján Tomko (2):
Test if JSON parser fails on invalid input
Error out on unterminated arrays and objects in JSON parser
src/util/virjson.c | 9 ++++++++-
tests/jsontest.c | 18 ++++++++++++++++++
2 files changed, 26 insertions(+), 1 deletion(-)
--
1.8.1.5
11 years, 1 month
[libvirt] [PATCH] Remove redundant braces
by Ján Tomko
---
Pushed as trivial.
src/util/virjson.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/util/virjson.c b/src/util/virjson.c
index f0a06ab..7044e11 100644
--- a/src/util/virjson.c
+++ b/src/util/virjson.c
@@ -1018,9 +1018,8 @@ cleanup:
if (parser.nstate) {
size_t i;
- for (i = 0; i < parser.nstate; i++) {
+ for (i = 0; i < parser.nstate; i++)
VIR_FREE(parser.state[i].key);
- }
VIR_FREE(parser.state);
}
--
1.8.3.2
11 years, 1 month
[libvirt] [PATCH] vbox: fix segfault on virsh dumpxml with the existence of USB filters
by Ryota Ozaki
A USB filter is stored in a hostdev. The original code doesn't
allocate hostdev->info that is expected to be allocated with hostdev.
So use virDomainHostdevDefAlloc() to allocate both as we expect.
Signed-off-by: Ryota Ozaki <ozaki.ryota(a)gmail.com>
---
src/vbox/vbox_tmpl.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c
index 3807a6d..f4cd5cf 100644
--- a/src/vbox/vbox_tmpl.c
+++ b/src/vbox/vbox_tmpl.c
@@ -3333,7 +3333,8 @@ sharedFoldersCleanup:
deviceFilter->vtbl->GetActive(deviceFilter, &active);
if (active) {
- if (VIR_ALLOC(def->hostdevs[USBFilterCount]) >= 0) {
+ def->hostdevs[USBFilterCount] = virDomainHostdevDefAlloc();
+ if (def->hostdevs[USBFilterCount]) {
PRUnichar *vendorIdUtf16 = NULL;
char *vendorIdUtf8 = NULL;
unsigned vendorId = 0;
--
1.8.4
11 years, 1 month
[libvirt] libivrt issue report , 1.1.0 version, while migrate VMs between two hosts, is it solved or other way to avoid it, thanks
by Guozhonghua
Libivrt 1.1.0
Migrate VM between two hosts using shell scripts.
The issues is occurred about every 5 minutes, using gdb and the back trace is below:
(gdb) c
Continuing.
[New Thread 0x7f78e7c11700 (LWP 48116)]
[New Thread 0x7f78cf7fe700 (LWP 48129)]
[New Thread 0x7f78ceffd700 (LWP 48306)]
[New Thread 0x7f78ce7fc700 (LWP 62351)]
[New Thread 0x7f78cdffb700 (LWP 62694)]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f78ed24a700 (LWP 46120)]
0x00007f78ef553579 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) bt
#0 0x00007f78ef553579 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x00007f78ef555a45 in malloc () from /lib/x86_64-linux-gnu/libc.so.6
#2 0x00007f78ef545ae3 in vasprintf () from /lib/x86_64-linux-gnu/libc.so.6
#3 0x00007f78f07a3e54 in virVasprintf (strp=0x7f78ed249b38,
fmt=0x7f78f0959c48 "server=%p client=%p message=%p prog=%p",
list=0x7f78ed249c00) at util/virstring.c:334
#4 0x00007f78f077d998 in virLogVMessage (source=VIR_LOG_FROM_FILE,
priority=VIR_LOG_DEBUG, filename=0x7f78f0959bed "rpc/virnetserver.c",
linenr=182, funcname=0x7f78f095a500 "virNetServerHandleJob", metadata=0x0,
fmt=0x7f78f0959c48 "server=%p client=%p message=%p prog=%p",
vargs=0x7f78ed249c00) at util/virlog.c:836
#5 0x00007f78f077d85d in virLogMessage (source=VIR_LOG_FROM_FILE,
priority=VIR_LOG_DEBUG, filename=0x7f78f0959bed "rpc/virnetserver.c",
linenr=182, funcname=0x7f78f095a500 "virNetServerHandleJob", metadata=0x0,
fmt=0x7f78f0959c48 "server=%p client=%p message=%p prog=%p")
at util/virlog.c:773
#6 0x00007f78f08acd86 in virNetServerHandleJob (jobOpaque=0x7f78f305f6a0,
opaque=0x7f78f304a360) at rpc/virnetserver.c:181
#7 0x00007f78f07a8a5e in virThreadPoolWorker (opaque=0x7f78f304a0a0)
at util/virthreadpool.c:144
#8 0x00007f78f07a842a in virThreadHelper (data=0x7f78f3049ec0)
at util/virthreadpthread.c:205
#9 0x00007f78ef897e9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#10 0x00007f78ef5c54bd in clone () from /lib/x86_64-linux-gnu/libc.so.6
#11 0x0000000000000000 in ?? ()
(gdb) frame 6
#6 0x00007f78f08acd86 in virNetServerHandleJob (jobOpaque=0x7f78f305f6a0,
opaque=0x7f78f304a360) at rpc/virnetserver.c:181
181 rpc/virnetserver.c: No such file or directory.
(gdb) p job
$1 = (virNetServerJobPtr) 0x7f78f305f6a0
(gdb) p srv
$2 = (virNetServerPtr) 0x7f78f304a360
(gdb) p job->client
$3 = (virNetServerClientPtr) 0x7f78f3054a60
(gdb) p job->msg
$4 = (virNetMessagePtr) 0x7f78f3051480
(gdb) p job->prog
$5 = (virNetServerProgramPtr) 0x7f78f3054c60
(gdb)
$6 = (virNetServerProgramPtr) 0x7f78f3054c60
(gdb) frame 5
#5 0x00007f78f077d85d in virLogMessage (source=VIR_LOG_FROM_FILE,
priority=VIR_LOG_DEBUG, filename=0x7f78f0959bed "rpc/virnetserver.c",
linenr=182, funcname=0x7f78f095a500 "virNetServerHandleJob", metadata=0x0,
fmt=0x7f78f0959c48 "server=%p client=%p message=%p prog=%p")
at util/virlog.c:773
773 util/virlog.c: No such file or directory.
(gdb) frame 3
#3 0x00007f78f07a3e54 in virVasprintf (strp=0x7f78ed249b38,
fmt=0x7f78f0959c48 "server=%p client=%p message=%p prog=%p",
list=0x7f78ed249c00) at util/virstring.c:334
334 util/virstring.c: No such file or directory.
(gdb) p strp
$7 = (char **) 0x7f78ed249b38
(gdb) p *strp
$8 = 0x0
(gdb) p list
$9 = (struct __va_list_tag *) 0x7f78ed249c00
(gdb) p *list
$10 = {gp_offset = 48, fp_offset = 48, overflow_arg_area = 0x7f78ed249ce8,
reg_save_area = 0x7f78ed249c20}
-------------------------------------------------------------------------------------------------------------------------------------
????????????????????????????????????????
????????????????????????????????????????
????????????????????????????????????????
???
This e-mail and its attachments contain confidential information from H3C, which is
intended only for the person or entity whose address is listed above. Any use of the
information contained herein in any way (including, but not limited to, total or partial
disclosure, reproduction, or dissemination) by persons other than the intended
recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender
by phone or email immediately and delete it!
11 years, 1 month
[libvirt] [PATCH 1/2] LXC: fix the problem that libvirt lxc fail to start on latest kernel
by Gao feng
After kernel commit 5ff9d8a65ce80efb509ce4e8051394e9ed2cd942
vfs: Lock in place mounts from more privileged users,
unprivileged user has no rights to move the mounts that
inherited from parent mountns. we use this feature to move
the /stateDir/domain-name.{dev, devpts} to the /dev/ and
/dev/pts directroy of container. this commit breaks libvirt lxc.
this patch do the moving on host side, we are privileged user
at this moment.
Signed-off-by: Gao feng <gaofeng(a)cn.fujitsu.com>
---
src/lxc/lxc_container.c | 81 +-----------------------------------------------
src/lxc/lxc_controller.c | 53 +++++++++++++++++++++++++++++++
2 files changed, 54 insertions(+), 80 deletions(-)
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index 2bdf957..61283e4 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -953,76 +953,6 @@ static int lxcContainerMountProcFuse(virDomainDefPtr def ATTRIBUTE_UNUSED,
}
#endif
-static int lxcContainerMountFSDev(virDomainDefPtr def,
- const char *stateDir)
-{
- int ret = -1;
- char *path = NULL;
-
- VIR_DEBUG("Mount /dev/ stateDir=%s", stateDir);
-
- if ((ret = virAsprintf(&path, "/.oldroot/%s/%s.dev",
- stateDir, def->name)) < 0)
- return ret;
-
- if (virFileMakePath("/dev") < 0) {
- virReportSystemError(errno, "%s",
- _("Cannot create /dev"));
- goto cleanup;
- }
-
- VIR_DEBUG("Trying to move %s to /dev", path);
-
- if (mount(path, "/dev", NULL, MS_MOVE, NULL) < 0) {
- virReportSystemError(errno,
- _("Failed to mount %s on /dev"),
- path);
- goto cleanup;
- }
-
- ret = 0;
-
-cleanup:
- VIR_FREE(path);
- return ret;
-}
-
-static int lxcContainerMountFSDevPTS(virDomainDefPtr def,
- const char *stateDir)
-{
- int ret;
- char *path = NULL;
-
- VIR_DEBUG("Mount /dev/pts stateDir=%s", stateDir);
-
- if ((ret = virAsprintf(&path,
- "/.oldroot/%s/%s.devpts",
- stateDir,
- def->name)) < 0)
- return ret;
-
- if (virFileMakePath("/dev/pts") < 0) {
- virReportSystemError(errno, "%s",
- _("Cannot create /dev/pts"));
- goto cleanup;
- }
-
- VIR_DEBUG("Trying to move %s to /dev/pts", path);
-
- if ((ret = mount(path, "/dev/pts",
- NULL, MS_MOVE, NULL)) < 0) {
- virReportSystemError(errno,
- _("Failed to mount %s on /dev/pts"),
- path);
- goto cleanup;
- }
-
-cleanup:
- VIR_FREE(path);
-
- return ret;
-}
-
static int lxcContainerSetupDevices(char **ttyPaths, size_t nttyPaths)
{
size_t i;
@@ -1683,14 +1613,6 @@ static int lxcContainerSetupPivotRoot(virDomainDefPtr vmDef,
if (virCgroupIsolateMount(cgroup, "/.oldroot/", sec_mount_options) < 0)
goto cleanup;
- /* Mounts /dev */
- if (lxcContainerMountFSDev(vmDef, stateDir) < 0)
- goto cleanup;
-
- /* Mounts /dev/pts */
- if (lxcContainerMountFSDevPTS(vmDef, stateDir) < 0)
- goto cleanup;
-
/* Setup device nodes in /dev/ */
if (lxcContainerSetupDevices(ttyPaths, nttyPaths) < 0)
goto cleanup;
@@ -1853,8 +1775,7 @@ static int lxcContainerChild(void *data)
const char *tty = argv->ttyPaths[0];
if (STRPREFIX(tty, "/dev/pts/"))
tty += strlen("/dev/pts/");
- if (virAsprintf(&ttyPath, "%s/%s.devpts/%s",
- LXC_STATE_DIR, vmDef->name, tty) < 0)
+ if (virAsprintf(&ttyPath, "%s/dev/pts/%s", root->src, tty) < 0)
goto cleanup;
} else if (VIR_STRDUP(ttyPath, "/dev/null") < 0) {
goto cleanup;
diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c
index c013147..f7b4127 100644
--- a/src/lxc/lxc_controller.c
+++ b/src/lxc/lxc_controller.c
@@ -2020,6 +2020,56 @@ cleanup:
}
+static int
+virLXCControllerMoveMount(char *name, char *root,
+ const char *s, const char *d)
+{
+ int ret = -1;
+ char *src = NULL;
+ char *dst = NULL;
+
+ if ((ret = virAsprintf(&src, "%s/%s.%s",
+ LXC_STATE_DIR, name, s)) < 0)
+ return ret;
+
+ if ((ret = virAsprintf(&dst, "%s%s", root, d)) < 0)
+ goto cleanup;
+
+ if (virFileMakePath(dst) < 0) {
+ virReportSystemError(errno, _("Cannot create %s"), dst);
+ goto cleanup;
+ }
+
+ if (mount(src, dst, NULL, MS_MOVE, NULL) < 0) {
+ virReportSystemError(errno,
+ _("Failed to mount %s on %s"),
+ src, dst);
+ goto cleanup;
+ }
+
+ ret = 0;
+cleanup:
+ VIR_FREE(src);
+ VIR_FREE(dst);
+ return ret;
+}
+
+static int
+virLXCControllerMoveMounts(virDomainDefPtr def)
+{
+ virDomainFSDefPtr root = virDomainGetRootFilesystem(def);
+
+ if (virLXCControllerMoveMount(def->name, root->src,
+ "dev", "/dev") < 0)
+ return -1;
+
+ if (virLXCControllerMoveMount(def->name, root->src,
+ "devpts", "/dev/pts") < 0)
+ return -1;
+
+ return 0;
+}
+
static void
virLXCControllerEventSend(virLXCControllerPtr ctrl,
int procnr,
@@ -2167,6 +2217,9 @@ virLXCControllerRun(virLXCControllerPtr ctrl)
if (virLXCControllerSetupConsoles(ctrl, containerTTYPaths) < 0)
goto cleanup;
+ if (virLXCControllerMoveMounts(ctrl->def) < 0)
+ goto cleanup;
+
if (lxcSetPersonality(ctrl->def) < 0)
goto cleanup;
--
1.8.3.1
11 years, 1 month
[libvirt] [PATCH] maint: ship .pl scripts as executables
by Eric Blake
All our .pl scripts had the executable bit set, except for one.
Make it consistent (even if we invoke the scripts as an argument
to $(PERL) rather than directly).
* src/check-aclrules.pl: Make executable.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
Pushing under the trivial rule.
src/check-aclrules.pl | 0
1 file changed, 0 insertions(+), 0 deletions(-)
mode change 100644 => 100755 src/check-aclrules.pl
diff --git a/src/check-aclrules.pl b/src/check-aclrules.pl
old mode 100644
new mode 100755
--
1.8.3.1
11 years, 1 month
[libvirt] [PATCH] Don't depend on syslog.service
by Guido Günther
Syslog is socket activated since at least systemd v35 so we can drop
this dependency. Debian's linitian otherwise complains about it.
References:
http://www.freedesktop.org/wiki/Software/systemd/syslog/
http://lintian.debian.org/tags/systemd-service-file-refers-to-obsolete-ta...
---
src/locking/virtlockd.service.in | 1 -
tools/libvirt-guests.service.in | 2 +-
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/locking/virtlockd.service.in b/src/locking/virtlockd.service.in
index a9f9f93..0ef9923 100644
--- a/src/locking/virtlockd.service.in
+++ b/src/locking/virtlockd.service.in
@@ -1,7 +1,6 @@
[Unit]
Description=Virtual machine lock manager
Requires=virtlockd.socket
-After=syslog.target
[Service]
EnvironmentFile=-/etc/sysconfig/virtlockd
diff --git a/tools/libvirt-guests.service.in b/tools/libvirt-guests.service.in
index d41bf2b..5aeb14c 100644
--- a/tools/libvirt-guests.service.in
+++ b/tools/libvirt-guests.service.in
@@ -1,6 +1,6 @@
[Unit]
Description=Suspend Active Libvirt Guests
-After=syslog.target network.target
+After=network.target
[Service]
EnvironmentFile=-/etc/sysconfig/libvirt-guests
--
1.8.4.2
11 years, 1 month