[libvirt] [PATCH v2 0/7] extend virsh domstate to show additional information
by Bjoern Walk
This patch series introduces the ability to save additional information
for the domain state and exposes this information in virsh domstate.
For example in the case of QEMU guest panic events, we can provide additional
information like the crash reason or register state of the domain. This
information usually gets logged in the domain log but for debugging it is
useful to have it accessible from the client. Therefore, let's introduce a new
public API function, virDomainGetStateParams, an extensible version of
virDomainGetState, which returns the complete state of the domain, including
newly introduced additional information.
Let's also extend virsh domstate and introduce a new parameter --info to show
the domain state, reason and additional information when available.
virsh domstate --info guest1
crashed (panicked: s390: core='1' psw-mask='0x1234000000000000' \
psw-addr='0x0000000000001234' reason='disabled-wait')
Previous version is here:
https://www.redhat.com/archives/libvir-list/2018-July/msg00686.html
v1 -> v2:
* refactored the public API according to discussions to provide a
more machine-parsable interface
Bjoern Walk (7):
qemu: monitor: move event data structure to domain
qemu: domain: store and update panic info
lib: introduce virDomainGetStateParams function
remote: implement remoteDomainGetStateParams
qemu: implement qemuDomainGetStateParams
virsh: domstate: report detailed state if available
news: add entry for virDomainGetStateParams
docs/news.xml | 11 +++
include/libvirt/libvirt-domain.h | 76 +++++++++++++++++
src/driver-hypervisor.h | 9 ++
src/libvirt-domain.c | 64 ++++++++++++++
src/libvirt_public.syms | 1 +
src/qemu/qemu_domain.c | 89 +++++++++++++++++++-
src/qemu/qemu_domain.h | 47 +++++++++++
src/qemu/qemu_driver.c | 126 +++++++++++++++++++++++++++-
src/qemu/qemu_monitor.c | 53 +-----------
src/qemu/qemu_monitor.h | 48 ++---------
src/qemu/qemu_monitor_json.c | 20 ++---
src/qemu/qemu_process.c | 2 +-
src/remote/remote_daemon_dispatch.c | 50 +++++++++++
src/remote/remote_driver.c | 44 ++++++++++
src/remote/remote_protocol.x | 22 ++++-
src/remote_protocol-structs | 12 +++
tools/virsh-domain-monitor.c | 102 +++++++++++++++++++---
tools/virsh.pod | 5 +-
18 files changed, 658 insertions(+), 123 deletions(-)
--
2.17.0
5 years, 7 months
[libvirt] [RFC PATCH 0/8] Introduce the virDomainDefineJSONFlags() public API
by Andrea Bolognani
Back in 2005, when the libvirt project was started, XML was pretty
much the only sensible, widely used format one could use to store
structured data. A lot has changed since then, and these days you'd
be hard pressed to find any API that does not use JSON for encoding
information; in fact, we already use JSON heavily inside libvirt, for
example to communicate with QEMU processes through QMP or store
configuration data for use by the libvirt NSS plugin.
The reasons for JSON's success over XML are plain to see: you get the
same nicely structured data, but none of the ugly angle brackets or
annoying repetition caused by having to both open *and* close
elements explicitly; additionally, you get support for extremely
useful and common data structures such as lists and dictionary out of
the box, and even properly typed strings and numbers. It's just an
overall much better data representation language.
This RFC series provides the initial, very basic (yet fully
functional) implementation of a JSON-based alternative to the
existing virDomainDefineXML(); over time, we would introduce similar
APIs for defining libvirt objects other than domains, such as for
example networks.
Once enough time has passed, we might even consider removing the
XML-based APIs altogether and drop the XML parsing code along with
our libxml2 dependency, making libvirt much leaner in the process.
Andrea Bolognani (8):
conf: Introduce virDomainDefParseJSONString()
tests: Add qemujson2argvtest
rpc: Add JSON to the list of fixups in gendispatch
Introduce the virDomainDefineJSONFlags() public API
remote: Implement virDomainDefineJSONFlags() support
qemu: Add virDomainDefineJSONFlags() support
virsh: Add JSON support to the 'define' subcommand
news: Update for virDomainDefineJSONFlags()
docs/news.xml | 11 +
include/libvirt/libvirt-domain.h | 3 +
include/libvirt/virterror.h | 1 +
src/conf/domain_conf.c | 241 ++++
src/conf/domain_conf.h | 5 +
src/driver-hypervisor.h | 6 +
src/libvirt-domain.c | 45 +
src/libvirt_private.syms | 1 +
src/libvirt_public.syms | 1 +
src/qemu/qemu_driver.c | 84 ++
src/remote/remote_driver.c | 3 +-
src/remote/remote_protocol.x | 19 +-
src/remote_protocol-structs | 8 +
src/rpc/gendispatch.pl | 1 +
src/util/virerror.c | 3 +
tests/Makefile.am | 15 +
tests/qemujson2argvdata/tiny.json | 29 +
.../qemujson2argvdata/tiny.x86_64-latest.args | 33 +
tests/qemujson2argvtest.c | 1001 +++++++++++++++++
tools/virsh-domain.c | 36 +-
20 files changed, 1540 insertions(+), 6 deletions(-)
create mode 100644 tests/qemujson2argvdata/tiny.json
create mode 100644 tests/qemujson2argvdata/tiny.x86_64-latest.args
create mode 100644 tests/qemujson2argvtest.c
--
2.20.1
5 years, 7 months
[libvirt] [PATCH] qemu: fix domain unlock/unref in qemuMigrationSrcPerform
by Nikolay Shirokovskiy
qemuMigrationSrcPerform callers expect it to call virDomainObjEndAPI
in any case.
Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy(a)virtuozzo.com>
---
src/qemu/qemu_migration.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 419a729..ce4c443 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -4799,6 +4799,7 @@ qemuMigrationSrcPerform(virQEMUDriverPtr driver,
if (cookieinlen) {
virReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("received unexpected cookie with P2P migration"));
+ virDomainObjEndAPI(&vm);
return -1;
}
@@ -4813,6 +4814,7 @@ qemuMigrationSrcPerform(virQEMUDriverPtr driver,
if (dconnuri) {
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Unexpected dconnuri parameter with non-peer2peer migration"));
+ virDomainObjEndAPI(&vm);
return -1;
}
--
1.8.3.1
5 years, 7 months
[libvirt] [PATCH] apparmor: support QEMU hppa, nios2, or1k, riscv32 and riscv64
by intrigeri+libvirt@boum.org
From: intrigeri <intrigeri+libvirt(a)boum.org>
Fixes: https://bugs.debian.org/914940
---
src/security/apparmor/libvirt-qemu | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/security/apparmor/libvirt-qemu b/src/security/apparmor/libvirt-qemu
index 474aaefdf8..165558fe83 100644
--- a/src/security/apparmor/libvirt-qemu
+++ b/src/security/apparmor/libvirt-qemu
@@ -103,6 +103,7 @@
/usr/bin/qemu-system-alpha rmix,
/usr/bin/qemu-system-arm rmix,
/usr/bin/qemu-system-cris rmix,
+ /usr/bin/qemu-system-hppa rmix,
/usr/bin/qemu-system-i386 rmix,
/usr/bin/qemu-system-lm32 rmix,
/usr/bin/qemu-system-m68k rmix,
@@ -113,10 +114,14 @@
/usr/bin/qemu-system-mips64el rmix,
/usr/bin/qemu-system-mipsel rmix,
/usr/bin/qemu-system-moxie rmix,
+ /usr/bin/qemu-system-nios2 rmix,
+ /usr/bin/qemu-system-or1k rmix,
/usr/bin/qemu-system-or32 rmix,
/usr/bin/qemu-system-ppc rmix,
/usr/bin/qemu-system-ppc64 rmix,
/usr/bin/qemu-system-ppcemb rmix,
+ /usr/bin/qemu-system-riscv32 rmix,
+ /usr/bin/qemu-system-riscv64 rmix,
/usr/bin/qemu-system-s390x rmix,
/usr/bin/qemu-system-sh4 rmix,
/usr/bin/qemu-system-sh4eb rmix,
--
2.20.1
5 years, 7 months
[libvirt] [PATCH v2 0/4] apps: update the listed libvirt apps
by Daniel P. Berrangé
Purge apps that are dead and fix broken links
Daniel P. Berrangé (4):
apps: remove dead archipel project
apps: update link for buildbot
apps: drop link for zenoss software
apps: remove VM Manager android app
docs/apps.html.in | 39 +--------------------------------------
1 file changed, 1 insertion(+), 38 deletions(-)
--
2.20.1
5 years, 7 months