[libvirt] [PATCH] docs: add a page describing support guarantees for libvirt features
by Daniel P. Berrange
While we have collective knowledge about the support status of various
parts of libvirt, this has never been formally documented, leaving our
users to guess.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
docs/docs.html.in | 3 +
docs/support.html.in | 257 +++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 260 insertions(+)
create mode 100644 docs/support.html.in
diff --git a/docs/docs.html.in b/docs/docs.html.in
index 931da85424..a8d544f83f 100644
--- a/docs/docs.html.in
+++ b/docs/docs.html.in
@@ -110,6 +110,9 @@
<dt><a href="drivers.html">Drivers</a></dt>
<dd>Hypervisor specific driver information</dd>
+ <dt><a href="support.html">Support guarantees</a></dt>
+ <dd>Details of support status for various interfaces</dd>
+
<dt><a href="hvsupport.html">Driver support</a></dt>
<dd>matrix of API support per hypervisor per release</dd>
diff --git a/docs/support.html.in b/docs/support.html.in
new file mode 100644
index 0000000000..6f34a35eb7
--- /dev/null
+++ b/docs/support.html.in
@@ -0,0 +1,257 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <body>
+ <h1>Support guarantees</h1>
+
+ <ul id="toc"></ul>
+
+ <p>
+ This document will outline the support status / guarantees around the
+ very interfaces that libvirt exposes to applications and/or system
+ adminstrators. The intent is to help users understand what features they
+ can rely upon in particular scenarios, and whether they are likely to
+ suffer disruption during upgrades
+ </p>
+
+ <h2><a id="publicAPI">Primary public API</a></h2>
+
+ <p>
+ The main public API provided by <code>libvirt.so</code> and described
+ in <code>libvirt/libvirt.h</code> exposes the primary hypervisor
+ agnostic management interface of libvirt. This API has the strongest
+ guarantee of any part of libvirt with a promise to keep backwards
+ compatibility forever. Specific details are as follows:
+ </p>
+
+ <dl>
+ <dt>Functions</dt>
+ <dd>Functions will never be removed from the public API, and will
+ never have parameters added, removed or changed in their signature.
+ IOW they will be ABI compatible forever. The semantics implied by
+ a specific set of parameters passed to the function will remain
+ unchanged. Where a parameter accepts a bitset of feature flags, or
+ an enumerated value, further flags / enum values may be supported
+ in the future. Where a parameter accepts one of a set of related
+ constants, further constants may be supported in the future.
+ </dd>
+ <dt>Struct types</dt>
+ <dd>Once defined in a release, struct definitions will never have any
+ fields add, removed or changed in any way. Their size and layout is
+ fixed forever. If a struct name starts with an underscore, it is
+ considered acceptable to rename it. Applications should thus always
+ use the corresponding typedef in preference to the struct name.
+ </dd>
+ <dt>Union types</dt>
+ <dd>Once defined in a release, union definitions will never have any
+ existing fields removed or changed. New union choices may be added,
+ provided that they don't change the size of the existing union
+ definition. If a struct name starts with an underscore, it is
+ considered acceptable to rename it. Applications should thus always
+ use the corresponding typedef in preference to the struct name.
+ </dd>
+ <dt>Type definitions</dt>
+ <dd>Most custom data types used in the APIs have corresponding typedefs
+ provided for their stable names. The typedefs should always be used
+ in preference to the underlying data type name, as the latter are not
+ guaranteed to be stable.
+ </dd>
+ <dt>Enumerations</dt>
+ <dd>Once defined in a release, existing enumeration values will never
+ be removed or renamed. New enumeration values may be introduced at
+ any time. Every enumeration will have a '_LAST' value which indicates
+ the current highest enumeration value, which may increase with new
+ releases. If an enumeration name starts with an underscore, it is
+ considered acceptable to rename it. Applications should thus always
+ use the corresponding typedef in preference to the enum name.
+ </dd>
+ <dt>Constants</dt>
+ <dd>Once defined in a release, existing constants will never be removed
+ or have their value changed. Most constants are grouped into related
+ sets, and within each set, new constants may be introduced. APIs which
+ use the constants may thus accept or return new constant values over
+ time.
+ </dd>
+ <dt>Symbol versions</dt>
+ <dd>Where the platform library format permits, APIs defined in libvirt.so
+ library will have version information associated. Each API will be
+ tagged with the version in which it was introduced, and this won't
+ be changed thereafter.
+ </dd>
+ </dl>
+
+ <h2><a id="hvAPI">Hypervisor specific APIs</a></h2>
+
+ <p>
+ A number of hypervisor drivers provide additional libraries with hypervisor
+ specific APIs, extending the core libvirt API. These add-on libraries follow
+ the same general principles described above, however, they are <strong>not</strong>
+ not guranteed to be preserved forever. The project reserves the right to remove
+ hypervisor specific APIs in any new release, or to change their semantics.
+ That said the project will endeavour to maintain API compatibility for as long
+ as is practical.
+ </p>
+
+ <p>
+ Use of some hypervisor specific APIs may result in the running guest being
+ marked as "tainted" if the API is at risk of having unexpected interactions
+ with normal libvirt operations. An application which chooses to make use of
+ hypervisor specific APIs should validate their operation with each new release
+ of libvirt and each new release of the underlying hypervisor. The semantics
+ may change in unexpected ways, or have unforseen interactions with libvirt's
+ operation.
+ </p>
+
+ <h2><a id="apierrors">Error reporting</a></h2>
+
+ <p>
+ Almost API calls are subject to failure and so will report error codes and
+ messages. Libvirt defines error codes for a wide variety of scenarios, some
+ are very targetted to specific problems, while others are general purpose
+ for broad classes of problem. Over time the error codes reported are liable
+ to, usually changing from a generic error to a more specific error. Thus
+ applications should be careful about checking for & taking action upon
+ specific error codes, as the behaviour is liable to change across releases.
+ </p>
+
+ <h2><a id="xmlschema">XML schemas</a></h2>
+
+ <p>
+ The main objects exposed via the primary libvirt public API are usually
+ configured via XML documents following specific schemas. The XML schemas
+ are considered to be stable formats, whose compatibility will be maintained
+ forever. Specific details are as follows:
+ </p>
+
+ <dl>
+ <dt>Attributes</dt>
+ <dd>Attributes defined on an XML element will never be removed or
+ renamed. New attributes may be defined. If the set of valid values
+ for an attribute are determined by an enumeration, the permitted
+ values will never be removed or renamed, only new values defined.
+ None the less, specific hypervisors may reject usage of certain
+ values according to their feature set.</dd>
+ <dt>Elements</dt>
+ <dd>Elements defined will never be removed or renamed. New child
+ elements may be defined at any time. In places where only a
+ single instance of a named XML element is used, future versions
+ may be extended to permit multiple instances of the named XML
+ element to be used. An element which currently has no content
+ may later gain child elements.
+ </dd>
+ </dl>
+
+ <p>
+ Some hypervisor drivers may choose to allow use of hypervisor specific
+ extensions to the XML documents. These extensions will always be
+ contained within a hypervisor specific XML namespace. There is generally
+ no guarantee of long term support for the hypervisor specific extensions
+ across releases, though the project will endeavour to preserve them as
+ long as is possible. Applications choosing to use hypervisor specific
+ extensions should validate their operation against new libvirt or
+ hypervisor releases.
+ </p>
+
+ <h2><a id="configfiles">Configuration files</a></h2>
+
+ <p>
+ A number of programs / daemons provided libvirt rely on host filesystem
+ configuration files. These configuration files are accompanied by augeas
+ lens for easy manipulation by applications. There is in general no
+ guarantee that parameters available in the configuration file will be
+ preserved across releases, though the project will endeavour to preserve
+ them as long as is possible. If a configuration option is dropped from
+ the file, the augeas lens will retain the ability to read that configuration
+ parameter, so that it is able to read & update historically modified
+ files.
+
+ The default configuration files ship with all parameters commented out
+ such that a deployment relies on the built-in defaults of the application
+ in question. There is no guarantee that the defaults will remain the same
+ across releases. An deployments that expects a particular value for a
+ configuration parameter should consider defining it explicitly, instead
+ of relying on the defaults.
+ </p>
+
+ <h2><a id="hvdrivers">Hypervisor drivers</a></h2>
+
+ <p>
+ The libvirt project provides support for a wide variety of hypervisor
+ drivers. These drivers target certain versions of the hypervisor's
+ underlying management APIs. In general libvirt aims to work with any
+ hypervisor version that is still broadly supported by its vendor.
+ When a vendor discontinues support for a particular hypervisor
+ version it will be dropped by libvirt. Libvirt may choose to drop
+ support for a particular hypervisor version prior to the vendor
+ ending support, if it deems that the likely usage is too small to
+ justify the ongoing maintenance cost.
+ </p>
+ <p>
+ Each hypervisor release will implement a distinct subset of features
+ that can be expressed in the libvirt APIs and XML formats. While the
+ XML schema syntax will be stable across releases, libvirt is unable
+ to promise that it will always be able to support usage of the same
+ features across hypervisor releases. Where a hypervisor changes the
+ way a feature is implemented, the project will endeavour to adapt
+ to the new implementation to provide the same semantics. In cases
+ where the feature is discontinued by the hypervisor, libvirt will
+ return an error indicating it is no supported. Likewise libvirt will
+ make reasonable efforts to keep API calls working across hypervisor
+ releases even if the underlying implementation changes. In cases where
+ this is impossible, an suitable error will be reported. The list of
+ APIs which have implementations <a href="hvsupport.html">is detailed separately</a>.
+ </p>
+
+ <h2><a id="rpcproto">RPC protocol</a></h2>
+
+ <p>
+ For some hypervisor drivers, the libvirt.so library communicates with
+ separate libvirt daemons to perform work. This communication takes
+ place over a binary RPC protocol defined by libvirt. The protocol uses
+ the XDR format for data encoding, and the message packet format is
+ defined in libvirt source code.
+ </p>
+ <p>
+ Applications are encouraged to use the primary libvirt.so library which
+ transparently talks to the daemons, so that they are not exposed to the
+ hypervisor driver specific details. None the less, the RPC protocol
+ associated with the libvirtd is considered to be a long term stable ABI.
+ It will only ever have new messages added to it, existing messages will
+ not be removed, nor have their contents changed. Thus if an application
+ does wish to provide its own client side implementation of the RPC
+ protocol this is supported, with the caveat that the application will
+ loose the ability to work with certain hypervisors libvirt supports.
+ The project reserves the right to define new authentication and encryption
+ options for the protocol, and the defaults used in this area may change
+ over time. This is particularly true of the TLS ciphers permitted. Thus
+ applications choosing to implement the RPC protocol must be prepared to
+ track support for new security options. If defaults are changed, however,
+ it will generally be possible to reconfigure the daemon to use the old
+ defaults, albeit with possible implications for system security.
+ </p>
+
+ <p>
+ Other daemons besides, libvirtd, also use the same RPC protocol, but
+ with different message types defined. These RPC protocols are all
+ considered to be private implementation that are liable to change
+ at any time. Applications must not attempt to talk to these other
+ daemons directly.
+ </p>
+
+ <h2><a id="virsh">virsh client</a></h2>
+
+ <p>
+ The virsh program provides a simple client to interact with an arbitrary libvirt
+ hypevisor connection. Since it uses the primary public API of libvirt, it should
+ generally inherit the guarantees associated with that API, and with the hypervisor
+ driver. The commands that virsh exposes, and the arguments they accept are all
+ considered to be long term stable. Existing commands and arguments will not be
+ removed or renamed. New commands and arguments may be added in new releases.
+ The text output format produced by virsh commands is not generally guaranteed to
+ be stable if it contains compound data (eg formatted tables or lists). Commands
+ which output single data items (ie an object name, or an XML document), can be
+ treated as having stable format.
+ </p>
+
+ </body>
+</html>
--
2.14.3
7 years, 1 month
[libvirt] [PATCH] virt-viewer.spec.in: fix build after spice-xpi-client removal
by marcandre.lureau@redhat.com
From: Marc-André Lureau <marcandre.lureau(a)redhat.com>
This fixes commit 140cb84c2538bf0eab7dea2035dfecc4db74c784, where we
removed the spice-xpi-client-remote-viewer.
Signed-off-by: Marc-André Lureau <marcandre.lureau(a)redhat.com>
---
virt-viewer.spec.in | 8 --------
1 file changed, 8 deletions(-)
diff --git a/virt-viewer.spec.in b/virt-viewer.spec.in
index 44ef92e..54e2121 100644
--- a/virt-viewer.spec.in
+++ b/virt-viewer.spec.in
@@ -89,9 +89,6 @@ autoreconf -if
%install
rm -rf $RPM_BUILD_ROOT
%__make install DESTDIR=$RPM_BUILD_ROOT
-mkdir -p %{buildroot}%{_libexecdir}
-touch %{buildroot}%{_libexecdir}/spice-xpi-client
-install -m 0755 data/spice-xpi-client-remote-viewer %{buildroot}%{_libexecdir}/
%find_lang %{name}
%clean
@@ -100,8 +97,6 @@ rm -rf $RPM_BUILD_ROOT
%post
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
/bin/touch --no-create %{_datadir}/mime/packages &> /dev/null || :
-%{_sbindir}/update-alternatives --install %{_libexecdir}/spice-xpi-client \
- spice-xpi-client %{_libexecdir}/spice-xpi-client-remote-viewer 25
/usr/bin/update-desktop-database -q %{_datadir}/applications
%postun
@@ -109,7 +104,6 @@ if [ $1 -eq 0 ] ; then
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
/usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || :
- %{_sbindir}/update-alternatives --remove spice-xpi-client %{_libexecdir}/spice-xpi-client-remote-viewer
fi
/usr/bin/update-desktop-database -q %{_datadir}/applications
@@ -127,8 +121,6 @@ fi
%{_datadir}/applications/remote-viewer.desktop
%{_datadir}/appdata/remote-viewer.appdata.xml
%{_datadir}/mime/packages/virt-viewer-mime.xml
-%ghost %{_libexecdir}/spice-xpi-client
-%{_libexecdir}/spice-xpi-client-remote-viewer
%{_mandir}/man1/virt-viewer.1*
%{_mandir}/man1/remote-viewer.1*
--
2.15.0.125.g8f49766d64
7 years, 1 month
[libvirt] [jenkins-ci PATCH 0/2] Small fixes
by Andrea Bolognani
Andrea Bolognani (2):
jobs: Use $MAKE in autotools-mingw-job
projects: Use {smp} in osinfo-db-master-build
jobs/autotools.yaml | 8 ++++----
projects/osinfo-db.yaml | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
--
2.14.3
7 years, 1 month
[libvirt] [jenkins-ci PATCH] projects: Port libvirt-cim to autotools-*-job
by Andrea Bolognani
Now that libvirt-cim's autogen.sh script has been changed to
be compatible with the ones used by other libvirt-related
project, we can drop the ad-hoc rules used to build it and
adopt the standard autotools-*-job rules instead.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
Not to be pushed until
https://www.redhat.com/archives/libvir-list/2017-November/msg00675.html
has been merged into libvirt-cim.
projects/libvirt-cim.yaml | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/projects/libvirt-cim.yaml b/projects/libvirt-cim.yaml
index b5405f3..d09db86 100644
--- a/projects/libvirt-cim.yaml
+++ b/projects/libvirt-cim.yaml
@@ -9,17 +9,7 @@
- libvirt-fedora-rawhide
title: libvirt CIM
jobs:
- - generic-build-job:
+ - autotools-build-job:
parent_jobs: 'libvirt-master-build'
- command: |
- {make_env}
- ./autogen.sh
- ./configure --prefix=$VIRT_PREFIX
- $MAKE -j{smp}
- $MAKE -j{smp} install
- - generic-rpm-job:
+ - autotools-rpm-job:
parent_jobs: 'libvirt-cim-master-build'
- command: |
- {make_env}
- sed -i -e "s/.*libvirt-devel.*//" libvirt-cim.spec.in
- $MAKE -j{smp} rpm
--
2.14.3
7 years, 1 month
[libvirt] [cim PATCH 0/3] autogen.sh improvements
by Andrea Bolognani
These changes are a requirement for porting the libvirt-cim
CI jobs to autotools-*-job.
Andrea Bolognani (3):
autogen: Better error handling
autogen: Run configure automatically
autogen: Support running out-of-tree
autogen.sh | 48 +++++++++++++++++++++++++++++++++++++-----------
1 file changed, 37 insertions(+), 11 deletions(-)
--
2.14.3
7 years, 1 month
[libvirt] [PATCH v2 0/3] Fix user provided aliases for some devices
by Michal Privoznik
In case user provides an alias for a device that is implicit
(e.g. IDE controller for 440fx, SATA for Q35, etc.) we don't put
the device onto qemu command line. Therefore we can't set its
alias.
diff to v1:
- more controllers covered
Michal Privoznik (3):
virQEMUCapsHasPCIMultiBus: Fix @def type
qemuBuildDriveDevStr: Prefer default alias for SATA bus
qemuBuildDeviceAddressStr: Prefer default alias for PCI bus
src/qemu/qemu_capabilities.c | 2 +-
src/qemu/qemu_capabilities.h | 2 +-
src/qemu/qemu_command.c | 45 ++++++++++++++++------
.../qemuxml2argvdata/qemuxml2argv-user-aliases.xml | 4 +-
.../qemuxml2argv-user-aliases2.args | 1 +
.../qemuxml2argv-user-aliases2.xml | 34 ++++++++++++++++
tests/qemuxml2argvtest.c | 1 +
7 files changed, 75 insertions(+), 14 deletions(-)
create mode 120000 tests/qemuxml2argvdata/qemuxml2argv-user-aliases2.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-user-aliases2.xml
--
2.13.6
7 years, 1 month
[libvirt] [PATCH] RFC: qemu: add vmcoreinfo support
by marcandre.lureau@redhat.com
From: Marc-André Lureau <marcandre.lureau(a)redhat.com>
Starting from qemu 2.11, the `-device vmcoreinfo` will create a fw_cfg
entry for a guest to store dump details, necessary to process kernel
dump with KASLR enabled and providing additional kernel details.
Since the device is a singleton and shouldn't use additional hardware
resources, I decided to map this to a <feature> element in the libvirt
domain XML. Feel free to argue and decide if it is better to have it
under <devices> instead.
The device is arm/x86 only for now (targets that support fw_cfg+dma).
Related to:
https://bugzilla.redhat.com/show_bug.cgi?id=1395248
Signed-off-by: Marc-André Lureau <marcandre.lureau(a)redhat.com>
---
docs/formatdomain.html.in | 4 +++
docs/schemas/domaincommon.rng | 5 +++
src/conf/domain_conf.c | 5 ++-
src/conf/domain_conf.h | 1 +
src/qemu/qemu_capabilities.c | 2 ++
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 26 +++++++++++++++
.../qemuxml2argvdata/qemuxml2argv-vmcoreinfo.args | 25 ++++++++++++++
tests/qemuxml2argvdata/qemuxml2argv-vmcoreinfo.xml | 28 ++++++++++++++++
tests/qemuxml2argvtest.c | 1 +
.../qemuxml2xmlout-vmcoreinfo.xml | 38 ++++++++++++++++++++++
tests/qemuxml2xmltest.c | 1 +
12 files changed, 136 insertions(+), 1 deletion(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-vmcoreinfo.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-vmcoreinfo.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-vmcoreinfo.xml
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 92e14a919..d87a32a89 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -1878,6 +1878,10 @@
which is also known as a split I/O APIC mode.
<span class="since">Since 3.4.0</span> (QEMU/KVM only)
</dd>
+ <dt><code>vmcoreinfo</code></dt>
+ <dd>Enable QEMU vmcoreinfo device to let the guest kernel save debug
+ details. <span class="since">Since 3.10.0</span> (QEMU only)
+ </dd>
</dl>
<h3><a id="elementsTime">Time keeping</a></h3>
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 9cec1a063..86cbe2c8c 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -4736,6 +4736,11 @@
<optional>
<ref name="ioapic"/>
</optional>
+ <optional>
+ <element name="vmcoreinfo">
+ <empty/>
+ </element>
+ </optional>
</interleave>
</element>
</optional>
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 400e90032..3a9b56cd2 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -148,7 +148,8 @@ VIR_ENUM_IMPL(virDomainFeature, VIR_DOMAIN_FEATURE_LAST,
"vmport",
"gic",
"smm",
- "ioapic")
+ "ioapic",
+ "vmcoreinfo")
VIR_ENUM_IMPL(virDomainCapabilitiesPolicy, VIR_DOMAIN_CAPABILITIES_POLICY_LAST,
"default",
@@ -18710,6 +18711,7 @@ virDomainDefParseXML(xmlDocPtr xml,
case VIR_DOMAIN_FEATURE_VIRIDIAN:
case VIR_DOMAIN_FEATURE_PRIVNET:
case VIR_DOMAIN_FEATURE_HYPERV:
+ case VIR_DOMAIN_FEATURE_VMCOREINFO:
case VIR_DOMAIN_FEATURE_KVM:
def->features[val] = VIR_TRISTATE_SWITCH_ON;
break;
@@ -26052,6 +26054,7 @@ virDomainDefFormatInternal(virDomainDefPtr def,
case VIR_DOMAIN_FEATURE_ACPI:
case VIR_DOMAIN_FEATURE_PAE:
case VIR_DOMAIN_FEATURE_VIRIDIAN:
+ case VIR_DOMAIN_FEATURE_VMCOREINFO:
case VIR_DOMAIN_FEATURE_PRIVNET:
switch ((virTristateSwitch) def->features[i]) {
case VIR_TRISTATE_SWITCH_ABSENT:
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index be38792c6..add668025 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1723,6 +1723,7 @@ typedef enum {
VIR_DOMAIN_FEATURE_GIC,
VIR_DOMAIN_FEATURE_SMM,
VIR_DOMAIN_FEATURE_IOAPIC,
+ VIR_DOMAIN_FEATURE_VMCOREINFO,
VIR_DOMAIN_FEATURE_LAST
} virDomainFeature;
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 7cb091056..44a2833a7 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -443,6 +443,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
/* 270 */
"vxhs",
"virtio-blk.num-queues",
+ "vmcoreinfo",
);
@@ -1670,6 +1671,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = {
{ "pcie-root-port", QEMU_CAPS_DEVICE_PCIE_ROOT_PORT },
{ "qemu-xhci", QEMU_CAPS_DEVICE_QEMU_XHCI },
{ "spapr-pci-host-bridge", QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE },
+ { "vmcoreinfo", QEMU_CAPS_DEVICE_VMCOREINFO },
};
static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBalloon[] = {
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index cacc2b77e..0cd9755a8 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -429,6 +429,7 @@ typedef enum {
/* 270 */
QEMU_CAPS_VXHS, /* -drive file.driver=vxhs via query-qmp-schema */
QEMU_CAPS_VIRTIO_BLK_NUM_QUEUES, /* virtio-blk-*.num-queues */
+ QEMU_CAPS_DEVICE_VMCOREINFO, /* -device vmcoreinfo */
QEMU_CAPS_LAST /* this must always be the last item */
} virQEMUCapsFlags;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 8708b79ed..b903b27b9 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -9727,6 +9727,29 @@ qemuBuildTPMCommandLine(virCommandPtr cmd,
}
+static int
+qemuBuildVMCoreInfoCommandLine(virCommandPtr cmd,
+ const virDomainDef *def,
+ virQEMUCapsPtr qemuCaps)
+{
+ virTristateSwitch vmci = def->features[VIR_DOMAIN_FEATURE_VMCOREINFO];
+
+ if (vmci != VIR_TRISTATE_SWITCH_ON) {
+ return 0;
+ }
+
+ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VMCOREINFO)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("vmcoreinfo is not available "
+ "with this QEMU binary"));
+ return -1;
+ }
+
+ virCommandAddArgList(cmd, "-device", "vmcoreinfo", NULL);
+ return 0;
+}
+
+
static int
qemuBuildPanicCommandLine(virCommandPtr cmd,
const virDomainDef *def,
@@ -10146,6 +10169,9 @@ qemuBuildCommandLine(virQEMUDriverPtr driver,
if (qemuBuildNVRAMCommandLine(cmd, def, qemuCaps) < 0)
goto error;
+ if (qemuBuildVMCoreInfoCommandLine(cmd, def, qemuCaps) < 0)
+ goto error;
+
if (snapshot)
virCommandAddArgList(cmd, "-loadvm", snapshot->def->name, NULL);
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-vmcoreinfo.args b/tests/qemuxml2argvdata/qemuxml2argv-vmcoreinfo.args
new file mode 100644
index 000000000..772e5a071
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-vmcoreinfo.args
@@ -0,0 +1,25 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-i686 \
+-name QEMUGuest1 \
+-S \
+-M pc \
+-m 214 \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-nographic \
+-nodefaults \
+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
+server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=readline \
+-no-acpi \
+-boot c \
+-usb \
+-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
+-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \
+-device vmcoreinfo
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-vmcoreinfo.xml b/tests/qemuxml2argvdata/qemuxml2argv-vmcoreinfo.xml
new file mode 100644
index 000000000..f8e586531
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-vmcoreinfo.xml
@@ -0,0 +1,28 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <features>
+ <vmcoreinfo/>
+ </features>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-i686</emulator>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda' bus='ide'/>
+ <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+ </disk>
+ <controller type='ide' index='0'/>
+ <memballoon model='virtio'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 2e07b85aa..7b9b846ef 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -2810,6 +2810,7 @@ mymain(void)
DO_TEST_PARSE_ERROR("cpu-cache-emulate-l2", QEMU_CAPS_KVM);
DO_TEST_PARSE_ERROR("cpu-cache-passthrough3", QEMU_CAPS_KVM);
DO_TEST_PARSE_ERROR("cpu-cache-passthrough-l3", QEMU_CAPS_KVM);
+ DO_TEST("vmcoreinfo", QEMU_CAPS_DEVICE_VMCOREINFO);
DO_TEST("user-aliases", QEMU_CAPS_KVM, QEMU_CAPS_DEVICE_CIRRUS_VGA,
QEMU_CAPS_OBJECT_MEMORY_FILE, QEMU_CAPS_PIIX_DISABLE_S3,
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-vmcoreinfo.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-vmcoreinfo.xml
new file mode 100644
index 000000000..a3922d630
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-vmcoreinfo.xml
@@ -0,0 +1,38 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <features>
+ <vmcoreinfo/>
+ </features>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-i686</emulator>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda' bus='ide'/>
+ <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+ </disk>
+ <controller type='ide' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='usb' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <memballoon model='virtio'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </memballoon>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 5a282e5ff..9a7d460e5 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -1260,6 +1260,7 @@ mymain(void)
DO_TEST("cpu-check-default-none2", NONE);
DO_TEST("cpu-check-default-partial", NONE);
DO_TEST("cpu-check-default-partial2", NONE);
+ DO_TEST("vmcoreinfo", NONE);
DO_TEST("smartcard-host", NONE);
DO_TEST("smartcard-host-certificates", NONE);
--
2.15.0.rc0.40.gaefcc5f6f
7 years, 1 month
[libvirt] [PATCH 0/3] qemu: handle connect hangs in virDomainOpenChannel
by Nikolay Shirokovskiy
The problem is described in [1] in more details. From libvirt perspective we
have whole driver became unresponsive if connect to channel unix socket hangs
during virDomainOpenChannel. This series address this by first using job for
the API call and second by introducing connect timeout so that domain itself
don't became unresponsive indefinetily.
[1] http://lists.nongnu.org/archive/html/qemu-devel/2017-11/msg03013.html
Nikolay Shirokovskiy (3):
util: virFDStreamConnectUNIX: add missing error report
util: add 30s connection timeout to virFDStreamConnectUNIX
qemu: use job to keep driver responsive on qemuDomainOpenChannel
src/qemu/qemu_driver.c | 11 ++++++++++
src/util/virfdstream.c | 18 +++++++++++++++
src/util/virutil.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++
src/util/virutil.h | 2 ++
4 files changed, 90 insertions(+)
--
1.8.3.1
7 years, 1 month
[libvirt] [PATCH v2] storage: Resolve storage driver crash
by John Ferlan
Resolve a storage driver crash as a result of a long running
storageVolCreateXML when the virStorageVolPoolRefreshThread is
run as a result of when a storageVolUpload completed and ran the
virStoragePoolObjClearVols without checking if the creation
code was currently processing a buildVol after incrementing
the driver->asyncjob count.
The refreshThread will now check the pool asyncjob count before
attempting to pursue the pool refresh. Adjust the documentation
to describe the condition.
Crash from valgrind is as follows (with a bit of editing):
==21309== Invalid read of size 8
==21309== at 0x153E47AF: storageBackendUpdateVolTargetInfo
==21309== by 0x153E4C30: virStorageBackendUpdateVolInfo
==21309== by 0x153E52DE: virStorageBackendVolRefreshLocal
==21309== by 0x153DE29E: storageVolCreateXML
==21309== by 0x562035B: virStorageVolCreateXML
==21309== by 0x147366: remoteDispatchStorageVolCreateXML
...
==21309== Address 0x2590a720 is 64 bytes inside a block of size 336 free'd
==21309== at 0x4C2F2BB: free
==21309== by 0x54CB9FA: virFree
==21309== by 0x55BC800: virStorageVolDefFree
==21309== by 0x55BF1D8: virStoragePoolObjClearVols
==21309== by 0x153D967E: virStorageVolPoolRefreshThread
...
==21309== Block was alloc'd at
==21309== at 0x4C300A5: calloc
==21309== by 0x54CB483: virAlloc
==21309== by 0x55BDC1F: virStorageVolDefParseXML
==21309== by 0x55BDC1F: virStorageVolDefParseNode
==21309== by 0x55BE5A4: virStorageVolDefParse
==21309== by 0x153DDFF1: storageVolCreateXML
==21309== by 0x562035B: virStorageVolCreateXML
==21309== by 0x147366: remoteDispatchStorageVolCreateXML
...
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
v1: https://www.redhat.com/archives/libvir-list/2017-November/msg00198.html
Changes since v1:
- From review, remove the retry if Asyncjobs > 0 logic and replace with
a VIR_DEBUG indicating not doing refresh due to Asyncjob running and
just goto cleanup.
- Adjust the virStorageVolUpload docs to note that an attempt will be
made to refresh the pool.
- Drop patch 2 which added the Asyncjobs > 0 check to the SCSI pool
refresh thread. Since a SCSI pool doesn't support buildVol, the
asyncjob count cannot be anything other than zero, so it's pointless.
src/libvirt-storage.c | 3 ++-
src/storage/storage_driver.c | 7 +++++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/libvirt-storage.c b/src/libvirt-storage.c
index 9ab0fe28ea..e4646cb80f 100644
--- a/src/libvirt-storage.c
+++ b/src/libvirt-storage.c
@@ -1632,7 +1632,8 @@ virStorageVolDownload(virStorageVolPtr vol,
* another active stream is writing to the storage volume.
*
* When the data stream is closed whether the upload is successful
- * or not the target storage pool will be refreshed to reflect pool
+ * or not an attempt will be made to refresh the target storage pool
+ * if an asynchronous build is not running in order to reflect pool
* and volume changes as a result of the upload. Depending on
* the target volume storage backend and the source stream type
* for a successful upload, the target volume may take on the
diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
index 2b7a299706..d209f5afb8 100644
--- a/src/storage/storage_driver.c
+++ b/src/storage/storage_driver.c
@@ -2267,6 +2267,13 @@ virStorageVolPoolRefreshThread(void *opaque)
goto cleanup;
def = virStoragePoolObjGetDef(obj);
+ /* If some thread is building a new volume in the pool, then we cannot
+ * clear out all vols and refresh the pool. So we'll just pass. */
+ if (virStoragePoolObjGetAsyncjobs(obj) > 0) {
+ VIR_DEBUG("Asyncjob in process, cannot refresh storage pool");
+ goto cleanup;
+ }
+
if (!(backend = virStorageBackendForType(def->type)))
goto cleanup;
--
2.13.6
7 years, 1 month
[libvirt] [PATCH 0/2] Fix build with glibc-2.26 and clean up
by Martin Kletzander
Not pushed as build fix as glibc-2.26 is not that spread and the second
patch is not a build fix. Review should be trivial, so hopefully almost
no review bandwidth goes to waste ;)
Martin Kletzander (2):
build: Use XDR_CFLAGS in more places
tests: Remove pointless _CFLAGS variables
tests/Makefile.am | 28 +---------------------------
tools/Makefile.am | 2 +-
2 files changed, 2 insertions(+), 28 deletions(-)
--
2.15.0
7 years, 1 month