[libvirt] [PATCHv6 0/7] Rest of the relative backing and network commit series
by Peter Krempa
Mostly cosmetical changes since the last round.
Peter Krempa (7):
qemu: caps: Add capability for change-backing-file command
qemu: monitor: Add argument for specifying backing name for block
commit
qemu: monitor: Add support for backing name specification for
block-stream
lib: Introduce flag VIR_DOMAIN_BLOCK_COMMIT_RELATIVE
lib: Introduce flag VIR_DOMAIN_BLOCK_REBASE_RELATIVE
qemu: Add support for networked disks for block commit
qemu: Add support for networked disks for block pull/block rebase
include/libvirt/libvirt.h.in | 6 +++
src/libvirt.c | 8 ++++
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_driver.c | 87 +++++++++++++++++++++++++++++++++++++++-----
src/qemu/qemu_migration.c | 6 +--
src/qemu/qemu_monitor.c | 22 ++++++-----
src/qemu/qemu_monitor.h | 4 +-
src/qemu/qemu_monitor_json.c | 17 +++++++++
src/qemu/qemu_monitor_json.h | 2 +
tests/qemumonitorjsontest.c | 2 +-
tools/virsh-domain.c | 18 ++++++++-
tools/virsh.pod | 9 ++++-
13 files changed, 156 insertions(+), 28 deletions(-)
--
1.9.3
10 years, 10 months
[libvirt] [PATCH 0/6] audit: Improve disk auditing and add auditing of new device types
by Peter Krempa
Peter Krempa (6):
util: storage: Add helper to determine whether storage is local
conf: audit: rng: Reorder new and old RNG device definitions
conf: audit: Split out common steps to audit domain devices
audit: disk: Refactor disk auditing to avoid auditing remote storage
audit: Add auditing for serial/parallel/channel/console characted devs
audit: Audit smartcard devices
src/conf/domain_audit.c | 281 +++++++++++++++++++++++++---------------------
src/conf/domain_audit.h | 11 +-
src/libvirt_private.syms | 2 +
src/lxc/lxc_driver.c | 6 +-
src/qemu/qemu_driver.c | 4 +-
src/qemu/qemu_hotplug.c | 38 +++----
src/util/virstoragefile.c | 7 ++
src/util/virstoragefile.h | 1 +
8 files changed, 198 insertions(+), 152 deletions(-)
--
1.9.3
10 years, 10 months
[libvirt] [PATCH 0/2] Adapt to wireshark-1.12
by Michal Privoznik
With the new wireshark installed I've noticed couple of build breaks. This
fixes the problems I've seen.
Michal Privoznik (2):
wireshark: Include more of libvirt internals
wireshark: Honor API change coming with 1.12 release
tools/wireshark/src/Makefile.am | 2 +-
tools/wireshark/src/packet-libvirt.c | 35 +++++++++++++++++++++++++++++++--
tools/wireshark/src/packet-libvirt.h | 18 ++---------------
tools/wireshark/util/make-dissector-reg | 7 +++++++
4 files changed, 43 insertions(+), 19 deletions(-)
--
1.8.5.5
10 years, 10 months
[libvirt] [PATCH]util:ovs:Delete port if it is exist when add port
by Lichunhe
If the ovs service stop abnormal, or host cold reboot, vm is destroyed after ovs service stop. The ovs
port which connect to interface of vm will not be clear. When the ovs service restart, recover configuration
from db, but the interface is no exist, port recovery failed, and then vm restart on the same host,
libvirt add port again, but the port configuration is same as before, ovs will not connect the interface,
only store the configuration in db. Below will trigger this problem,
virsh start vm
service openvswitch-switch stop
virsh destroy vm
service openvswitch-switch start
virsh start vm
Signed-off-by: Chunhe Li <lichunhe(a)huawei.com>
---
src/util/virnetdevopenvswitch.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/util/virnetdevopenvswitch.c b/src/util/virnetdevopenvswitch.c
index 9bcbfb1..dd601c0 100644
--- a/src/util/virnetdevopenvswitch.c
+++ b/src/util/virnetdevopenvswitch.c
@@ -84,7 +84,8 @@ int virNetDevOpenvswitchAddPort(const char *brname, const char *ifname,
cmd = virCommandNew(OVSVSCTL);
- virCommandAddArgList(cmd, "--timeout=5", "--", "--may-exist", "add-port",
+ virCommandAddArgList(cmd, "--timeout=5", "--", "--if-exists", "del-port",
+ ifname, "--", "--may-exist", "add-port",
brname, ifname, NULL);
if (virtVlan && virtVlan->nTags > 0) {
10 years, 10 months
[libvirt] [PATCH 0/5] Reorganize storage auth (both disk and pool)
by John Ferlan
While understandably not really a 1.2.6 candidate, I figured I'd post this
now in hopes that it gets the ball rolling. The changes will help with
a related bz to support libiscsi for SCSI passthrough devices where a
<hostdev> entry for an iscsi adapter would be able to have <auth> data.
The bulk of changes are code motion/merge. The details for each are:
The first patch will create new API's which will then be used by the
parse domain disk and the parse storage pool code if the "<auth" element
is found. The logic merges the parsing found in the domain disk and
storage pool code with one slight caveat - the domain disk code expects
to find "<secret type='xxxx'", where xxxx is 'iscsi' or 'ceph'. Trying
use the Type{To/From}String API's in virstoragefile.c resulted in a
link time failure (even though secret_conf.h was included). Never quite
figured it out - I will take suggestions though. Although since the
domain disk code is all that really cares about it and the domain_conf
code can use the Type{To/From}String API's - I just left it as is. The
new copy API is used when the pool code needs to copy it's auth data into
each domain disk's auth entry.
The second patch will fix a not-run test that tests the auth. It seems
it was not added to the active list of tests because the output generated
did not include the "usage" information (eg " usage='mycluster_myname") that
is part of the <secret> element. Additionally because it did not include
it the output was "<secret type='iscsi' </auth>". So rather than ignore
the test - add to the filters to avoid looking for "<secret" - through
to the closing ">". The -auth.xml and -auth.args files needed adjustments
to follow the non "-auth" version of the files that have changed over time,
but not also changed int the "-auth" files.
The third patch will cause the domain disk algorithms to utilize the
new generic parse and format APIs as well as using the 'authdef' instead
of the inline structure fields. This patch also restores the checking for
</auth> in the recently restored auth test. Still avoiding the whole
<secret... /> line as I saw no way to filter just the usage that's in
the stored XML file.
The fourth patch is a mostly innocuous html change - it could go early,
but it just felt better in this place.
The fifth patch will cause the storage pool algorithms to utilize the
new generic parse/format API's as well as new authdef structure for
accessing the data. The removal of the duplicated cephx/chap structures
seems (in my mind at least) to simplify things. They were essentially
copies of each other with no seemingly real value in keeping separate
other than the visual in the code of ".chap." or ".cephx.".
John Ferlan (5):
virstorage: Introduce virStorageAuthDef
qemuargv2xmltest: Resurrect RBD and iSCSI auth
Utilize virDomainDiskAuth for domain disk
formatdomain: Fix issues found describing auth
Utilize virDomainDiskAuth for storage pools
docs/formatdomain.html.in | 24 +--
src/conf/domain_conf.c | 106 ++--------
src/conf/storage_conf.c | 152 ++------------
src/conf/storage_conf.h | 38 +---
src/libvirt_private.syms | 5 +-
src/qemu/qemu_command.c | 72 ++++---
src/qemu/qemu_conf.c | 46 +----
src/storage/storage_backend_iscsi.c | 41 ++--
src/storage/storage_backend_rbd.c | 65 +++---
src/util/virstoragefile.c | 219 +++++++++++++++++++--
src/util/virstoragefile.h | 37 +++-
tests/qemuargv2xmltest.c | 3 +
...qemuxml2argv-disk-drive-network-iscsi-auth.args | 4 +-
.../qemuxml2argv-disk-drive-network-iscsi-auth.xml | 12 +-
.../qemuxml2argv-disk-drive-network-rbd-auth.xml | 4 +-
15 files changed, 415 insertions(+), 413 deletions(-)
--
1.9.3
10 years, 10 months
[libvirt] [PATCH v4 0/5] Another version of active commit
by Eric Blake
Rebased to latest libvirt.git, and still waiting on Jeff's qemu
patches to go into qemu.git before I can push any of these,
https://lists.gnu.org/archive/html/qemu-devel/2014-06/msg04060.html
but reposting because of a feature Adam had been requesting:
Patch 3/5 is new, and adds a new <activecommit/> marker to the
'virsh capabilities' output if qemu is detected as supporting
active commit. I've resolved some of Peter's review comments
in patches 1 and 2 (patch 1 underwent a bit of a rewrite to
differentiate the qemu capability probe from normal use of the
interface, and 2 dropped mention of RHEL 6.3 except in the
commit message). At this point, I haven't altered 4 or 5,
although I still need to do something about getting a persistent
domain definition updated after a pivot changes the file in
use by a running domain.
I've forced an update to my git repo:
http://repo.or.cz/w/libvirt/ericb.git/shortlog/refs/heads/gluster
or git checkout git://repo.or.cz/libvirt/ericb.git gluster
Eric Blake (5):
blockjob: allow omitted arguments to QMP block-commit
blockjob: turn on qemu capability bit for active commit
blockjob: expose active commit capability
blockcommit: track job type in xml
blockcommit: turn on active commit
docs/formatcaps.html.in | 46 +++++++++++++++-
docs/formatdomain.html.in | 20 +++----
docs/schemas/capability.rng | 5 ++
docs/schemas/domaincommon.rng | 13 +++++
src/conf/capabilities.c | 3 +-
src/conf/domain_conf.c | 33 +++++++++++-
src/conf/domain_conf.h | 1 +
src/qemu/qemu_capabilities.c | 13 +++++
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_driver.c | 53 ++++++++++++++----
src/qemu/qemu_monitor.c | 12 +++++
src/qemu/qemu_monitor.h | 1 +
src/qemu/qemu_monitor_json.c | 29 ++++++++--
src/qemu/qemu_monitor_json.h | 3 +-
src/qemu/qemu_process.c | 18 ++++---
tests/qemucapabilitiesdata/caps_1.3.1-1.replies | 62 ++++++++++++----------
tests/qemucapabilitiesdata/caps_1.4.2-1.replies | 62 ++++++++++++----------
tests/qemucapabilitiesdata/caps_1.5.3-1.replies | 62 ++++++++++++----------
tests/qemucapabilitiesdata/caps_1.6.0-1.replies | 62 ++++++++++++----------
tests/qemucapabilitiesdata/caps_1.6.50-1.replies | 62 ++++++++++++----------
tests/qemumonitorjsontest.c | 47 ++++++++++++++++
.../qemuxml2argv-disk-active-commit.xml | 37 +++++++++++++
.../qemuxml2argvdata/qemuxml2argv-disk-mirror.xml | 4 +-
.../qemuxml2xmlout-disk-mirror-old.xml | 4 +-
tests/qemuxml2xmltest.c | 1 +
25 files changed, 481 insertions(+), 173 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-active-commit.xml
--
1.9.3
10 years, 10 months
[libvirt] [PATCH v2] tests: Avoid double linking some libraries
by Michal Privoznik
The problem is, since 614581f32b domaincapstest is linked with
$(LDADDS) by default. Then, since 94e3f23e8a7 the test may be
conditionally linked with $(qemu_LDADDS) which already contains
$(LDADDS). And some linkers doesn't cope with this nicely:
CCLD domaincapstest
../src/libvirt_probes.o:(.probes+0x0): multiple definition of `libvirt_event_poll_add_handle_semaphore'
../src/libvirt_probes.o:(.probes+0x0): first defined here
../src/libvirt_probes.o:(.probes+0x2): multiple definition of `libvirt_event_poll_update_handle_semaphore'
../src/libvirt_probes.o:(.probes+0x2): first defined here
../src/libvirt_probes.o:(.probes+0x4): multiple definition of `libvirt_event_poll_remove_handle_semaphore'
../src/libvirt_probes.o:(.probes+0x4): first defined here
../src/libvirt_probes.o:(.probes+0x6): multiple definition of `libvirt_event_poll_dispatch_handle_semaphore'
../src/libvirt_probes.o:(.probes+0x6): first defined here
And so on.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
diff to v1:
-fix securityselinuxlabeltest too
tests/Makefile.am | 31 ++++++++++++++++---------------
1 file changed, 16 insertions(+), 15 deletions(-)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index a262c7b..bc1040a 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -509,12 +509,11 @@ endif WITH_STORAGE
if WITH_DTRACE_PROBES
qemu_LDADDS += ../src/libvirt_qemu_probes.lo
endif WITH_DTRACE_PROBES
-qemu_LDADDS += $(LDADDS)
qemuxml2argvtest_SOURCES = \
qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
testutils.c testutils.h
-qemuxml2argvtest_LDADD = $(qemu_LDADDS) $(LIBXML_LIBS)
+qemuxml2argvtest_LDADD = $(qemu_LDADDS) $(LDADDS) $(LIBXML_LIBS)
qemuxml2argvmock_la_SOURCES = \
qemuxml2argvmock.c
@@ -525,62 +524,64 @@ qemuxml2argvmock_la_LDFLAGS = -module -avoid-version \
qemuxml2xmltest_SOURCES = \
qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
testutils.c testutils.h
-qemuxml2xmltest_LDADD = $(qemu_LDADDS)
+qemuxml2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
qemuxmlnstest_SOURCES = \
qemuxmlnstest.c testutilsqemu.c testutilsqemu.h \
testutils.c testutils.h
-qemuxmlnstest_LDADD = $(qemu_LDADDS)
+qemuxmlnstest_LDADD = $(qemu_LDADDS) $(LDADDS)
qemuargv2xmltest_SOURCES = \
qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
testutils.c testutils.h
-qemuargv2xmltest_LDADD = $(qemu_LDADDS)
+qemuargv2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
-qemuhelptest_LDADD = $(qemu_LDADDS)
+qemuhelptest_LDADD = $(qemu_LDADDS) $(LDADDS)
qemumonitortest_SOURCES = qemumonitortest.c testutils.c testutils.h
-qemumonitortest_LDADD = $(qemu_LDADDS)
+qemumonitortest_LDADD = $(qemu_LDADDS) $(LDADDS)
qemumonitorjsontest_SOURCES = \
qemumonitorjsontest.c \
testutils.c testutils.h \
testutilsqemu.c testutilsqemu.h \
$(NULL)
-qemumonitorjsontest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)
+qemumonitorjsontest_LDADD = libqemumonitortestutils.la \
+ $(qemu_LDADDS) $(LDADDS)
qemucapabilitiestest_SOURCES = \
qemucapabilitiestest.c \
testutils.c testutils.h \
testutilsqemu.c testutilsqemu.h \
$(NULL)
-qemucapabilitiestest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)
+qemucapabilitiestest_LDADD = libqemumonitortestutils.la \
+ $(qemu_LDADDS) $(LDADDS)
qemucaps2xmltest_SOURCES = \
qemucaps2xmltest.c \
testutils.c testutils.h \
$(NULL)
-qemucaps2xmltest_LDADD = $(qemu_LDADDS)
+qemucaps2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
qemuagenttest_SOURCES = \
qemuagenttest.c \
testutils.c testutils.h \
testutilsqemu.c testutilsqemu.h \
$(NULL)
-qemuagenttest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)
+qemuagenttest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS) $(LDADDS)
qemuhotplugtest_SOURCES = \
qemuhotplugtest.c \
testutils.c testutils.h \
testutilsqemu.c testutilsqemu.h \
$(NULL)
-qemuhotplugtest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)
+qemuhotplugtest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS) $(LDADDS)
domainsnapshotxml2xmltest_SOURCES = \
domainsnapshotxml2xmltest.c testutilsqemu.c testutilsqemu.h \
testutils.c testutils.h
-domainsnapshotxml2xmltest_LDADD = $(qemu_LDADDS)
+domainsnapshotxml2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
else ! WITH_QEMU
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c \
qemuxmlnstest.c qemuhelptest.c domainsnapshotxml2xmltest.c \
@@ -837,7 +838,7 @@ domaincapstest_LDADD = $(LDADDS)
if WITH_QEMU
domaincapstest_SOURCES += testutilsqemu.c testutilsqemu.h
-domaincapstest_LDADD += $(qemu_LDADDS)
+domaincapstest_LDADD += $(qemu_LDADDS) $(GNULIB_LIBS)
endif WITH_QEMU
if WITH_LIBVIRTD
@@ -1055,7 +1056,7 @@ if WITH_QEMU
securityselinuxlabeltest_SOURCES = \
securityselinuxlabeltest.c testutils.h testutils.c \
testutilsqemu.h testutilsqemu.c
-securityselinuxlabeltest_LDADD = $(qemu_LDADDS) $(SELINUX_LIBS)
+securityselinuxlabeltest_LDADD = $(qemu_LDADDS) $(LDADDS) $(SELINUX_LIBS)
securityselinuxlabeltest_DEPENDENCIES = libsecurityselinuxhelper.la \
../src/libvirt.la
endif WITH_QEMU
--
1.8.5.5
10 years, 10 months
[libvirt] [PATCH] tests: Avoid double linking some libraries
by Michal Privoznik
The problem is, since 614581f32b domaincapstest is linked with
$(LDADDS) by default. Then, since 94e3f23e8a7 the test may be
conditionally linked with $(qemu_LDADDS) which already contains
$(LDADDS). And some linkers doesn't cope with this nicely:
CCLD domaincapstest
../src/libvirt_probes.o:(.probes+0x0): multiple definition of `libvirt_event_poll_add_handle_semaphore'
../src/libvirt_probes.o:(.probes+0x0): first defined here
../src/libvirt_probes.o:(.probes+0x2): multiple definition of `libvirt_event_poll_update_handle_semaphore'
../src/libvirt_probes.o:(.probes+0x2): first defined here
../src/libvirt_probes.o:(.probes+0x4): multiple definition of `libvirt_event_poll_remove_handle_semaphore'
../src/libvirt_probes.o:(.probes+0x4): first defined here
../src/libvirt_probes.o:(.probes+0x6): multiple definition of `libvirt_event_poll_dispatch_handle_semaphore'
../src/libvirt_probes.o:(.probes+0x6): first defined here
And so on.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
I'd push this as build breaker, but there's another approach to consider,
create qemu_BARE_LDADDS and fill it with the qemu_impl, etc. Then, let:
qemu_LDADDS = $(qemu_BARE_LDADDS) $(LDADDS)
What's your preference?
tests/Makefile.am | 29 +++++++++++++++--------------
1 file changed, 15 insertions(+), 14 deletions(-)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index a262c7b..b9a6345 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -509,12 +509,11 @@ endif WITH_STORAGE
if WITH_DTRACE_PROBES
qemu_LDADDS += ../src/libvirt_qemu_probes.lo
endif WITH_DTRACE_PROBES
-qemu_LDADDS += $(LDADDS)
qemuxml2argvtest_SOURCES = \
qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
testutils.c testutils.h
-qemuxml2argvtest_LDADD = $(qemu_LDADDS) $(LIBXML_LIBS)
+qemuxml2argvtest_LDADD = $(qemu_LDADDS) $(LDADDS) $(LIBXML_LIBS)
qemuxml2argvmock_la_SOURCES = \
qemuxml2argvmock.c
@@ -525,62 +524,64 @@ qemuxml2argvmock_la_LDFLAGS = -module -avoid-version \
qemuxml2xmltest_SOURCES = \
qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
testutils.c testutils.h
-qemuxml2xmltest_LDADD = $(qemu_LDADDS)
+qemuxml2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
qemuxmlnstest_SOURCES = \
qemuxmlnstest.c testutilsqemu.c testutilsqemu.h \
testutils.c testutils.h
-qemuxmlnstest_LDADD = $(qemu_LDADDS)
+qemuxmlnstest_LDADD = $(qemu_LDADDS) $(LDADDS)
qemuargv2xmltest_SOURCES = \
qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
testutils.c testutils.h
-qemuargv2xmltest_LDADD = $(qemu_LDADDS)
+qemuargv2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
-qemuhelptest_LDADD = $(qemu_LDADDS)
+qemuhelptest_LDADD = $(qemu_LDADDS) $(LDADDS)
qemumonitortest_SOURCES = qemumonitortest.c testutils.c testutils.h
-qemumonitortest_LDADD = $(qemu_LDADDS)
+qemumonitortest_LDADD = $(qemu_LDADDS) $(LDADDS)
qemumonitorjsontest_SOURCES = \
qemumonitorjsontest.c \
testutils.c testutils.h \
testutilsqemu.c testutilsqemu.h \
$(NULL)
-qemumonitorjsontest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)
+qemumonitorjsontest_LDADD = libqemumonitortestutils.la \
+ $(qemu_LDADDS) $(LDADDS)
qemucapabilitiestest_SOURCES = \
qemucapabilitiestest.c \
testutils.c testutils.h \
testutilsqemu.c testutilsqemu.h \
$(NULL)
-qemucapabilitiestest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)
+qemucapabilitiestest_LDADD = libqemumonitortestutils.la \
+ $(qemu_LDADDS) $(LDADDS)
qemucaps2xmltest_SOURCES = \
qemucaps2xmltest.c \
testutils.c testutils.h \
$(NULL)
-qemucaps2xmltest_LDADD = $(qemu_LDADDS)
+qemucaps2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
qemuagenttest_SOURCES = \
qemuagenttest.c \
testutils.c testutils.h \
testutilsqemu.c testutilsqemu.h \
$(NULL)
-qemuagenttest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)
+qemuagenttest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS) $(LDADDS)
qemuhotplugtest_SOURCES = \
qemuhotplugtest.c \
testutils.c testutils.h \
testutilsqemu.c testutilsqemu.h \
$(NULL)
-qemuhotplugtest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS)
+qemuhotplugtest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS) $(LDADDS)
domainsnapshotxml2xmltest_SOURCES = \
domainsnapshotxml2xmltest.c testutilsqemu.c testutilsqemu.h \
testutils.c testutils.h
-domainsnapshotxml2xmltest_LDADD = $(qemu_LDADDS)
+domainsnapshotxml2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
else ! WITH_QEMU
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c \
qemuxmlnstest.c qemuhelptest.c domainsnapshotxml2xmltest.c \
@@ -837,7 +838,7 @@ domaincapstest_LDADD = $(LDADDS)
if WITH_QEMU
domaincapstest_SOURCES += testutilsqemu.c testutilsqemu.h
-domaincapstest_LDADD += $(qemu_LDADDS)
+domaincapstest_LDADD += $(qemu_LDADDS) $(GNULIB_LIBS)
endif WITH_QEMU
if WITH_LIBVIRTD
--
1.8.5.5
10 years, 10 months
[libvirt] RFC: 'old' event for leaseshelper.c when lease renews
by Nehal J Wani
In the current version of dnsmasq, the leases helper script/program
specified by --dhcp-script to dnsmasq is invoked on three events,
'add', 'old', 'del'. In short,
add: -> a new lease has to be added to db
del: -> a lease has to be deleted from db
old:-> if lease has changed
Now, the lease can be considered to be changed in 2 ways.
[standard-change] The change could be to the associated hostname or MAC address
[auxiliary-change] The change associated with expiry time or clientid
When only --dhcp-script is set, 'old' events are sent only for
standard-lease changes. But when --dhcp-script is set along with
--leasefile-ro, 'old' events are sent for any change in the lease.
So, right now, if a lease is renewed, the reflected change doesn't
appear in our JSON formatted lease database <interface-name>.status.
We have the following options with this:
(i) We can simply add the --leasefile-ro option. But in that case, the
leases file database which is generated by dnsmasq by the name
<network-name>.leases will cease to exist. It won't contain any lease
information. All lease database handling will be done by our
leaseshelper. Note: this option given a lot of information which is
not stored in <network-name>.leases file.
(ii) We ask the dnsmasq developer(s) to add an extra command line
option to enable auxiliary changes in lease to be propagated to
leaseshelper via 'old' events. I had a small conversation with Simon
Kelley, and he said:
"Yes. For that application (libvirt), you clearly don't want a
third-party patch. At very least I'd be willing to add a boolean
option to dnsmasq which enables "old" events when the lease expiry
time changes, independent of leasefile-ro."
If we do this, then can retain <network-name>.leases and have our helper too.
(iii) We do nothing.
IMO, we should go for (i), since <network-name>.leases becomes
obsolete, once we have our own leases helper. Also, enabling
--leasefile-ro enables a lot of other options, like vendor-class,
user-class, circuit-id and much more, which may be asked for in future
and get added to the virNetworkDHCPLeases struct. But we will have to
remove the option --dhcp-leasefile. Although it won't affect any
existing APIs, if people did rely on the dnsmasq's generated leases
file before, they will find it missing. There is one more point. The
man page of dnsmasq for the leasefile-ro option, states, "In addition
to the invocations given in --dhcp-script the lease-change script is
called once, at dnsmasq startup, with the single argument "init". When
called like this the script should write the saved state of the lease
database, in dnsmasq leasefile format, to stdout and exit with zero
exit code." This is something extra that we will have to add to
leaseshelper if we go with (i).
The easier option is to go with (ii), since Simon is already willing
to add that functionality.
--
Nehal J Wani
10 years, 10 months
[libvirt] [RFC]KVM VMs stay in pause state too long in finish phase during migration
by Wang Rui
Hi,
I started a VM on KVM environment(libvirt1.2.6 qemu1.5.1).
I found that the startup thread keeps vm lock too long.
And this would cause other VMs paused(both on src and dest) too long
during migration.
Steps to Reproduce:
1. Define and start three VMs(VMA, VMB, VMC) on source host
with 16 NICs for each. XML configuration for NIC:
<interface type='bridge'>
<source bridge='br0'/>
<model type='virtio'/>
</interface>
2. Migrate the three VMs from source host to destination host concurrently.
3. On destination host, the three VMs may do the following operation:
1) VMA: do qemuProcessStart(get VM lock until end) -> .. ->
virNetDevTapCreateInBridgePort(). This function costs time 0.28s per NIC,
and 16 NICs costs about 4s.
The following log shows time cost for creating NICs on my host. And it
seems that the time of creating NICs is different between hosts.
2014-07-03 08:40:41.283+0000: 47007: info : remoteDispatchAuthList:2781 : Bypass polkit auth for privileged client pid:47635,uid:0
2014-07-03 08:40:41.285+0000: 47009: info : virNetDevProbeVnetHdr:203 : Enabling IFF_VNET_HDR
2014-07-03 08:40:41.560+0000: 47009: info : virNetDevProbeVnetHdr:203 : Enabling IFF_VNET_HDR
2014-07-03 08:40:41.852+0000: 47009: info : virNetDevProbeVnetHdr:203 : Enabling IFF_VNET_HDR
2014-07-03 08:40:42.144+0000: 47009: info : virNetDevProbeVnetHdr:203 : Enabling IFF_VNET_HDR
2014-07-03 08:40:42.464+0000: 47009: info : virNetDevProbeVnetHdr:203 : Enabling IFF_VNET_HDR
2014-07-03 08:40:42.756+0000: 47009: info : virNetDevProbeVnetHdr:203 : Enabling IFF_VNET_HDR
2014-07-03 08:40:43.076+0000: 47009: info : virNetDevProbeVnetHdr:203 : Enabling IFF_VNET_HDR
2014-07-03 08:40:43.372+0000: 47009: info : virNetDevProbeVnetHdr:203 : Enabling IFF_VNET_HDR
2014-07-03 08:40:43.680+0000: 47009: info : virNetDevProbeVnetHdr:203 : Enabling IFF_VNET_HDR
2014-07-03 08:40:43.972+0000: 47009: info : virNetDevProbeVnetHdr:203 : Enabling IFF_VNET_HDR
2014-07-03 08:40:44.268+0000: 47009: info : virNetDevProbeVnetHdr:203 : Enabling IFF_VNET_HDR
2014-07-03 08:40:44.560+0000: 47009: info : virNetDevProbeVnetHdr:203 : Enabling IFF_VNET_HDR
2014-07-03 08:40:44.720+0000: 47009: info : virNetDevProbeVnetHdr:203 : Enabling IFF_VNET_HDR
2014-07-03 08:40:44.804+0000: 47009: info : virNetDevProbeVnetHdr:203 : Enabling IFF_VNET_HDR
2014-07-03 08:40:44.888+0000: 47009: info : virNetDevProbeVnetHdr:203 : Enabling IFF_VNET_HDR
2014-07-03 08:40:45.040+0000: 47009: info : virNetDevProbeVnetHdr:203 : Enabling IFF_VNET_HDR
2014-07-03 08:40:45.369+0000: 47009: warning : qemuDomainObjTaint:1670 : Domain id=7 name='suse11sp3_test_7' uuid=94c4ac0b-3a6a-41aa-b16c-80aa7adbc6b8 is tainted: high-privileges
2014-07-03 08:40:45.708+0000: 47009: info : virSecurityDACSetOwnership:227 : Setting DAC user and group on '/home/wcj/DTS/suse11sp3_test_7' to '0:0'
2) VMB: do qemuMigrationPrepareAny() -> virDomainObjListAdd(). This function acquires
driver->doms lock. And then virHashSearch() waits for VMA's vm lock which is hold
by VMA's qemuProcessStart() thread.
3) VMC: do qemuDomainMigrateFinish3 -> virDomainObjListFindByName.
This operation waits for driver->doms lock which is hold by VMB's
qemuMigrationPrepareAny() thread.
As VMC is in finish phase, it's in pause state on both source host and destination host.
In the worst case, VMC may stay in pause state for about 4s during migration.
And the pause time increased if we migrate more VMs concurrently.
VirNetDevTapCreateInBridgePort() which holds vm lock costs a little long time.
IMHO it would be nice to do some lock optimization for this case. (I think it makes
little sense to optimize the time of creating net device. Because even though
the time is reduced to 0.1s, if vm has 16 NICs, the vm lock will be held for more
than 1.6s.)
Any ideas?
10 years, 10 months