[libvirt] [PATCH] news: Mention new --precopy-bandwidth parameter for virsh migrate
by Jim Fehlig
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
docs/news.xml | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/docs/news.xml b/docs/news.xml
index c6580e4e72..990c84274d 100644
--- a/docs/news.xml
+++ b/docs/news.xml
@@ -65,6 +65,16 @@
</change>
</section>
<section title="Improvements">
+ <change>
+ <summary>
+ virsh: Support setting precopy bandwidth in migrate subcommand
+ </summary>
+ <description>
+ In addition to postcopy bandwidth, the virsh migrate subcommand
+ now supports specifying precopy bandwidth with the
+ <code>--precopy-bandwidth</code> parameter.
+ </description>
+ </change>
</section>
<section title="Bug fixes">
</section>
--
2.22.0
5 years, 2 months
[libvirt] [PATCH] docs: Make anchors follow HTML5
by Michal Privoznik
According to HTML specification, <a name=''> works in HTML4, but
<a id=''> works in both HTML4 and HTML5. This is followed even in
docs/page.xsl where HTML bookmark links are generated only for
those anchors which have @id attribute.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
For instance, ToC at the following page doesn't work:
https://libvirt.org/hvsupport.html
But after this patch the links are generated properly.
docs/api_extension.html.in | 12 ++++++------
docs/dbus.html.in | 6 +++---
docs/devhelp/html.xsl | 16 ++++++++--------
docs/genaclperms.pl | 4 ++--
docs/hvsupport.pl | 2 +-
docs/newapi.xsl | 6 +++---
6 files changed, 23 insertions(+), 23 deletions(-)
diff --git a/docs/api_extension.html.in b/docs/api_extension.html.in
index 604c397c84..79e7913c1a 100644
--- a/docs/api_extension.html.in
+++ b/docs/api_extension.html.in
@@ -89,7 +89,7 @@
separately.
</p>
- <h2><a name='publicapi'>Defining the public API</a></h2>
+ <h2><a id='publicapi'>Defining the public API</a></h2>
<p>The first task is to define the public API. If the new API
involves an XML extension, you have to enhance the RelaxNG
@@ -119,7 +119,7 @@
rework it as you go through the process of implementing it.
</p>
- <h2><a name='internalapi'>Defining the internal API</a></h2>
+ <h2><a id='internalapi'>Defining the internal API</a></h2>
<p>
Each public API call is associated with a driver, such as a host
@@ -146,7 +146,7 @@
provide a <code>NULL</code> stub for the new function.
</p>
- <h2><a name='implpublic'>Implementing the public API</a></h2>
+ <h2><a id='implpublic'>Implementing the public API</a></h2>
<p>
Implementing the public API is largely a formality in which we wire up
@@ -179,7 +179,7 @@
<p><code>src/libvirt-$MODULE.c</code></p>
- <h2><a name='remoteproto'>Implementing the remote protocol</a></h2>
+ <h2><a id='remoteproto'>Implementing the remote protocol</a></h2>
<p>
Implementing the remote protocol is essentially a
@@ -187,7 +187,7 @@
understood by referring to the existing code.
</p>
- <h3><a name='wireproto'>Defining the wire protocol format</a></h3>
+ <h3><a id='wireproto'>Defining the wire protocol format</a></h3>
<p>
Defining the wire protocol involves making additions to:
@@ -226,7 +226,7 @@
src/remote/remote_protocol.h
</code></p>
- <h3><a name='rpcclient'>Implement the RPC client</a></h3>
+ <h3><a id='rpcclient'>Implement the RPC client</a></h3>
<p>
Implementing the RPC client uses the rpcgen generated .h files.
diff --git a/docs/dbus.html.in b/docs/dbus.html.in
index 6ff71d2770..4dfe4ca427 100644
--- a/docs/dbus.html.in
+++ b/docs/dbus.html.in
@@ -6,14 +6,14 @@
<ul id="toc"></ul>
- <h2><a name="description">Description</a></h2>
+ <h2><a id="description">Description</a></h2>
<p>
libvirt-dbus wraps libvirt API to provide a high-level object-oriented
API better suited for dbus-based applications.
</p>
- <h2><a name="git">GIT source repository</a></h2>
+ <h2><a id="git">GIT source repository</a></h2>
<p>
The D-Bus bindings source code is maintained in a
<a href="https://git-scm.com/">git</a> repository available on
@@ -32,7 +32,7 @@ git clone https://libvirt.org/git/libvirt-dbus.git
<a href="https://libvirt.org/git/?p=libvirt-dbus.git">https://libvirt.org/git/?p=libvirt-dbus.git</a>
</pre>
- <h2><a name="usage">Usage</a></h2>
+ <h2><a id="usage">Usage</a></h2>
<p>
libvirt-dbus exports libvirt API using D-Bus objects with methods and
diff --git a/docs/devhelp/html.xsl b/docs/devhelp/html.xsl
index 9cdc049150..587cbfc1a9 100644
--- a/docs/devhelp/html.xsl
+++ b/docs/devhelp/html.xsl
@@ -173,7 +173,7 @@
<xsl:template mode="details" match="struct">
<xsl:variable name="name" select="string(@name)"/>
<div class="refsect2" lang="en">
- <h3><a name="{$name}">Structure </a><xsl:value-of select="$name"/></h3>
+ <h3><a id="{$name}">Structure </a><xsl:value-of select="$name"/></h3>
<pre class="programlisting">
<xsl:value-of select="@type"/><xsl:text> {
</xsl:text>
@@ -214,7 +214,7 @@
<xsl:template mode="details" match="typedef[@type != 'enum']">
<xsl:variable name="name" select="string(@name)"/>
<div class="refsect2" lang="en">
- <h3><a name="{$name}">Typedef </a><xsl:value-of select="$name"/></h3>
+ <h3><a id="{$name}">Typedef </a><xsl:value-of select="$name"/></h3>
<pre class="programlisting">
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="string(@type)"/>
@@ -236,7 +236,7 @@
<xsl:template mode="details" match="variable">
<xsl:variable name="name" select="string(@name)"/>
<div class="refsect2" lang="en">
- <h3><a name="{$name}">Variable </a><xsl:value-of select="$name"/></h3>
+ <h3><a id="{$name}">Variable </a><xsl:value-of select="$name"/></h3>
<pre class="programlisting">
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="string(@type)"/>
@@ -258,7 +258,7 @@
<xsl:template mode="details" match="typedef[@type = 'enum']">
<xsl:variable name="name" select="string(@name)"/>
<div class="refsect2" lang="en">
- <h3><a name="{$name}">Enum </a><xsl:value-of select="$name"/></h3>
+ <h3><a id="{$name}">Enum </a><xsl:value-of select="$name"/></h3>
<pre class="programlisting">
<xsl:text>enum </xsl:text>
<a href="#{$name}"><xsl:value-of select="$name"/></a>
@@ -267,7 +267,7 @@
<xsl:for-each select="/api/symbols/enum[@type=$name]">
<xsl:sort select="@value" data-type="number" order="ascending"/>
<xsl:text> </xsl:text>
- <a name="{@name}"><xsl:value-of select="@name"/></a>
+ <a id="{@name}"><xsl:value-of select="@name"/></a>
<xsl:if test="@value">
<xsl:text> = </xsl:text>
<xsl:value-of select="@value"/>
@@ -295,7 +295,7 @@
<xsl:template mode="details" match="macro">
<xsl:variable name="name" select="string(@name)"/>
<div class="refsect2" lang="en">
- <h3><a name="{$name}">Macro </a><xsl:value-of select="$name"/></h3>
+ <h3><a id="{$name}">Macro </a><xsl:value-of select="$name"/></h3>
<pre class="programlisting">
<xsl:text>#define </xsl:text>
<a href="#{$name}"><xsl:value-of select="$name"/></a>
@@ -342,7 +342,7 @@
<xsl:variable name="tlen" select="string-length(return/@type)"/>
<xsl:variable name="blen" select="(($nlen + 8) - (($nlen + 8) mod 8)) + (($tlen + 8) - (($tlen + 8) mod 8))"/>
<div class="refsect2" lang="en">
- <h3><a name="{$name}"></a><xsl:value-of select="$name"/> ()</h3>
+ <h3><a id="{$name}"></a><xsl:value-of select="$name"/> ()</h3>
<pre class="programlisting">
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="return/@type"/>
@@ -419,7 +419,7 @@
<xsl:variable name="tlen" select="string-length(return/@type)"/>
<xsl:variable name="blen" select="(($nlen + 8) - (($nlen + 8) mod 8)) + (($tlen + 8) - (($tlen + 8) mod 8))"/>
<div class="refsect2" lang="en">
- <h3><a name="{$name}"></a>Function type <xsl:value-of select="$name"/> </h3>
+ <h3><a id="{$name}"></a>Function type <xsl:value-of select="$name"/> </h3>
<pre class="programlisting">
<xsl:call-template name="dumptext">
<xsl:with-param name="text" select="return/@type"/>
diff --git a/docs/genaclperms.pl b/docs/genaclperms.pl
index 34c526021c..e20b4c11c3 100755
--- a/docs/genaclperms.pl
+++ b/docs/genaclperms.pl
@@ -84,7 +84,7 @@ foreach my $object (sort { $a cmp $b } keys %perms) {
my $class = $class{$object};
my $olink = lc "object_" . $object;
print <<EOF;
-<h3><a name="$olink">$class</a></h3>
+<h3><a id="$olink">$class</a></h3>
<table class="acl">
<thead>
<tr>
@@ -106,7 +106,7 @@ EOF
print <<EOF;
<tr>
- <td><a name="$plink">$perm</a></td>
+ <td><a id="$plink">$perm</a></td>
<td>$description</td>
</tr>
EOF
diff --git a/docs/hvsupport.pl b/docs/hvsupport.pl
index 4f4d86fbf1..494b8a27ec 100755
--- a/docs/hvsupport.pl
+++ b/docs/hvsupport.pl
@@ -364,7 +364,7 @@ when it was removed is also mentioned (highlighted in
EOF
foreach my $grp (sort { $a cmp $b } keys %groups) {
- print "<h2><a name=\"$grp\">", $groupheaders{$grp}, "</a></h2>\n";
+ print "<h2><a id=\"$grp\">", $groupheaders{$grp}, "</a></h2>\n";
print <<EOF;
<table class="top_table">
<thead>
diff --git a/docs/newapi.xsl b/docs/newapi.xsl
index 4c7b241659..ca8c703d5c 100644
--- a/docs/newapi.xsl
+++ b/docs/newapi.xsl
@@ -258,7 +258,7 @@
</xsl:call-template>
</span>
<xsl:text> </xsl:text>
- <a name="{@name}"></a>
+ <a id="{@name}"></a>
<xsl:value-of select="@name"/>
<xsl:text>
</xsl:text>
@@ -281,7 +281,7 @@
</xsl:call-template>
</span>
<xsl:text> </xsl:text>
- <a name="{$name}"><xsl:value-of select="$name"/></a>
+ <a id="{$name}"><xsl:value-of select="$name"/></a>
<xsl:text>
</xsl:text>
</xsl:otherwise>
@@ -320,7 +320,7 @@
<xsl:for-each select="/api/symbols/enum[@type = $name]">
<xsl:sort select="@value" data-type="number" order="ascending"/>
<tr>
- <td><a name="{@name}"><xsl:value-of select="@name"/></a></td>
+ <td><a id="{@name}"><xsl:value-of select="@name"/></a></td>
<td><xsl:text> = </xsl:text></td>
<xsl:choose>
<xsl:when test="@info != ''">
--
2.21.0
5 years, 2 months
[libvirt] [PATCH 0/6] support boot from vfio-ccw mdev devices
by Bjoern Walk
v2 -> v3:
* use real QEMU capabilities data for tests
Boris Fiuczynski (6):
tests: add vfio-ap mdev tests
tests: add vhost scsi hostdev boot unsupported test
qemu: move hostdev boot validation into domain validation
qemu: make error messages device specific
qemu: refactor mdev validation method signatures
qemu: support bootindex on vfio-ccw mdev devices
src/qemu/qemu_command.c | 16 ++----
src/qemu/qemu_domain.c | 53 ++++++++++++++-----
.../hostdev-scsi-vhost-scsi-pci-boot-fail.xml | 41 ++++++++++++++
.../hostdev-subsys-mdev-vfio-ap-boot-fail.xml | 23 ++++++++
.../hostdev-subsys-mdev-vfio-ap.args | 28 ++++++++++
...tdev-subsys-mdev-vfio-ap.s390x-latest.args | 33 ++++++++++++
.../hostdev-subsys-mdev-vfio-ap.xml | 22 ++++++++
...ubsys-mdev-vfio-ccw-boot.s390x-latest.args | 34 ++++++++++++
.../hostdev-subsys-mdev-vfio-ccw-boot.xml | 23 ++++++++
tests/qemuxml2argvtest.c | 8 +++
.../hostdev-subsys-mdev-vfio-ap.xml | 27 ++++++++++
...subsys-mdev-vfio-ccw-boot.s390x-latest.xml | 29 ++++++++++
tests/qemuxml2xmltest.c | 6 +++
13 files changed, 319 insertions(+), 24 deletions(-)
create mode 100644 tests/qemuxml2argvdata/hostdev-scsi-vhost-scsi-pci-boot-fail.xml
create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ap-boot-fail.xml
create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ap.args
create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ap.s390x-latest.args
create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ap.xml
create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-boot.s390x-latest.args
create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-boot.xml
create mode 100644 tests/qemuxml2xmloutdata/hostdev-subsys-mdev-vfio-ap.xml
create mode 100644 tests/qemuxml2xmloutdata/hostdev-subsys-mdev-vfio-ccw-boot.s390x-latest.xml
--
2.21.0
5 years, 2 months
[libvirt] [PATCH v2 2/4] audio: omitting audiodev= parameter is only deprecated
by Kővágó, Zoltán
Unfortunately, changes introduced in af2041ed2d "audio: audiodev=
parameters no longer optional when -audiodev present" breaks backward
compatibility. This patch changes the error into a deprecation warning.
Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu(a)gmail.com>
---
qemu-deprecated.texi | 7 +++++++
audio/audio.c | 8 ++++----
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi
index 00a4b6f350..9d74a1cfc0 100644
--- a/qemu-deprecated.texi
+++ b/qemu-deprecated.texi
@@ -72,6 +72,13 @@ backend settings instead of environment variables. To ease migration to
the new format, the ``-audiodev-help'' option can be used to convert
the current values of the environment variables to ``-audiodev'' options.
+@subsection Creating sound card devices and vnc without audiodev= property (since 4.2)
+
+When not using the deprecated legacy audio config, each sound card
+should specify an @code{audiodev=} property. Additionally, when using
+vnc, you should specify an @code{audiodev=} propery if you plan to
+transmit audio through the VNC protocol.
+
@subsection -mon ...,control=readline,pretty=on|off (since 4.1)
The @code{pretty=on|off} switch has no effect for HMP monitors, but is
diff --git a/audio/audio.c b/audio/audio.c
index ae335dbebb..e99fcd0694 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -1412,8 +1412,9 @@ static AudioState *audio_init(Audiodev *dev, const char *name)
drvname = AudiodevDriver_str(dev->driver);
} else if (!QTAILQ_EMPTY(&audio_states)) {
if (!legacy_config) {
- dolog("You must specify an audiodev= for the device %s\n", name);
- exit(1);
+ dolog("Device %s: audiodev default parameter is deprecated, please "
+ "specify audiodev=%s\n", name,
+ QTAILQ_FIRST(&audio_states)->dev->id);
}
return QTAILQ_FIRST(&audio_states);
} else {
@@ -1548,8 +1549,7 @@ CaptureVoiceOut *AUD_add_capture(
if (!s) {
if (!legacy_config) {
- dolog("You must specify audiodev when trying to capture\n");
- return NULL;
+ dolog("Capturing without setting an audiodev is deprecated\n");
}
s = audio_init(NULL, NULL);
}
--
2.22.0
5 years, 2 months
Re: [libvirt] [BUG] When PLUG a bridge interface to an active VM, the generated LIVE and CONFIG mac address are different
by wujing (O)
> >>> On 8/22/19 10:43 AM, Xu Yandong (Yandong Xu) wrote:
> >> That possibly might be out of scope, but autofilling the mac address
> >> as early as virDomainNetDefParseXML also is not ideal.
> >
> > We have pushed a patch bellow that can restore the situation to an older
> state.
> >
> > Subject: [PATCH] qemu: use the same def when attaching device live and
> > config
> >
> > diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index
> > 617d7d5..eca54d0 100644
> > --- a/src/qemu/qemu_driver.c
> > +++ b/src/qemu/qemu_driver.c
> > @@ -8615,6 +8615,22 @@
> qemuDomainAttachDeviceLiveAndConfig(virDomainObjPtr vm,
> > if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
> > goto cleanup;
> >
> > + if (flags & VIR_DOMAIN_AFFECT_CONFIG &&
> > + flags & VIR_DOMAIN_AFFECT_LIVE) {
> > + /* If we are affecting both CONFIG and LIVE
> > + * use the same xml of device preferentially
> > + * to make the configuration consistent.
> > + */
> > + devLive = virDomainDeviceDefParse(xml, vm->def,
>
> This use of vm->def prefers live XML. This means that for instance PCI
> address are assigned based on current PCI layout in live XML which in general
> is different to inactive XML.
>
> And it's not only PCI addresses, we autogenerate some out aspects of
> <interface/> (e.g. model) and even more for other devices. Just take a look
> at qemuDomainDeviceDefPostParse(). All functions there which take domain
> def as an argument do so because they are basing autogenerated value on
> domain definition. Plus there's more in parser code.
>
> While your patch might work for your use case, it can break others.
>
> BTW: have you read the original commit that caused this? I'm failing to see
> how we would not re-introduce the problem with your patch. If you're using
> live XML to validate/generate device addresses, how can we generate valid
> address for inactive XML?
>
This patch is a little different with the original commit, since we only prefer live XML
when using LIVE AND CONFIG flags at the same time. Still parse separate device def if attach with only one flag.
So this patch is kinda a combination of 1e0534a7702 and 55ce6564634, just to narrow down the problem influence.
And I verified as the steps in https://bugzilla.redhat.com/show_bug.cgi?id=1559867, work as expected.
Wu Jing
5 years, 2 months
[libvirt] [PATCH] Generate status of the backend implementation in storage.html
by Cedric Bosdonnat
Since it helps a user to know which of the storage backends support what
operation, include an autogenerated matrix showing it in the docs.
---
.gitignore | 1 +
docs/Makefile.am | 9 +++--
docs/apibuild.py | 2 ++
docs/storage.html.in | 14 ++++++++
docs/storagebackendstatus.py | 64 ++++++++++++++++++++++++++++++++++++
5 files changed, 88 insertions(+), 2 deletions(-)
create mode 100644 docs/storagebackendstatus.py
diff --git a/.gitignore b/.gitignore
index 82495e8692..06875abebd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -58,6 +58,7 @@
/configure.lineno
/conftest.*
/docs/aclperms.htmlinc
+/docs/storagebackendstatus.htmlinc
/docs/apibuild.py.stamp
/docs/devhelp/libvirt.devhelp
/docs/hvsupport.html.in
diff --git a/docs/Makefile.am b/docs/Makefile.am
index 1cdb584b0b..526821b1d3 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -195,6 +195,7 @@ EXTRA_DIST= \
$(kbase_html_in) $(kbase_html) \
aclperms.htmlinc \
hvsupport.pl \
+ storagebackendstatus.py \
$(schema_DATA)
acl_generated = aclperms.htmlinc
@@ -209,7 +210,8 @@ MAINTAINERCLEANFILES = \
$(addprefix $(srcdir)/,$(devhelphtml)) \
$(addprefix $(srcdir)/,$(internals_html)) \
$(addprefix $(srcdir)/,$(kbase_html)) \
- $(srcdir)/hvsupport.html.in $(srcdir)/aclperms.htmlinc
+ $(srcdir)/hvsupport.html.in $(srcdir)/aclperms.htmlinc \
+ $(srcdir)/storagebackendstatus.htmlinc
timestamp="$(shell if test -n "$$SOURCE_DATE_EPOCH"; \
then \
@@ -230,6 +232,9 @@ web: $(dot_html) $(internals_html) $(kbase_html) \
hvsupport.html: $(srcdir)/hvsupport.html.in
+storagebackendstatus.htmlinc: $(srcdir)/storagebackendstatus.py
+ $(PYTHON) $< >$@
+
$(srcdir)/hvsupport.html.in: $(srcdir)/hvsupport.pl $(api_DATA) \
$(top_srcdir)/src/libvirt_public.syms \
$(top_srcdir)/src/libvirt_qemu.syms $(top_srcdir)/src/libvirt_lxc.syms \
@@ -256,7 +261,7 @@ MAINTAINERCLEANFILES += \
convert -rotate 90 $< $@
%.html.tmp: %.html.in site.xsl subsite.xsl page.xsl \
- $(acl_generated)
+ $(acl_generated) storagebackendstatus.htmlinc
$(AM_V_GEN)name=`echo $@ | sed -e 's/.tmp//'`; \
dir=`dirname $@` ; \
if test "$$dir" = "."; \
diff --git a/docs/apibuild.py b/docs/apibuild.py
index dbdc1c95af..31944b8176 100755
--- a/docs/apibuild.py
+++ b/docs/apibuild.py
@@ -2010,6 +2010,8 @@ class docBuilder:
self.includes = includes + list(lxc_included_files.keys())
elif name == "libvirt-admin":
self.includes = includes + list(admin_included_files.keys())
+ else:
+ self.includes = includes
self.modules = {}
self.headers = {}
self.idx = index()
diff --git a/docs/storage.html.in b/docs/storage.html.in
index e0e4edec1e..2e4f662222 100644
--- a/docs/storage.html.in
+++ b/docs/storage.html.in
@@ -826,5 +826,19 @@
<h3>Valid volume format types</h3>
<p>The valid volume types are the same as for the directory pool.</p>
+
+ <h2>Storage Pool Types implementation status</h2>
+
+ <p>
+ The storage backends have different level of support of the various pool and volume actions.
+ Here is a matrix of the current support for each of them.
+ </p>
+
+ <p>
+ <strong>Note:</strong> some functions like Start and Stop will not trigger an exception when
+ called on a backend that doesn't implement them.
+ </p>
+
+ <div id="include" filename="storagebackendstatus.htmlinc"/>
</body>
</html>
diff --git a/docs/storagebackendstatus.py b/docs/storagebackendstatus.py
new file mode 100644
index 0000000000..d105fea626
--- /dev/null
+++ b/docs/storagebackendstatus.py
@@ -0,0 +1,64 @@
+import os
+import os.path
+import re
+
+srcdir = os.path.abspath((os.environ.get("srcdir", os.path.join("..", "src"))))
+
+def get_allowed_functions():
+ functions = []
+ with open(os.path.join(srcdir, 'storage', 'storage_backend.h'), 'r') as handle:
+ content = ''.join(handle.readlines())
+ definition = re.search('struct _virStorageBackend {([^}]+)}', content)
+ if definition is not None:
+ functions = re.findall('virStorageBackend[^ ]+ ([^;]+)', definition.group(1))
+ return functions
+
+class Backend:
+ def __init__(self, name, code):
+ self.name = name
+ self.functions = [member[1:] for member in re.findall('.([^ ]+) = ', code) if member != '.type']
+
+def get_backends():
+ backends = []
+ for root, dirs, files in os.walk(os.path.join(srcdir, 'storage')):
+ storage_impls = [os.path.join(root, f) for f in files if re.match('storage_backend_[^.]+.c', f)]
+ for impl in storage_impls:
+ handle = open(impl, 'r')
+ content = ''.join(handle.readlines())
+ handle.close()
+ chunks = re.findall('virStorageBackend virStorageBackend([^ ]+) = {([^}]*)}', content)
+ backends.extend([Backend(chunk[0], chunk[1]) for chunk in chunks])
+ return backends
+
+def main():
+ functions = get_allowed_functions()
+ backends = get_backends()
+
+ headers = '\n'.join(['<th>%s</th>' % backend.name for backend in backends])
+ rows = []
+ for func in functions:
+ cell_template = '<td style="text-align: center">%s</td>'
+ support = [cell_template % ('✔' if func in backend.functions else '') for backend in backends]
+ rows.append('\n'.join(['<tr>', '<td>%s</td>' % func] + support + ['</tr>']))
+
+ print('''<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<body>
+<table class='top_table'>
+<thead>
+<tr>
+<th>
+</th>
+%s
+</tr>
+</thead>
+<tbody>
+%s
+</tbody>
+</table>
+</body>
+</html>''' % (headers, '\n'.join(rows)))
+
+if __name__ == '__main__':
+ main()
--
2.22.0
5 years, 2 months
[libvirt] [BUG] When PLUG a bridge interface to an active VM, the generated LIVE and CONFIG mac address are different
by Xu Yandong (Yandong Xu)
Hi,
When plug a bridge interface to an active VM with both LIVE AND CONFIG flags,
libvirt generate different mac address to LIVE and CONFIG instance, so After
I reboot the VM, DHCP server doesn't assign the same IP address to the new
bridge interface.
Steps:
1. Having running VM
## virsh list
Id Name State
-------------------------------
1 centos_7.6_64 running
2. Prepare a bridge interface xml
## cat interface.xml
<interface type='bridge'>
<source bridge='br0-int'/>
<virtualport type='openvswitch'>
</virtualport>
<model type='virtio'/>
<target dev='ovsvnet4'/>
</interface>
3. Plug interface with --live and --config
##virsh attach-device centos_7.6_64 interface.xml --config --live
Device attached successfully
4. Check LIVE XML
## cat /var/run/libvirt/qemu/centos_7.6_64.xml | grep ovsvnet4 -A 4 -B 6
<interface type='bridge'>
<mac address='52:54:00:23:7d:fb'/>
<source bridge='br0-int'/>
<virtualport type='openvswitch'>
<parameters interfaceid='c9f07f2b-3888-4f25-bd80-f5ba04d07bf8'/>
</virtualport>
<target dev='ovsvnet4'/>
<model type='virtio'/>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
</interface>
5. Check Config XML
## cat /etc/libvirt/qemu/centos_7.6_64.xml | grep ovsvnet4 -A 3 -B 6
<interface type='bridge'>
<mac address='52:54:00:bb:d4:53'/>
<source bridge='br0-int'/>
<virtualport type='openvswitch'>
<parameters interfaceid='189234ea-878e-4e8a-9f63-f43fac50aebd'/>
</virtualport>
<target dev='ovsvnet4'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
</interface>
The mac address and virtualport interfaceid does not match in LIVE and CONFIG XML.
This phenomenon was introduced by the commit:
commit 55ce65646348884656fd7bf3f109ebf8f7603494
Author: John Ferlan <jferlan(a)redhat.com>
Date: Tue Jun 12 08:44:21 2018 -0400
qemu: Use the correct vm def on cold attach
https://bugzilla.redhat.com/show_bug.cgi?id=1559867
When attaching a device to the domain we need to be sure
to use the correct domain definition (vm->def or vm->newDef)
when calling virDomainDeviceDefParse because the post parse
processing algorithms that may assign an address for the
device will use whatever domain definition was passed in.
5 years, 2 months
[libvirt] [PATCH 0/4] remote: Enforce RPC limits when encoding typed params
by Michal Privoznik
Couple of bug fixes here.
Michal Prívozník (4):
remote_daemon_dispatch: Check for limit properly in
remoteDispatchConnectGetAllDomainStats
remote: Check for limits when encoding typed params
remote_daemon_dispatch: Don't leak @ret on failure
remote_daemon_dispatch: Don't open code xdr_free()
src/admin/admin_remote.c | 2 +
src/admin/admin_server_dispatch.c | 27 ++--------
src/remote/remote_daemon_dispatch.c | 81 ++++++++++++-----------------
src/remote/remote_driver.c | 48 +++--------------
src/rpc/gendispatch.pl | 2 +
src/util/virtypedparam.c | 13 ++++-
src/util/virtypedparam.h | 1 +
7 files changed, 59 insertions(+), 115 deletions(-)
--
2.21.0
5 years, 3 months
[libvirt] [jenkins-ci PATCH v2] guests: Introduce a var to enable shallow git clones for projects
by Erik Skultety
First of all, we don't need the full history for builds and we can save
some time during the prepare phase. The disk footprint is about 5x
smaller, but the most important thing is the repo clone duration
difference e.g. in libvirt's case is quite significant:
full history:
real 3m45.236s
user 1m53.074s
sys 0m15.577s
depth 1:
real 0m14.868s
user 0m2.215s
sys 0m0.906s
Since jenkins has a local copy and doesn't clone from the internet, this
patch modifies only the configs for local VMs.
---
guests/group_vars/all/main.yml | 2 ++
guests/playbooks/build/jobs/prepare.yml | 1 +
2 files changed, 3 insertions(+)
diff --git a/guests/group_vars/all/main.yml b/guests/group_vars/all/main.yml
index b73795e..6efcb52 100644
--- a/guests/group_vars/all/main.yml
+++ b/guests/group_vars/all/main.yml
@@ -5,3 +5,5 @@
ansible_ssh_pass: root
jenkins_url: https://ci.centos.org/computer/{{ inventory_hostname }}/slave-agent.jnlp
+
+git_shallow_clone: true
diff --git a/guests/playbooks/build/jobs/prepare.yml b/guests/playbooks/build/jobs/prepare.yml
index 576afbc..477c169 100644
--- a/guests/playbooks/build/jobs/prepare.yml
+++ b/guests/playbooks/build/jobs/prepare.yml
@@ -5,6 +5,7 @@
version: '{{ git_branch }}'
dest: '{{ name }}'
force: yes
+ depth: '{{ git_shallow_clone | ternary(1, omit) }}'
when:
- inventory_hostname in machines
--
2.20.1
5 years, 3 months
[libvirt] [PATCH v2 0/6] support boot from vfio-ccw mdev devices
by Boris Fiuczynski
Changes in v2:
1. moved refactoring into separate patch
2. removed line misalignment
3. moved valition from command line generator into domain xml validation
4. added tests for vfio-ap and vhost scsi
Boris Fiuczynski (6):
tests: add vfio-ap mdev tests
tests: add vhost scsi hostdev boot unsupported test
qemu: move hostdev boot validation into domain validation
qemu: make error messages device specific
qemu: refactor mdev validation method signatures
qemu: support bootindex on vfio-ccw mdev devices
src/qemu/qemu_command.c | 17 ++----
src/qemu/qemu_domain.c | 53 ++++++++++++++-----
.../hostdev-scsi-vhost-scsi-pci-boot-fail.xml | 41 ++++++++++++++
.../hostdev-subsys-mdev-vfio-ap-boot-fail.xml | 23 ++++++++
.../hostdev-subsys-mdev-vfio-ap.args | 28 ++++++++++
.../hostdev-subsys-mdev-vfio-ap.xml | 22 ++++++++
.../hostdev-subsys-mdev-vfio-ccw-boot.args | 29 ++++++++++
.../hostdev-subsys-mdev-vfio-ccw-boot.xml | 23 ++++++++
tests/qemuxml2argvtest.c | 16 ++++++
.../hostdev-subsys-mdev-vfio-ap.xml | 27 ++++++++++
.../hostdev-subsys-mdev-vfio-ccw-boot.xml | 28 ++++++++++
tests/qemuxml2xmltest.c | 8 +++
12 files changed, 291 insertions(+), 24 deletions(-)
create mode 100644 tests/qemuxml2argvdata/hostdev-scsi-vhost-scsi-pci-boot-fail.xml
create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ap-boot-fail.xml
create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ap.args
create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ap.xml
create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-boot.args
create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-boot.xml
create mode 100644 tests/qemuxml2xmloutdata/hostdev-subsys-mdev-vfio-ap.xml
create mode 100644 tests/qemuxml2xmloutdata/hostdev-subsys-mdev-vfio-ccw-boot.xml
--
2.17.0
5 years, 3 months