[libvirt] [PATCH] libvirtd: fix potential deadlock when reloading
by Jim Fehlig
It is possible to deadlock libvirtd when concurrently starting a domain
and restarting the daemon. Threads involved in the deadlock are
Thread 4 (Thread 0x7fc13b53e700 (LWP 64084)):
#0 0x00007fc13fba10bf in pthread_cond_wait@(a)GLIBC_2.3.2 () from
/lib64/libpthread.so.0
#1 0x00007fc14310213c in virCondWait (c=0x7fc110017fa8, m=0x7fc110017f80)
at util/virthread.c:154
#2 0x00007fc1280244e9 in qemuMonitorSend (mon=0x7fc110017f70, msg=0x7fc13b53d240)
at qemu/qemu_monitor.c:1083
#3 0x00007fc12803bf5a in qemuMonitorJSONCommandWithFd (mon=0x7fc110017f70,
cmd=0x7fc110017700, scm_fd=-1, reply=0x7fc13b53d318) at
qemu/qemu_monitor_json.c:305
#4 0x00007fc12803c09c in qemuMonitorJSONCommand (mon=0x7fc110017f70,
cmd=0x7fc110017700,
reply=0x7fc13b53d318) at qemu/qemu_monitor_json.c:335
#5 0x00007fc12803f116 in qemuMonitorJSONSetCapabilities (mon=0x7fc110017f70)
at qemu/qemu_monitor_json.c:1298
#6 0x00007fc128026e14 in qemuMonitorSetCapabilities (mon=0x7fc110017f70)
at qemu/qemu_monitor.c:1697
#7 0x00007fc127ffe250 in qemuProcessInitMonitor (driver=0x7fc12004e1e0,
vm=0x7fc110003d00, asyncJob=QEMU_ASYNC_JOB_START) at qemu/qemu_process.c:1763
#8 0x00007fc127ffe564 in qemuConnectMonitor (driver=0x7fc12004e1e0,
vm=0x7fc110003d00,
asyncJob=6, logCtxt=0x7fc1100089c0) at qemu/qemu_process.c:1835
#9 0x00007fc127fff386 in qemuProcessWaitForMonitor (driver=0x7fc12004e1e0,
vm=0x7fc110003d00, asyncJob=6, logCtxt=0x7fc1100089c0) at
qemu/qemu_process.c:2180
#10 0x00007fc128009269 in qemuProcessLaunch (conn=0x7fc1100009a0,
driver=0x7fc12004e1e0,
vm=0x7fc110003d00, asyncJob=QEMU_ASYNC_JOB_START, incoming=0x0, snapshot=0x0,
vmop=VIR_NETDEV_VPORT_PROFILE_OP_CREATE, flags=17) at qemu/qemu_process.c:6111
#11 0x00007fc128009e85 in qemuProcessStart (conn=0x7fc1100009a0,
driver=0x7fc12004e1e0,
vm=0x7fc110003d00, updatedCPU=0x0, asyncJob=QEMU_ASYNC_JOB_START,
migrateFrom=0x0,
migrateFd=-1, migratePath=0x0, snapshot=0x0,
vmop=VIR_NETDEV_VPORT_PROFILE_OP_CREATE,
flags=17) at qemu/qemu_process.c:6334
#12 0x00007fc1280552f1 in qemuDomainCreateXML (conn=0x7fc1100009a0,
xml=0x7fc110000ed0 "<!--\nWARNING: THIS IS AN AUTO-GENERATED FILE.
CHANGES TO IT ARE LIKELY TO BE\nOVERWRITTEN AND LOST. Changes to this xml
configuration should be made using:\n virsh edit testvv\nor other
applicati"..., flags=0) at qemu/qemu_driver.c:1776
...
Thread 1 (Thread 0x7fc143c66880 (LWP 64081)):
#0 0x00007fc13fb9aac8 in __pthread_rwlock_wrlock_slow () from
/lib64/libpthread.so.0
#1 0x00007fc143101ffa in virRWLockWrite (m=0x7fc143678cc0 <updateLock>)
at util/virthread.c:122
#2 0x00007fc1431a394f in virNWFilterWriteLockFilterUpdates () at
conf/nwfilter_conf.c:159
#3 0x00007fc12a5230a0 in nwfilterStateReload () at nwfilter/nwfilter_driver.c:299
#4 0x00007fc1433170c2 in virStateReload () at libvirt.c:829
#5 0x0000558c522d5686 in daemonReloadHandler (dmn=0x558c5328b230,
sig=0x7ffe0a831e30,
opaque=0x0) at remote/remote_daemon.c:724
#6 0x00007fc14321e3c7 in virNetDaemonSignalEvent (watch=2, fd=9, events=1,
opaque=0x558c5328b230) at rpc/virnetdaemon.c:654
#7 0x00007fc143085cc7 in virEventPollDispatchHandles (nfds=11, fds=0x558c532cd930)
at util/vireventpoll.c:508
#8 0x00007fc143086586 in virEventPollRunOnce () at util/vireventpoll.c:657
#9 0x00007fc143084312 in virEventRunDefaultImpl () at util/virevent.c:327
#10 0x00007fc14321ecb8 in virNetDaemonRun (dmn=0x558c5328b230) at
rpc/virnetdaemon.c:858
#11 0x0000558c522d7add in main (argc=3, argv=0x7ffe0a832758) at
remote/remote_daemon.c:1496
(gdb) thr 1
[Switching to thread 1 (Thread 0x7fc143c66880 (LWP 64081))]
#0 0x00007fc13fb9aac8 in __pthread_rwlock_wrlock_slow () from
/lib64/libpthread.so.0
(gdb) f 1
#1 0x00007fc143101ffa in virRWLockWrite (m=0x7fc143678cc0 <updateLock>)
at util/virthread.c:122
122 pthread_rwlock_wrlock(&m->lock);
(gdb) p updateLock
$1 = {lock = {__data = {__lock = 0, __nr_readers = 1, __readers_wakeup = 0,
__writer_wakeup = 0, __nr_readers_queued = 0, __nr_writers_queued = 1,
__writer = 0,
__shared = 0, __rwelision = 0 '\000', __pad1 = "\000\000\000\000\000\000",
__pad2 = 0, __flags = 0},
__size = "\000\000\000\000\001", '\000' <repeats 15 times>, "\001",
'\000' <repeats 34 times>, __align = 4294967296}}
Reloading of the nwfilter driver is stuck waiting for a write lock, which
already has a reader (from qemuDomainCreateXML) in the critical section.
Since the reload occurs in the context of the main event loop thread,
libvirtd becomes deadlocked. The deadlock can be avoided by offloading
the reload work to a thread.
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
Fix suggested by danpb
https://www.redhat.com/archives/libvir-list/2018-March/msg00382.html
src/remote/remote_daemon.c | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/src/remote/remote_daemon.c b/src/remote/remote_daemon.c
index f8082f62f..2146655b0 100644
--- a/src/remote/remote_daemon.c
+++ b/src/remote/remote_daemon.c
@@ -709,20 +709,32 @@ static void daemonShutdownHandler(virNetDaemonPtr dmn,
virNetDaemonQuit(dmn);
}
+static void daemonReloadHandlerThread(void *opague ATTRIBUTE_UNUSED)
+{
+ VIR_INFO("Reloading configuration on SIGHUP");
+ virHookCall(VIR_HOOK_DRIVER_DAEMON, "-",
+ VIR_HOOK_DAEMON_OP_RELOAD, SIGHUP, "SIGHUP", NULL, NULL);
+ if (virStateReload() < 0)
+ VIR_WARN("Error while reloading drivers");
+}
+
static void daemonReloadHandler(virNetDaemonPtr dmn ATTRIBUTE_UNUSED,
siginfo_t *sig ATTRIBUTE_UNUSED,
void *opaque ATTRIBUTE_UNUSED)
{
+ virThread thr;
+
if (!driversInitialized) {
VIR_WARN("Drivers are not initialized, reload ignored");
return;
}
- VIR_INFO("Reloading configuration on SIGHUP");
- virHookCall(VIR_HOOK_DRIVER_DAEMON, "-",
- VIR_HOOK_DAEMON_OP_RELOAD, SIGHUP, "SIGHUP", NULL, NULL);
- if (virStateReload() < 0)
- VIR_WARN("Error while reloading drivers");
+ if (virThreadCreate(&thr, false, daemonReloadHandlerThread, NULL) < 0) {
+ /*
+ * Not much we can do on error here except log it.
+ */
+ VIR_ERROR(_("Failed to create thread to handle daemon restart"));
+ }
}
static int daemonSetupSignals(virNetDaemonPtr dmn)
--
2.16.2
6 years, 8 months
[libvirt] [PATCH] Update to latest gnulib
by Daniel P. Berrangé
GnuLib has now fixed the incompatibility with latest GLibC
that was affecting builds on Fedora rawhide. We can thus
update and drop our local workaround.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
Pushed to git since we don't review trivial gnulib updates.
.gnulib | 2 +-
bootstrap | 4 ++--
gnulib/local/lib/fflush.c.diff | 33 ---------------------------------
gnulib/local/lib/fpurge.c.diff | 13 -------------
gnulib/local/lib/freading.c.diff | 13 -------------
gnulib/local/lib/fseeko.c.diff | 22 ----------------------
6 files changed, 3 insertions(+), 84 deletions(-)
delete mode 100644 gnulib/local/lib/fflush.c.diff
delete mode 100644 gnulib/local/lib/fpurge.c.diff
delete mode 100644 gnulib/local/lib/freading.c.diff
delete mode 100644 gnulib/local/lib/fseeko.c.diff
diff --git a/.gnulib b/.gnulib
index 0404c9ae28..d6397dde2e 160000
--- a/.gnulib
+++ b/.gnulib
@@ -1 +1 @@
-Subproject commit 0404c9ae2845cbf93d71b295b67d6c8bd39382d8
+Subproject commit d6397dde2e127e246e3eeb5254a21f42cac783c8
diff --git a/bootstrap b/bootstrap
index 25920e991c..92be11439a 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1,6 +1,6 @@
#! /bin/sh
# Print a version string.
-scriptversion=2017-09-19.08; # UTC
+scriptversion=2018-03-07.03; # UTC
# Bootstrap this package from checked-out sources.
@@ -1020,7 +1020,7 @@ bootstrap_epilogue
echo "$0: done. Now you can run './configure'."
# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
diff --git a/gnulib/local/lib/fflush.c.diff b/gnulib/local/lib/fflush.c.diff
deleted file mode 100644
index fa0e2431bd..0000000000
--- a/gnulib/local/lib/fflush.c.diff
+++ /dev/null
@@ -1,33 +0,0 @@
-diff --git a/lib/fflush.c b/lib/fflush.c
-index 983ade0ff..5f617305a 100644
---- a/lib/fflush.c
-+++ b/lib/fflush.c
-@@ -32,8 +32,8 @@
-
- #undef fflush
-
--
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#define _IO_IN_BACKUP 0x100
-+#if defined _IO_ftrylockfile || __GNU_LIBRARY__ /* GNU libc, BeOS, Haiku, Linux libc5 */
-
- /* Clear the stream's ungetc buffer, preserving the value of ftello (fp). */
- static void
-@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
-
- #endif
-
--#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
-+#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ /* GNU libc, BeOS, Haiku, Linux libc5 */)
-
- # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
- /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
- if (stream == NULL || ! freading (stream))
- return fflush (stream);
-
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_ftrylockfile || __GNU_LIBRARY__ /* GNU libc, BeOS, Haiku, Linux libc5 */
-
- clear_ungetc_buffer_preserving_position (stream);
-
diff --git a/gnulib/local/lib/fpurge.c.diff b/gnulib/local/lib/fpurge.c.diff
deleted file mode 100644
index 1fd87d8bfa..0000000000
--- a/gnulib/local/lib/fpurge.c.diff
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/lib/fpurge.c b/lib/fpurge.c
-index b1d417c7a..75cf34ca2 100644
---- a/lib/fpurge.c
-+++ b/lib/fpurge.c
-@@ -62,7 +62,7 @@ fpurge (FILE *fp)
- /* Most systems provide FILE as a struct and the necessary bitmask in
- <stdio.h>, because they need it for implementing getc() and putc() as
- fast macros. */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_ftrylockfile || __GNU_LIBRARY__ /* GNU libc, BeOS, Haiku, Linux libc5 */
- fp->_IO_read_end = fp->_IO_read_ptr;
- fp->_IO_write_ptr = fp->_IO_write_base;
- /* Avoid memory leak when there is an active ungetc buffer. */
diff --git a/gnulib/local/lib/freading.c.diff b/gnulib/local/lib/freading.c.diff
deleted file mode 100644
index c51e34dd6a..0000000000
--- a/gnulib/local/lib/freading.c.diff
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/lib/freading.c b/lib/freading.c
-index 73c28acdd..b1c397016 100644
---- a/lib/freading.c
-+++ b/lib/freading.c
-@@ -31,7 +31,7 @@ freading (FILE *fp)
- /* Most systems provide FILE as a struct and the necessary bitmask in
- <stdio.h>, because they need it for implementing getc() and putc() as
- fast macros. */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_ftrylockfile || __GNU_LIBRARY__ /* GNU libc, BeOS, Haiku, Linux libc5 */
- return ((fp->_flags & _IO_NO_WRITES) != 0
- || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
- && fp->_IO_read_base != NULL));
diff --git a/gnulib/local/lib/fseeko.c.diff b/gnulib/local/lib/fseeko.c.diff
deleted file mode 100644
index b2c061fc97..0000000000
--- a/gnulib/local/lib/fseeko.c.diff
+++ /dev/null
@@ -1,22 +0,0 @@
-diff --git a/lib/fseeko.c b/lib/fseeko.c
-index 0101ab55f..542241bb2 100644
---- a/lib/fseeko.c
-+++ b/lib/fseeko.c
-@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence)
- #endif
-
- /* These tests are based on fpurge.c. */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_ftrylockfile || __GNU_LIBRARY__ /* GNU libc, BeOS, Haiku, Linux libc5 */
- if (fp->_IO_read_end == fp->_IO_read_ptr
- && fp->_IO_write_ptr == fp->_IO_write_base
- && fp->_IO_save_base == NULL)
-@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence)
- return -1;
- }
-
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_ftrylockfile || __GNU_LIBRARY__ /* GNU libc, BeOS, Haiku, Linux libc5 */
- fp->_flags &= ~_IO_EOF_SEEN;
- fp->_offset = pos;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
--
2.14.3
6 years, 8 months
[libvirt] [PATCH go-xml] fix type tag for rdp and destkop graphics devices
by Ryan Goodfellow
The current behavior is to generate a type="vnc" tag in the <graphics>
element generated from either a DomainGrapicRDP or DomainGraphicDesktop.
The correct tags should be type="rdp" and type="desktop" respectively.
This commit emits the correct tags and adds a test for correct graphics
device tagging.
---
domain.go | 4 ++--
domain_test.go | 26 ++++++++++++++++++++++++++
2 files changed, 28 insertions(+), 2 deletions(-)
diff --git a/domain.go b/domain.go
index ea53dfc..1de4ade 100644
--- a/domain.go
+++ b/domain.go
@@ -4226,12 +4226,12 @@ func (a *DomainGraphic) MarshalXML(e *xml.Encoder, start xml.StartElement) error
return e.EncodeElement(a.VNC, start)
} else if a.RDP != nil {
start.Attr = append(start.Attr, xml.Attr{
- xml.Name{Local: "type"}, "vnc",
+ xml.Name{Local: "type"}, "rdp",
})
return e.EncodeElement(a.RDP, start)
} else if a.Desktop != nil {
start.Attr = append(start.Attr, xml.Attr{
- xml.Name{Local: "type"}, "vnc",
+ xml.Name{Local: "type"}, "desktop",
})
return e.EncodeElement(a.Desktop, start)
} else if a.Spice != nil {
diff --git a/domain_test.go b/domain_test.go
index 7c9d3a2..1715e01 100644
--- a/domain_test.go
+++ b/domain_test.go
@@ -3782,6 +3782,32 @@ var domainTestData = []struct {
`</domain>`,
},
},
+ {
+ Object: &Domain{
+ Name: "demo",
+ Devices: &DomainDeviceList{
+ Graphics: []DomainGraphic{
+ DomainGraphic{SDL: &DomainGraphicSDL{}},
+ DomainGraphic{VNC: &DomainGraphicVNC{}},
+ DomainGraphic{RDP: &DomainGraphicRDP{}},
+ DomainGraphic{Desktop: &DomainGraphicDesktop{}},
+ DomainGraphic{Spice: &DomainGraphicSpice{}},
+ },
+ },
+ },
+ Expected: []string{
+ `<domain>`,
+ ` <name>demo</name>`,
+ ` <devices>`,
+ ` <graphics type="sdl"></graphics>`,
+ ` <graphics type="vnc"></graphics>`,
+ ` <graphics type="rdp"></graphics>`,
+ ` <graphics type="desktop"></graphics>`,
+ ` <graphics type="spice"></graphics>`,
+ ` </devices>`,
+ `</domain>`,
+ },
+ },
}
func TestDomain(t *testing.T) {
--
2.14.3
6 years, 8 months
[libvirt] [PATCH] util, remote: Fixing the sending of stream when length is defined.
by Julio Faracco
When a length of a file is defined, the responsible thread to send
stream is finishing inappropriately. It is happening because there is
wrong conditional which compares an offset with the length and because
of that the code throws ENOSPC error.
To test it:
virsh# vol-upload ... --length N
Signed-off-by: Julio Faracco <jcfaracco(a)gmail.com>
---
src/remote/remote_daemon_stream.c | 24 ++++++++++++------------
src/util/virfdstream.c | 5 +----
2 files changed, 13 insertions(+), 16 deletions(-)
diff --git a/src/remote/remote_daemon_stream.c b/src/remote/remote_daemon_stream.c
index 4dd3af9e0..998e82a83 100644
--- a/src/remote/remote_daemon_stream.c
+++ b/src/remote/remote_daemon_stream.c
@@ -549,21 +549,21 @@ daemonStreamHandleWriteData(virNetServerClientPtr client,
} else if (ret == -2) {
/* Blocking, so indicate we have more todo later */
return 1;
- } else {
- virNetMessageError rerr;
+ } else if (ret) {
+ virNetMessageError rerr;
- memset(&rerr, 0, sizeof(rerr));
+ memset(&rerr, 0, sizeof(rerr));
- VIR_INFO("Stream send failed");
- stream->closed = true;
- virStreamEventRemoveCallback(stream->st);
- virStreamAbort(stream->st);
+ VIR_INFO("Stream send failed");
+ stream->closed = true;
+ virStreamEventRemoveCallback(stream->st);
+ virStreamAbort(stream->st);
- return virNetServerProgramSendReplyError(stream->prog,
- client,
- msg,
- &rerr,
- &msg->header);
+ return virNetServerProgramSendReplyError(stream->prog,
+ client,
+ msg,
+ &rerr,
+ &msg->header);
}
return 0;
diff --git a/src/util/virfdstream.c b/src/util/virfdstream.c
index be40379a9..c3198c768 100644
--- a/src/util/virfdstream.c
+++ b/src/util/virfdstream.c
@@ -627,9 +627,6 @@ virFDStreamThread(void *opaque)
if (got < 0)
goto error;
- if (got == 0)
- break;
-
total += got;
}
@@ -783,7 +780,7 @@ static int virFDStreamWrite(virStreamPtr st, const char *bytes, size_t nbytes)
virObjectLock(fdst);
if (fdst->length) {
- if (fdst->length == fdst->offset) {
+ if (fdst->offset > fdst->length) {
virReportSystemError(ENOSPC, "%s",
_("cannot write to stream"));
virObjectUnlock(fdst);
--
2.14.1
6 years, 8 months
[libvirt] [PATCH] libvirt:spec: Require gcc for build
by Michal Privoznik
According to latest discussion on fedora devel list [1] gcc will
be removed from default buildroot and packages requiring it must
have explicit build dependency,
1: https://lists.fedoraproject.org/archives/list/devel-announce@lists.fedora...
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
libvirt.spec.in | 1 +
1 file changed, 1 insertion(+)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 8f46f58b5..5e05d706f 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -298,6 +298,7 @@ BuildRequires: gettext-devel
BuildRequires: libtool
BuildRequires: /usr/bin/pod2man
%endif
+BuildRequires: gcc
BuildRequires: git
%if 0%{?fedora} >= 27 || 0%{?rhel} > 7
BuildRequires: perl-interpreter
--
2.16.1
6 years, 8 months
[libvirt] [PATCH 0/3] Update the virsh pool define/create for vHBA/NPIV
by John Ferlan
Looks like when adding support in commit 78be2e8b (and the 3 just
before it), I neglected to update the virsh command allow command
line usage of the fields. This series updates virsh in order to
allow adding the fields (as ugly as they are) to make it easier
to define/create the pool with the fields.
John Ferlan (3):
tools: Add the wwnn/wwpn to the man page for storage pool fields
tools: Update the help description of the adapter-parent field
tools: Add support for additional adapter parent options
tools/virsh-pool.c | 29 ++++++++++++++++++++++++++---
tools/virsh.pod | 17 ++++++++++++-----
2 files changed, 38 insertions(+), 8 deletions(-)
--
2.13.6
6 years, 8 months
[libvirt] [PATCH] qemu: Add qemu functions for storage source private data handling
by Peter Krempa
The qemu driver registered the helpers from util code, but it will be
necessary to format also some qemu-specific data.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
This patch conflicts with Michal's persistent reservations series. I'll
need the code in the place this patch places it later so I'm sending
this to avoid having to move this again very soon.
src/qemu/qemu_domain.c | 26 ++++++++++++++++++++++++--
1 file changed, 24 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index b55013de6a..9802dcdbc6 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -1951,6 +1951,28 @@ qemuDomainObjPrivateFree(void *data)
}
+static int
+qemuStorageSourcePrivateDataParse(xmlXPathContextPtr ctxt,
+ virStorageSourcePtr src)
+{
+ if (virStorageSourcePrivateDataParseRelPath(ctxt, src) < 0)
+ return -1;
+
+ return 0;
+}
+
+
+static int
+qemuStorageSourcePrivateDataFormat(virStorageSourcePtr src,
+ virBufferPtr buf)
+{
+ if (virStorageSourcePrivateDataFormatRelPath(src, buf) < 0)
+ return -1;
+
+ return 0;
+}
+
+
static void
qemuDomainObjPrivateXMLFormatVcpus(virBufferPtr buf,
virDomainDefPtr def)
@@ -2538,8 +2560,8 @@ virDomainXMLPrivateDataCallbacks virQEMUDriverPrivateDataCallbacks = {
.chrSourceNew = qemuDomainChrSourcePrivateNew,
.parse = qemuDomainObjPrivateXMLParse,
.format = qemuDomainObjPrivateXMLFormat,
- .storageParse = virStorageSourcePrivateDataParseRelPath,
- .storageFormat = virStorageSourcePrivateDataFormatRelPath,
+ .storageParse = qemuStorageSourcePrivateDataParse,
+ .storageFormat = qemuStorageSourcePrivateDataFormat,
};
--
2.16.2
6 years, 8 months
[libvirt] libvirt-snmp status
by Michael Corcoran
Hi All,
I'd like to enquire about the status of libvirt-snmp. It hasn't had any
commits for a couple of years and no longer compiles against recent
versions of net-snmp. As I understand it, upstream net-snmp deprecated
and then removed the C type "U64" as it conflicts with Perl.
Fortunately this is the only issue and the patch required to get
libvirt-snmp building again simply replaces the C type "U64" with the
type "struct counter64" in a few places. I tried to submit a patch but
was unable to configure authentication/encryption correctly for git
send-email and I'm unwilling to spend more time on it. Is there any way
to accept patches directly from Github (or anywhere else I can push a
commit)?
My second enquiry relates to the org OID used in the LIBVIRT-MIB. It
currently uses a (presumably) placeholder of 12345. I check the OID
register[1] and found an entry for libvirt (see end of email). I am
guessing that registration didn't go through until after libvirt-snmp
maintenance stopped. I'd like to submit a patch to replace the
placeholder with this org id also.
BR,
Michael Corcoran
[1] https://www.iana.org/assignments/enterprise-numbers/enterprise-numb
ers
36957
libvirt
Daniel Veillard
daniel&veillard.com
6 years, 8 months
[libvirt] [libvirt-snmp] Project status
by Michael Corcoran
Hi All,
I'd like to enquire about the status of libvirt-snmp. It hasn't had any
commits for a couple of years and no longer compiles against recent
versions of net-snmp. As I understand it, upstream net-snmp deprecated
and then removed the C type "U64" as it conflicts with Perl.
Fortunately this is the only issue and the patch required to get
libvirt-snmp building again simply replaces the C type "U64" with the
type "struct counter64" in a few places. I tried to submit a patch but
was unable to configure authentication/encryption correctly for git
send-email and I'm unwilling to spend more time on it. Is there any way
to accept patches directly from Github (or anywhere else I can push a
commit)?
My second enquiry relates to the org OID used in the LIBVIRT-MIB. It
currently uses a (presumably) placeholder of 12345. I check the OID
register[1] and found an entry for libvirt (see end of email). I am
guessing that registration didn't go through until after libvirt-snmp
maintenance stopped. I'd like to submit a patch to replace the
placeholder with this org id also.
BR,
Michael Corcoran
[1] https://www.iana.org/assignments/enterprise-numbers/enterprise-numb
ers
36957
libvirt
Daniel Veillard
daniel&veillard.com
6 years, 8 months
[libvirt] [PATCH v7 00/11] qemu: Validate PCI controller options
by Andrea Bolognani
Applies cleanly on top of b932ed69f6664f42e211bdde84c8ab04e1f19033.
Patches 2/11 and 4/11 are the only ones missing R-bs, everything
else hasn't been significantly altered since [v5].
Changes from [v6]:
* don't special-case the default PHB when checking capabilities.
Changes from [v5]:
* patch 1 has been pushed;
* add virReportController*() functions to cut down on redundant
error reporting, as suggested by laine;
* report index and modelName along with model in error messages.
Changes from [v4]:
* patch 1/12 is new;
* use virReportEnumRangeError(), as suggested by laine.
Changes from [v3]:
* don't introduce new test cases that won't be able to provide
full test coverage anyway, as suggested by laine.
Changes from [v2]:
* replace the old implementation bit by bit using a clever trick
suggested by pkrempa;
* don't move QEMU capability validation;
* add a default: label to all switch statements as recommended
by danpb.
Changes from [v1]:
* error out instead of silently accept invalid options;
* shave quite a lot of yaks.
[v6] https://www.redhat.com/archives/libvir-list/2018-March/msg00203.html
[v5] https://www.redhat.com/archives/libvir-list/2018-March/msg00096.html
[v4] https://www.redhat.com/archives/libvir-list/2018-February/msg01232.html
[v3] https://www.redhat.com/archives/libvir-list/2018-February/msg00996.html
[v2] https://www.redhat.com/archives/libvir-list/2018-February/msg00813.html
[v1] https://www.redhat.com/archives/libvir-list/2018-February/msg00244.html
Andrea Bolognani (11):
qemu: Create new qemuDomainDeviceDefValidateControllerPCI()
qemu: Validate PCI controller options (modelName)
qemu: Validate PCI controller options (index)
qemu: Validate PCI controller options (targetIndex)
qemu: Validate PCI controller options (pcihole64)
qemu: Validate PCI controller options (busNr)
qemu: Validate PCI controller options (numaNode)
qemu: Validate PCI controller options (chassisNr)
qemu: Validate PCI controller options (chassis and port)
qemu: Validate PCI controllers (QEMU capabilities)
qemu: Remove old qemuDomainDeviceDefValidateControllerPCI()
src/qemu/qemu_domain.c | 531 +++++++++++++++++--------
tests/qemuxml2argvdata/pcie-expander-bus.xml | 3 -
tests/qemuxml2argvtest.c | 38 +-
tests/qemuxml2xmloutdata/pcie-expander-bus.xml | 4 +-
tests/qemuxml2xmltest.c | 31 +-
5 files changed, 432 insertions(+), 175 deletions(-)
--
2.14.3
6 years, 8 months