[libvirt] [PATCH] test_driver: Fix permissions for test_driver.c
by Ján Tomko
From: Andrea Bolognani <abologna(a)redhat.com>
Introduced in commit 4a6ee53581b3.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
(cherry picked from commit df1b5cf02efd4fee6f01ebe69fd0f1fd24b3947d)
Reintroduced-by: fb275b76734ba1c0b18ad1088e3c82fb01961903
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
src/test/test_driver.c | 0
1 file changed, 0 insertions(+), 0 deletions(-)
mode change 100755 => 100644 src/test/test_driver.c
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
old mode 100755
new mode 100644
--
2.20.1
5 years, 4 months
[libvirt] [PATCH] remote_daemon_dispatch.c: typecast ARRAY_CARDINALITY() in remoteDispatchProbeURI()
by Michal Privoznik
Since users can enable/disable drivers at compile time, it may
happen that @drivers array is in fact empty (in both its
occurrences within the function). This means that
ARRAY_CARDINALITY() returns 0UL which makes gcc unhappy because
of loop condition:
i < ARRAY_CARDINALITY(drivers)
GCC complains that @i is unsigned and comparing an unsigned value
against 0 is always false. However, changing the type of @i to
ssize_t is not enough, because compiler still sees the unsigned
zero. The solution is to typecast the ARRAY_CARDINALITY().
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/remote/remote_daemon_dispatch.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/remote/remote_daemon_dispatch.c b/src/remote/remote_daemon_dispatch.c
index c8e353ebd3..1bd281dd6d 100644
--- a/src/remote/remote_daemon_dispatch.c
+++ b/src/remote/remote_daemon_dispatch.c
@@ -2141,9 +2141,9 @@ remoteDispatchProbeURI(bool readonly,
"vbox",
# endif
};
- size_t i;
+ ssize_t i;
- for (i = 0; i < ARRAY_CARDINALITY(drivers) && !*probeduri; i++) {
+ for (i = 0; i < (ssize_t) ARRAY_CARDINALITY(drivers) && !*probeduri; i++) {
VIR_AUTOFREE(char *) daemonname = NULL;
VIR_AUTOFREE(char *) daemonpath = NULL;
@@ -2187,9 +2187,9 @@ remoteDispatchProbeURI(bool readonly,
"vz",
# endif
};
- size_t i;
+ ssize_t i;
- for (i = 0; i < ARRAY_CARDINALITY(drivers) && !*probeduri; i++) {
+ for (i = 0; i < (ssize_t) ARRAY_CARDINALITY(drivers) && !*probeduri; i++) {
VIR_AUTOFREE(char *) sockname = NULL;
if (virAsprintf(&sockname, "%s/run/libvirt/virt%sd-%s",
--
2.21.0
5 years, 4 months
[libvirt] [PATCH 0/6] qemu: Allow suppressing some errors in qemu bulk stats code
by Peter Krempa
There is an bugreport [1] that some Openstack deployments get periodic
errors in the log. This is most probably from the bulk stats code which
in some cases calls into the storage backends to update some aspects of
storage volumes. Since none of the errors are fatal add code to allow
skipping them.
[1] https://bugzilla.redhat.com/show_bug.cgi?id=1724808
Peter Krempa (6):
util: Export virStorageFileSupportsBackingChainTraversal
qemu: Allow skipping some errors in qemuDomainStorageOpenStat
util: storagefile: Don't report errors from
virStorageSourceUpdatePhysicalSize
qemu: driver: Improve error suppression in
qemuDomainStorageUpdatePhysical
qemu: Allow suppressing errors from qemuStorageLimitsRefresh
qemu: Don't report some ignored errors in
qemuDomainGetStatsOneBlockFallback
src/libvirt_private.syms | 1 +
src/qemu/qemu_driver.c | 60 ++++++++++++++++++++++++++++-----------
src/util/virstoragefile.c | 16 +++--------
src/util/virstoragefile.h | 1 +
4 files changed, 50 insertions(+), 28 deletions(-)
--
2.21.0
5 years, 4 months
[libvirt] [PATCH 0/2] Fix the latest virpcitest failure
by Michal Privoznik
See 2/2 for explanation.
Michal Prívozník (2):
ci: Allow gdb in containers
virpcimock: Mock __open_2()
Makefile.ci | 1 +
tests/virpcimock.c | 29 +++++++++++++++++++++++++++++
2 files changed, 30 insertions(+)
--
2.21.0
5 years, 4 months
[libvirt] [PATCH] test_driver: implement virConnectCompareCPU
by Ilias Stamatis
Signed-off-by: Ilias Stamatis <stamatis.iliass(a)gmail.com>
---
Probably we need to extend the host CPU's capabilities as well along
with this patch. Currently virCPUx86Compare reports "unknown host CPU".
src/test/test_driver.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index c39eef2d4b..b1037f4eab 100755
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -1529,6 +1529,26 @@ static int testConnectGetMaxVcpus(virConnectPtr conn ATTRIBUTE_UNUSED,
return 32;
}
+
+static int
+testConnectCompareCPU(virConnectPtr conn,
+ const char *xmlDesc,
+ unsigned int flags)
+{
+ testDriverPtr privconn = conn->privateData;
+ bool failIncompatible = !!(flags & VIR_CONNECT_COMPARE_CPU_FAIL_INCOMPATIBLE);
+ int ret = VIR_CPU_COMPARE_ERROR;
+
+ virCheckFlags(VIR_CONNECT_COMPARE_CPU_FAIL_INCOMPATIBLE,
+ VIR_CPU_COMPARE_ERROR);
+
+ ret = virCPUCompareXML(privconn->caps->host.arch, privconn->caps->host.cpu,
+ xmlDesc, failIncompatible);
+
+ return ret;
+}
+
+
static char *
testConnectBaselineCPU(virConnectPtr conn ATTRIBUTE_UNUSED,
const char **xmlCPUs,
@@ -9510,6 +9530,7 @@ static virHypervisorDriver testHypervisorDriver = {
.domainRevertToSnapshot = testDomainRevertToSnapshot, /* 1.1.4 */
.domainSnapshotDelete = testDomainSnapshotDelete, /* 1.1.4 */
+ .connectCompareCPU = testConnectCompareCPU, /* 5.7.0 */
.connectBaselineCPU = testConnectBaselineCPU, /* 1.2.0 */
.domainCheckpointCreateXML = testDomainCheckpointCreateXML, /* 5.6.0 */
.domainCheckpointGetXMLDesc = testDomainCheckpointGetXMLDesc, /* 5.6.0 */
--
2.22.0
5 years, 4 months
[libvirt] [PATCH] docs: Make anchors in API html files clickable/linkable
by Peter Krempa
Use 'id' instead of 'name' for anchors which adds the hidden clickable
headerlink helper so it's way simpler to link to a specific part of the
docs.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
docs/newapi.xsl | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/docs/newapi.xsl b/docs/newapi.xsl
index c808fe5ff8..f9cbcb6323 100644
--- a/docs/newapi.xsl
+++ b/docs/newapi.xsl
@@ -308,7 +308,7 @@
<xsl:template match="typedef[@type = 'enum']">
<xsl:variable name="name" select="string(@name)"/>
- <h3><a name="{$name}"><code><xsl:value-of select="$name"/></code></a></h3>
+ <h3><a id="{$name}"><code><xsl:value-of select="$name"/></code></a></h3>
<div class="api">
<pre>
<span class="keyword">enum</span><xsl:text> </xsl:text>
@@ -357,7 +357,7 @@
</xsl:template>
<xsl:template match="struct">
- <h3><a name="{@name}"><code><xsl:value-of select="@name"/></code></a></h3>
+ <h3><a id="{@name}"><code><xsl:value-of select="@name"/></code></a></h3>
<div class="api">
<pre>
<span class="keyword">struct </span>
@@ -447,7 +447,7 @@
<xsl:template match="macro">
<xsl:variable name="name" select="string(@name)"/>
- <h3><a name="{$name}"><code><xsl:value-of select="$name"/></code></a></h3>
+ <h3><a id="{$name}"><code><xsl:value-of select="$name"/></code></a></h3>
<pre class="api"><span class="directive">#define</span><xsl:text> </xsl:text><xsl:value-of select="$name"/></pre>
<div class="description">
<xsl:call-template name="formattext">
@@ -558,7 +558,7 @@
<xsl:variable name="nlen" select="string-length($name)"/>
<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))"/>
- <h3><a name="{$name}"><code><xsl:value-of select="$name"/></code></a></h3>
+ <h3><a id="{$name}"><code><xsl:value-of select="$name"/></code></a></h3>
<pre class="api">
<span class="keyword">typedef</span><xsl:text> </xsl:text>
<span class="type">
@@ -636,7 +636,7 @@
<xsl:variable name="nlen" select="string-length($name)"/>
<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))"/>
- <h3><a name="{$name}"><code><xsl:value-of select="$name"/></code></a></h3>
+ <h3><a id="{$name}"><code><xsl:value-of select="$name"/></code></a></h3>
<pre class="api">
<span class="type">
<xsl:call-template name="dumptext">
--
2.21.0
5 years, 4 months
[libvirt] [PATCH 00/12] qemu: Add blockdev support for block copy (blockdev-add saga)
by Peter Krempa
Add support for running a block-copy with -blockdev. This requires us to
format our own images, so this series also adds support for
blockdev-create which allows to do such a thing with qemu directly.
blockdev-create will also be used with snapshots.
Peter Krempa (12):
qemu: domain: Allow formatting top source only in
qemuDomainObjPrivateXMLFormatBlockjobFormatChain
qemu: Fix logic in
qemuDomainBlockCopyCommonValidateUserMirrorBackingStore
qemu: fix broken handling of shallow flag in qemuDomainBlockCopyCommon
util: storage: Refactor logic for using
virStorageFileGetBackendForSupportCheck
util: storage: Allow checking whether virStorageFileCreate is
supported
qemu: blockjob: Remove qemuBlockJobDiskRegisterMirror
qemu: domain: Add 'break' after formatting commit job status XML
conf: domain: Parse backingStore with VIR_DOMAIN_DEF_PARSE_DISK_SOURCE
qemu: blockjob: Copy non-detected chain fully in
qemuBlockJobRewriteConfigDiskSource
qemu: Introduce code for blockdev-create
qemu: Add blockdev support for the block copy job
qemu: driver: allow remote destinations for block copy
src/conf/domain_conf.c | 6 +-
src/libvirt_private.syms | 1 +
src/qemu/qemu_block.c | 250 ++++++++++++++++++
src/qemu/qemu_block.h | 14 +
src/qemu/qemu_blockjob.c | 202 ++++++++++++--
src/qemu/qemu_blockjob.h | 37 ++-
src/qemu/qemu_domain.c | 83 ++++--
src/qemu/qemu_driver.c | 184 +++++++++----
src/util/virstoragefile.c | 59 +++--
src/util/virstoragefile.h | 1 +
.../blockjob-blockdev-in.xml | 59 +++++
11 files changed, 786 insertions(+), 110 deletions(-)
--
2.21.0
5 years, 4 months
[libvirt] [PATCH] util: storage: Fix parsing of 'exportname' from legacy NBD strings
by Peter Krempa
If the nbd export name contains a colon, our parser would not parse it
properly as we split the string by colons. Modify the code to look up
the exportname and copy any trailing characters as the export name is
supposed to be at the end of the string.
https://bugzilla.redhat.com/show_bug.cgi?id=1733044
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/util/virstoragefile.c | 6 ++++--
tests/virstoragetest.c | 8 ++++++++
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index a6de6a1e45..ffafeef9d8 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
@@ -2928,6 +2928,7 @@ virStorageSourceParseNBDColonString(const char *nbdstr,
virStorageSourcePtr src)
{
VIR_AUTOSTRINGLIST backing = NULL;
+ const char *exportname;
if (!(backing = virStringSplit(nbdstr, ":", 0)))
return -1;
@@ -2975,8 +2976,9 @@ virStorageSourceParseNBDColonString(const char *nbdstr,
return -1;
}
- if (backing[3] && STRPREFIX(backing[3], "exportname=")) {
- if (VIR_STRDUP(src->path, backing[3] + strlen("exportname=")) < 0)
+ if ((exportname = strstr(nbdstr, "exportname="))) {
+ exportname += strlen("exportname=");
+ if (VIR_STRDUP(src->path, exportname) < 0)
return -1;
}
diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c
index ef16b3c6e0..f558eea622 100644
--- a/tests/virstoragetest.c
+++ b/tests/virstoragetest.c
@@ -1262,6 +1262,14 @@ mymain(void)
"<source protocol='nbd' name='blah'>\n"
" <host name='example.org' port='6000'/>\n"
"</source>\n");
+ TEST_BACKING_PARSE("nbd:example.org:6000:exportname=:",
+ "<source protocol='nbd' name=':'>\n"
+ " <host name='example.org' port='6000'/>\n"
+ "</source>\n");
+ TEST_BACKING_PARSE("nbd:example.org:6000:exportname=:test",
+ "<source protocol='nbd' name=':test'>\n"
+ " <host name='example.org' port='6000'/>\n"
+ "</source>\n");
TEST_BACKING_PARSE("nbd://example.org:1234",
"<source protocol='nbd'>\n"
" <host name='example.org' port='1234'/>\n"
--
2.21.0
5 years, 4 months
[libvirt] [PATCH 0/5] util: open pci config read-only for querying
by Ján Tomko
A bunch of functions opened the PCI device config as read-write
even though they only read from it.
Ján Tomko (5):
util: introduce virPCIDeviceConfigOpenInternal
util: Introduce virPCIDeviceConfigOpenWrite
util: introduce readonly attribute to virPCIDeviceConfigOpenInternal
util: introduce virPCIDeviceConfigOpenTry
util: default to read-only in virPCIDeviceConfigOpen
src/util/virpci.c | 40 +++++++++++++++++++++++++++++-----------
1 file changed, 29 insertions(+), 11 deletions(-)
--
2.20.1
5 years, 4 months