[libvirt] [PATCH] docs, rng: Allow a pool name to be line domain name
by John Ferlan
https://bugzilla.redhat.com/show_bug.cgi?id=1475250
It's possible to define and start a pool with a '.' in the
name; however, when trying to add a volume to a domain using
the storage pool source with a name with a '.' in the name,
the domain RNG validation fails because RNG uses 'genericName'
which does not allow a '.' in the name. Pool definition has
no similar call to virXMLValidateAgainstSchema. Pool name
validation occurs in storagePoolDefineXML and only calls
virXMLCheckIllegalChars using the same parameter "\n" as
qemuDomainDefineXMLFlags would check after the RNG check
could be succesful.
So in order to resolve this, create a poolName definition
in the RNG and allow the pool name and the volume source
pool name to use that definition.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
docs/schemas/domaincommon.rng | 2 +-
docs/schemas/storagecommon.rng | 8 ++++++++
docs/schemas/storagepool.rng | 4 ++--
3 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 76852abb3..2cc8dcecf 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -1669,7 +1669,7 @@
<optional>
<element name="source">
<attribute name="pool">
- <ref name="genericName"/>
+ <ref name="poolName"/>
</attribute>
<attribute name="volume">
<ref name="volName"/>
diff --git a/docs/schemas/storagecommon.rng b/docs/schemas/storagecommon.rng
index 717f3c603..49578312e 100644
--- a/docs/schemas/storagecommon.rng
+++ b/docs/schemas/storagecommon.rng
@@ -6,6 +6,14 @@
<!-- This schema is not designed for standalone use; another file
must include both this file and basictypes.rng -->
+ <define name="poolName">
+ <data type="string">
+ <!-- Use literal newline instead of \n for bug in libxml2 2.7.6 -->
+ <param name="pattern">[^
+]+</param>
+ </data>
+ </define>
+
<define name='encryption'>
<element name='encryption'>
<attribute name='format'>
diff --git a/docs/schemas/storagepool.rng b/docs/schemas/storagepool.rng
index f0117bd69..52b2044be 100644
--- a/docs/schemas/storagepool.rng
+++ b/docs/schemas/storagepool.rng
@@ -209,7 +209,7 @@
<interleave>
<optional>
<element name='name'>
- <ref name='genericName'/>
+ <ref name='poolName'/>
</element>
</optional>
<optional>
@@ -223,7 +223,7 @@
<define name='commonmetadata'>
<interleave>
<element name='name'>
- <ref name='genericName'/>
+ <ref name='poolName'/>
</element>
<optional>
<element name='uuid'>
--
2.13.5
7 years, 2 months
[libvirt] [PATCH] docs: Document the real behaviour of suspend-to-{mem, disk}
by Martin Kletzander
We get a question every now and then about why hibernation works when
suspend-to-disk is disabled and similar. Let's hope that, by documenting the
obvious more blatantly, people will get more informed.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
docs/formatdomain.html.in | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 5bdcb569c4c0..5dcf2fedb01c 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -1664,7 +1664,11 @@
<dd>These elements enable ('yes') or disable ('no') BIOS support
for S3 (suspend-to-mem) and S4 (suspend-to-disk) ACPI sleep
states. If nothing is specified, then the hypervisor will be
- left with its default value.</dd>
+ left with its default value.<br/>
+ Note: This setting cannot prevent the guest OS from performing
+ a suspend as the guest OS itself can choose to circumvent the
+ unavailability of the sleep states (e.g. S4 by turning off
+ completely).</dd>
</dl>
<h3><a id="elementsFeatures">Hypervisor features</a></h3>
--
2.14.2
7 years, 2 months
[libvirt] [PATCH v2] qemu: add the print of page size in cmd domjobinfo
by Chao Fan
The command "info migrate" of qemu outputs the dirty-pages-rate during
migration, but page size is different in different architectures. So
page size should be output to calculate dirty pages in bytes.
Page size is already implemented with commit
030ce1f8612215fcbe9d353dfeaeb2937f8e3f94 in qemu.
Now Implement the counter-part in libvirt.
Signed-off-by: Chao Fan <fanc.fnst(a)cn.fujitsu.com>
Signed-off-by: Li Zhijian <lizhijian(a)cn.fujitsu.com>
---
v1 -> v2:
Follow the suggestion of John Ferlan:
1. Drop the fix for unrelated coding style problem.
2. Fix typo.
3. Improve a judgment logic when failing to get page size.
---
include/libvirt/libvirt-domain.h | 7 +++++++
src/qemu/qemu_domain.c | 6 ++++++
src/qemu/qemu_migration_cookie.c | 7 +++++++
src/qemu/qemu_monitor.h | 1 +
src/qemu/qemu_monitor_json.c | 2 ++
tools/virsh-domain.c | 8 ++++++++
6 files changed, 31 insertions(+)
diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
index 030a62c43..1f4ddcf66 100644
--- a/include/libvirt/libvirt-domain.h
+++ b/include/libvirt/libvirt-domain.h
@@ -3336,6 +3336,13 @@ typedef enum {
# define VIR_DOMAIN_JOB_MEMORY_DIRTY_RATE "memory_dirty_rate"
/**
+ * VIR_DOMAIN_JOB_MEMORY_PAGE_SIZE:
+ *
+ * virDomainGetJobStats field: page size of the memory in this domain
+ */
+# define VIR_DOMAIN_JOB_MEMORY_PAGE_SIZE "page_size"
+
+/**
* VIR_DOMAIN_JOB_MEMORY_ITERATION:
*
* virDomainGetJobStats field: current iteration over domain's memory
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index cb371f1e8..ce342b670 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -570,6 +570,12 @@ qemuDomainJobInfoToParams(qemuDomainJobInfoPtr jobInfo,
stats->ram_iteration) < 0)
goto error;
+ if (stats->ram_page_size && (!(stats->ram_pag_size > 0) ||
+ virTypedParamsAddULLong(&par, &npar, &maxpar,
+ VIR_DOMAIN_JOB_MEMORY_PAGE_SIZE,
+ stats->ram_page_size) < 0))
+ goto error;
+
if (virTypedParamsAddULLong(&par, &npar, &maxpar,
VIR_DOMAIN_JOB_DISK_TOTAL,
stats->disk_total +
diff --git a/src/qemu/qemu_migration_cookie.c b/src/qemu/qemu_migration_cookie.c
index eef40a6cd..bc6a8dc55 100644
--- a/src/qemu/qemu_migration_cookie.c
+++ b/src/qemu/qemu_migration_cookie.c
@@ -654,6 +654,10 @@ qemuMigrationCookieStatisticsXMLFormat(virBufferPtr buf,
stats->ram_iteration);
virBufferAsprintf(buf, "<%1$s>%2$llu</%1$s>\n",
+ VIR_DOMAIN_JOB_MEMORY_PAGE_SIZE,
+ stats->ram_page_size);
+
+ virBufferAsprintf(buf, "<%1$s>%2$llu</%1$s>\n",
VIR_DOMAIN_JOB_DISK_TOTAL,
stats->disk_total);
virBufferAsprintf(buf, "<%1$s>%2$llu</%1$s>\n",
@@ -1014,6 +1018,9 @@ qemuMigrationCookieStatisticsXMLParse(xmlXPathContextPtr ctxt)
virXPathULongLong("string(./" VIR_DOMAIN_JOB_MEMORY_ITERATION "[1])",
ctxt, &stats->ram_iteration);
+ virXPathULongLong("string(./" VIR_DOMAIN_JOB_MEMORY_PAGE_SIZE "[1])",
+ ctxt, &stats->ram_page_size);
+
virXPathULongLong("string(./" VIR_DOMAIN_JOB_DISK_TOTAL "[1])",
ctxt, &stats->disk_total);
virXPathULongLong("string(./" VIR_DOMAIN_JOB_DISK_PROCESSED "[1])",
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index 6414d2483..1e3322433 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -677,6 +677,7 @@ struct _qemuMonitorMigrationStats {
unsigned long long ram_normal;
unsigned long long ram_normal_bytes;
unsigned long long ram_dirty_rate;
+ unsigned long long ram_page_size;
unsigned long long ram_iteration;
unsigned long long disk_transferred;
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 63b855920..625cbc134 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -2892,6 +2892,8 @@ qemuMonitorJSONGetMigrationStatsReply(virJSONValuePtr reply,
&stats->ram_normal_bytes));
ignore_value(virJSONValueObjectGetNumberUlong(ram, "dirty-pages-rate",
&stats->ram_dirty_rate));
+ ignore_value(virJSONValueObjectGetNumberUlong(ram, "page-size",
+ &stats->ram_page_size));
ignore_value(virJSONValueObjectGetNumberUlong(ram, "dirty-sync-count",
&stats->ram_iteration));
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index a3f3b7c7b..a50713d6e 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -6021,6 +6021,14 @@ cmdDomjobinfo(vshControl *ctl, const vshCmd *cmd)
}
if ((rc = virTypedParamsGetULLong(params, nparams,
+ VIR_DOMAIN_JOB_MEMORY_PAGE_SIZE,
+ &value)) < 0) {
+ goto save_error;
+ } else if (rc) {
+ vshPrint(ctl, "%-17s %-12llu bytes\n", _("Page size:"), value);
+ }
+
+ if ((rc = virTypedParamsGetULLong(params, nparams,
VIR_DOMAIN_JOB_MEMORY_ITERATION,
&value)) < 0) {
goto save_error;
--
2.13.5
7 years, 2 months
[libvirt] [PATCH 0/2] Fix another possible memory leak in nwfilter
by John Ferlan
Oh lucky me - why am I stuck in nwfilter land....
The first patch just cleans up the code and the second one resolves the
memory leak problem as well as a general error path problem.
Coverity noted that the error path wasn't checked - this is because
other recent changes in the module caused Coverity to decide to rethink
about this one noticing the lack of an error check. Of course upon more
visual inspection, the memory leak was obvious too.
John Ferlan (2):
nwfilter: Clean up virNWFilterDetermineMissingVarsRec returns
nwfilter: Fix memory leak and error path
src/nwfilter/nwfilter_gentech_driver.c | 30 +++++++++++++-----------------
1 file changed, 13 insertions(+), 17 deletions(-)
--
2.13.5
7 years, 2 months
[libvirt] [PATCH] docs: Add some changes to news.xml for this release
by Martin Kletzander
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
docs/news.xml | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 81 insertions(+)
diff --git a/docs/news.xml b/docs/news.xml
index aab812b259cf..c9e7e4b9d1e4 100644
--- a/docs/news.xml
+++ b/docs/news.xml
@@ -35,6 +35,26 @@
<libvirt>
<release version="v3.8.0" date="unreleased">
<section title="New features">
+ <change>
+ <summary>
+ qemu: Added support for cold-(un)plug of watchdog devices
+ </summary>
+ </change>
+ <change>
+ <summary>
+ qemu: Added support for setting IP address os usernet interfaces
+ </summary>
+ </change>
+ <change>
+ <summary>
+ qemu: Added support for Veritas Hyperscale (VxHS) block devices
+ </summary>
+ </change>
+ <change>
+ <summary>
+ storage: Added new events for pool-build and pool-delete
+ </summary>
+ </change>
</section>
<section title="Improvements">
<change>
@@ -59,8 +79,69 @@
kernel-forward-plane-offload).
</description>
</change>
+ <change>
+ <summary>
+ New CPU models for AMD and Intel
+ </summary>
+ <description>
+ AMD EPYC and Intel Skylake-Server CPU models were added together with
+ their features
+ </description>
+ </change>
+ <change>
+ <summary>
+ Improve long waiting when saving a domain
+ </summary>
+ <description>
+ While waiting for a write to disk to be finished, e.g. during save,
+ even simple operations like <code>virsh list</code> would be blocking
+ due to domain lock. This is now resolved by unlocking the domain
+ in places where it is not needed.
+ </description>
+ </change>
</section>
<section title="Bug fixes">
+ <change>
+ <summary>
+ Proper units are now used in virsh manpage for dom(mem)stats
+ </summary>
+ <description>
+ Previously the documentation used multiples of 1000, but now it is
+ fixe to use multiples of 1024.
+ </description>
+ </change>
+ <change>
+ <summary>
+ qemu: Fix error reporting when disk attachment fails
+ </summary>
+ <description>
+ There was a possibility for the actual error to be overridden or
+ cleared during the rollback.
+ </description>
+ </change>
+ <change>
+ <summary>
+ qemu: Fix assignment of graphics ports after daemon restart
+ </summary>
+ <description>
+ This could be seen with newer kernels that have bug regarding
+ SO_REUSEADDR. After libvirtd was restarted it could assign already
+ used address to new guests which would make them fail to start. This
+ is fixed by marking used ports unavailable when reconnecting to
+ running QEMU domains.
+ </description>
+ </change>
+ <change>
+ <summary>
+ Fix message decoding which was caused very strange bug
+ </summary>
+ <description>
+ When parsing an RPC message with file descriptors was interrupted and
+ had to restart, the offset of the payload was calculated badly causing
+ strange issues like not being able to find a domain that was not
+ requested.
+ </description>
+ </change>
</section>
</release>
<release version="v3.7.0" date="2017-09-04">
--
2.14.2
7 years, 2 months
[libvirt] [PATCH v2 0/2] Clean up the nwfilter mess I created
by John Ferlan
v1: https://www.redhat.com/archives/libvir-list/2017-September/msg01072.html
Changes:
* Patch1: No change, ACK'd, but not safe to push yet either..
* Patch2: Rather than have virNWFilterIPAddrMapAddIPAddr consume
the input @addr, let's make a copy of the input parameter
and manage it within that code so that it wouldn't be
consumed on virNWFilterHashTablePut failure after
virNWFilterVarValueCreateSimple success.
John Ferlan (2):
Revert "nwfilter: Fix possible segfault on sometimes consumed
variable"
nwfilter: Don't have virNWFilterIPAddrMapAddIPAddr consume input
src/conf/nwfilter_ipaddrmap.c | 16 +++++++++-------
src/nwfilter/nwfilter_dhcpsnoop.c | 3 ---
2 files changed, 9 insertions(+), 10 deletions(-)
--
2.13.5
7 years, 2 months
[libvirt] [PATCH v3 RESEND] vhost-user: add support reconnect for vhost-user ports
by ZhiPeng Lu
For vhost-user ports, Open vSwitch acts as the server and QEMU the client.
When OVS crashes or restarts, the QEMU process should be reconnected to
OVS.
Signed-off-by: ZhiPeng Lu <lu.zhipeng(a)zte.com.cn>
---
docs/schemas/domaincommon.rng | 26 ++++++++------
src/conf/domain_conf.c | 40 ++++++++++++++++++----
src/conf/domain_conf.h | 10 +++---
src/qemu/qemu_command.c | 2 +-
src/qemu/qemu_domain.c | 2 +-
src/qemu/qemu_monitor_json.c | 2 +-
.../qemuxml2argv-net-vhostuser-multiq.args | 4 +--
.../qemuxml2argv-net-vhostuser-multiq.xml | 8 +++--
8 files changed, 65 insertions(+), 29 deletions(-)
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 76852ab..3f4ed82 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -2327,6 +2327,18 @@
</attribute>
</optional>
</define>
+ <define name="reconnect">
+ <element name="reconnect">
+ <attribute name="enabled">
+ <ref name="virYesNo"/>
+ </attribute>
+ <optional>
+ <attribute name="timeout">
+ <ref name="unsignedInt"/>
+ </attribute>
+ </optional>
+ </element>
+ </define>
<!--
An interface description can either be of type bridge in which case
@@ -2388,6 +2400,9 @@
<value>client</value>
</choice>
</attribute>
+ <optional>
+ <ref name="reconnect"/>
+ </optional>
<empty/>
</element>
<ref name="interface-options"/>
@@ -3636,16 +3651,7 @@
</attribute>
</optional>
<optional>
- <element name="reconnect">
- <attribute name="enabled">
- <ref name="virYesNo"/>
- </attribute>
- <optional>
- <attribute name="timeout">
- <ref name="unsignedInt"/>
- </attribute>
- </optional>
- </element>
+ <ref name="reconnect"/>
</optional>
<zeroOrMore>
<ref name='devSeclabel'/>
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index cc5e79b..b7fc3a5 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -83,6 +83,13 @@ struct _virDomainXMLOption {
/* Private data for save image stored in snapshot XML */
virSaveCookieCallbacks saveCookie;
};
+static int
+virDomainDeviceSourceReconnectDefParseXML(virDomainDeviceSourceReconnectDefPtr def,
+ xmlNodePtr node,
+ xmlXPathContextPtr ctxt);
+static void
+virDomainDeviceSourceReconnectDefFormat(virBufferPtr buf,
+ virDomainDeviceSourceReconnectDefPtr def);
#define VIR_DOMAIN_DEF_FORMAT_COMMON_FLAGS \
(VIR_DOMAIN_DEF_FORMAT_SECURE | \
@@ -10245,6 +10252,7 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
virNWFilterHashTablePtr filterparams = NULL;
virDomainActualNetDefPtr actual = NULL;
xmlNodePtr oldnode = ctxt->node;
+ virDomainDeviceSourceReconnectDef reconnect = {0};
int rv, val;
if (VIR_ALLOC(def) < 0)
@@ -10331,6 +10339,8 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
vhostuser_type = virXMLPropString(cur, "type");
vhostuser_path = virXMLPropString(cur, "path");
vhostuser_mode = virXMLPropString(cur, "mode");
+ if (virDomainDeviceSourceReconnectDefParseXML(&reconnect, cur, ctxt) < 0)
+ goto error;
} else if (!def->virtPortProfile
&& virXMLNodeNameEqual(cur, "virtualport")) {
if (def->type == VIR_DOMAIN_NET_TYPE_NETWORK) {
@@ -10552,8 +10562,17 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
if (STREQ(vhostuser_mode, "server")) {
def->data.vhostuser->data.nix.listen = true;
+ if (reconnect.enabled != VIR_TRISTATE_BOOL_ABSENT) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("'reconnect' attribute unsupported "
+ "'server' mode for <interface type='vhostuser'>"));
+ goto error;
+ }
} else if (STREQ(vhostuser_mode, "client")) {
def->data.vhostuser->data.nix.listen = false;
+ def->data.vhostuser->data.nix.reconnect.enabled = reconnect.enabled;
+ def->data.vhostuser->data.nix.reconnect.timeout = reconnect.timeout;
+ reconnect.enabled = VIR_TRISTATE_BOOL_ABSENT;
} else {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Wrong <source> 'mode' attribute "
@@ -11216,7 +11235,7 @@ virDomainChrDefParseTargetXML(virDomainChrDefPtr def,
}
static int
-virDomainChrSourceReconnectDefParseXML(virDomainChrSourceReconnectDefPtr def,
+virDomainDeviceSourceReconnectDefParseXML(virDomainDeviceSourceReconnectDefPtr def,
xmlNodePtr node,
xmlXPathContextPtr ctxt)
{
@@ -11338,7 +11357,7 @@ virDomainChrSourceDefParseTCP(virDomainChrSourceDefPtr def,
VIR_FREE(tmp);
}
- if (virDomainChrSourceReconnectDefParseXML(&def->data.tcp.reconnect,
+ if (virDomainDeviceSourceReconnectDefParseXML(&def->data.tcp.reconnect,
source,
ctxt) < 0) {
goto error;
@@ -11389,7 +11408,7 @@ virDomainChrSourceDefParseUnix(virDomainChrSourceDefPtr def,
def->data.nix.listen = mode == VIR_DOMAIN_CHR_SOURCE_MODE_BIND;
def->data.nix.path = virXMLPropString(source, "path");
- if (virDomainChrSourceReconnectDefParseXML(&def->data.nix.reconnect,
+ if (virDomainDeviceSourceReconnectDefParseXML(&def->data.nix.reconnect,
source,
ctxt) < 0) {
return -1;
@@ -22984,6 +23003,13 @@ virDomainNetDefFormat(virBufferPtr buf,
def->data.vhostuser->data.nix.listen ?
"server" : "client");
sourceLines++;
+ if (def->data.vhostuser->data.nix.reconnect.enabled != VIR_TRISTATE_BOOL_ABSENT) {
+ virBufferAddLit(buf, ">\n");
+ sourceLines++;
+ virBufferAdjustIndent(buf, 2);
+ virDomainDeviceSourceReconnectDefFormat(buf, &def->data.vhostuser->data.nix.reconnect);
+ virBufferAdjustIndent(buf, -2);
+ }
}
break;
@@ -23218,8 +23244,8 @@ virDomainChrAttrsDefFormat(virBufferPtr buf,
static void
-virDomainChrSourceReconnectDefFormat(virBufferPtr buf,
- virDomainChrSourceReconnectDefPtr def)
+virDomainDeviceSourceReconnectDefFormat(virBufferPtr buf,
+ virDomainDeviceSourceReconnectDefPtr def)
{
if (def->enabled == VIR_TRISTATE_BOOL_ABSENT)
return;
@@ -23314,7 +23340,7 @@ virDomainChrSourceDefFormat(virBufferPtr buf,
virBufferAsprintf(&attrBuf, " tlsFromConfig='%d'",
def->data.tcp.tlsFromConfig);
- virDomainChrSourceReconnectDefFormat(&childBuf,
+ virDomainDeviceSourceReconnectDefFormat(&childBuf,
&def->data.tcp.reconnect);
if (virXMLFormatElement(buf, "source", &attrBuf, &childBuf) < 0)
@@ -23333,7 +23359,7 @@ virDomainChrSourceDefFormat(virBufferPtr buf,
virDomainSourceDefFormatSeclabel(&childBuf, def->nseclabels,
def->seclabels, flags);
- virDomainChrSourceReconnectDefFormat(&childBuf,
+ virDomainDeviceSourceReconnectDefFormat(&childBuf,
&def->data.nix.reconnect);
if (virXMLFormatElement(buf, "source", &attrBuf, &childBuf) < 0)
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index bb3b6f0..909f60d 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1138,12 +1138,12 @@ typedef enum {
} virDomainChrSpicevmcName;
-struct _virDomainChrSourceReconnectDef {
+struct _virDomainDeviceSourceReconnectDef {
virTristateBool enabled;
unsigned int timeout;
};
-typedef struct _virDomainChrSourceReconnectDef virDomainChrSourceReconnectDef;
-typedef virDomainChrSourceReconnectDef *virDomainChrSourceReconnectDefPtr;
+typedef struct _virDomainDeviceSourceReconnectDef virDomainDeviceSourceReconnectDef;
+typedef virDomainDeviceSourceReconnectDef *virDomainDeviceSourceReconnectDefPtr;
/* The host side information for a character device. */
@@ -1168,7 +1168,7 @@ struct _virDomainChrSourceDef {
bool tlscreds;
int haveTLS; /* enum virTristateBool */
bool tlsFromConfig;
- virDomainChrSourceReconnectDef reconnect;
+ virDomainDeviceSourceReconnectDef reconnect;
} tcp;
struct {
char *bindHost;
@@ -1179,7 +1179,7 @@ struct _virDomainChrSourceDef {
struct {
char *path;
bool listen;
- virDomainChrSourceReconnectDef reconnect;
+ virDomainDeviceSourceReconnectDef reconnect;
} nix;
int spicevmc;
struct {
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 9b3e3fc..4640ce8 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -5094,7 +5094,7 @@ qemuBuildChrChardevFileStr(virLogManagerPtr logManager,
static void
qemuBuildChrChardevReconnectStr(virBufferPtr buf,
- const virDomainChrSourceReconnectDef *def)
+ const virDomainDeviceSourceReconnectDef *def)
{
if (def->enabled == VIR_TRISTATE_BOOL_YES) {
virBufferAsprintf(buf, ",reconnect=%u", def->timeout);
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 50b536e..4ea0727 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -3244,7 +3244,7 @@ qemuDomainNetSupportsCoalesce(virDomainNetType type)
static int
-qemuDomainChrSourceReconnectDefValidate(const virDomainChrSourceReconnectDef *def)
+qemuDomainChrSourceReconnectDefValidate(const virDomainDeviceSourceReconnectDef *def)
{
if (def->enabled == VIR_TRISTATE_BOOL_YES &&
def->timeout == 0) {
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 63b8559..b3d572e 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -6443,7 +6443,7 @@ int qemuMonitorJSONGetTPMTypes(qemuMonitorPtr mon,
static int
qemuMonitorJSONBuildChrChardevReconnect(virJSONValuePtr object,
- const virDomainChrSourceReconnectDef *def)
+ const virDomainDeviceSourceReconnectDef *def)
{
if (def->enabled != VIR_TRISTATE_BOOL_YES)
return 0;
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser-multiq.args b/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser-multiq.args
index b69ebd8..0b08f44 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser-multiq.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser-multiq.args
@@ -25,14 +25,14 @@ server,nowait \
-netdev vhost-user,chardev=charnet0,id=hostnet0 \
-device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:ee:96:6b,bus=pci.0,\
addr=0x3 \
--chardev socket,id=charnet1,path=/tmp/vhost1.sock \
+-chardev socket,id=charnet1,path=/tmp/vhost1.sock,reconnect=10 \
-netdev vhost-user,chardev=charnet1,id=hostnet1 \
-device virtio-net-pci,netdev=hostnet1,id=net1,mac=52:54:00:ee:96:6c,bus=pci.0,\
addr=0x4 \
-netdev socket,listen=:2015,id=hostnet2 \
-device rtl8139,netdev=hostnet2,id=net2,mac=52:54:00:95:db:c0,bus=pci.0,\
addr=0x5 \
--chardev socket,id=charnet3,path=/tmp/vhost2.sock \
+-chardev socket,id=charnet3,path=/tmp/vhost2.sock,reconnect=0 \
-netdev vhost-user,chardev=charnet3,queues=4,id=hostnet3 \
-device virtio-net-pci,mq=on,vectors=10,netdev=hostnet3,id=net3,\
mac=52:54:00:ee:96:6d,bus=pci.0,addr=0x6
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser-multiq.xml b/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser-multiq.xml
index d5c42fe..2fadb1c 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser-multiq.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser-multiq.xml
@@ -30,7 +30,9 @@
</interface>
<interface type='vhostuser'>
<mac address='52:54:00:ee:96:6c'/>
- <source type='unix' path='/tmp/vhost1.sock' mode='client'/>
+ <source type='unix' path='/tmp/vhost1.sock' mode='client'>
+ <reconnect enabled='yes' timeout='10'/>
+ </source>
<model type='virtio'/>
</interface>
<interface type='server'>
@@ -40,7 +42,9 @@
</interface>
<interface type='vhostuser'>
<mac address='52:54:00:ee:96:6d'/>
- <source type='unix' path='/tmp/vhost2.sock' mode='client'/>
+ <source type='unix' path='/tmp/vhost2.sock' mode='client'>
+ <reconnect enabled='no'/>
+ </source>
<model type='virtio'/>
<driver queues='4'/>
</interface>
--
1.8.3.1
7 years, 2 months
[libvirt] [PATCH 0/2] Clean up the nwfilter mess I created
by John Ferlan
Silly me - touching the nwfilter code... Turns out the reverted patch
in 1/2 doesn't cover it as virNWFilterVarValueCreateSimple actually
steals @addr, so freeing it on successful return ends up being a very
bad thing as I found out with the nwfilter avocado-vt tests.
So revert that and just go with the only free on failure logic in patch2
John Ferlan (2):
Revert "nwfilter: Fix possible segfault on sometimes consumed
variable"
nwfilter: Only free inetaddr on virNWFilterIPAddrMapAddIPAddr failure
src/conf/nwfilter_ipaddrmap.c | 9 +--------
src/nwfilter/nwfilter_learnipaddr.c | 5 ++++-
2 files changed, 5 insertions(+), 9 deletions(-)
--
2.13.5
7 years, 2 months
[libvirt] [PATCH 0/2] Add multiqueue support for virtio-blk
by Lin Ma
The multiqueue for virtio-blk was introduced since qemu 2.7.0.
These patches supported it and update test data for it.
Lin Ma (2):
qemucapstest: Update test data for 'num-queues' property of virtio-blk
qemu: Support multiqueue virtio-blk
docs/formatdomain.html.in | 6 +++-
docs/schemas/domaincommon.rng | 5 ++++
src/conf/domain_conf.c | 19 ++++++++++++
src/conf/domain_conf.h | 1 +
src/qemu/qemu_capabilities.c | 2 ++
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 4 +++
tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.9.0.ppc64le.xml | 1 +
tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml | 1 +
.../qemuxml2argv-disk-virtio-drive-queues.args | 24 +++++++++++++++
.../qemuxml2argv-disk-virtio-drive-queues.xml | 34 ++++++++++++++++++++++
tests/qemuxml2argvtest.c | 2 ++
.../qemuxml2xmlout-disk-virtio-drive-queues.xml | 1 +
tests/qemuxml2xmltest.c | 1 +
21 files changed, 108 insertions(+), 1 deletion(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-drive-queues.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-drive-queues.xml
create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-virtio-drive-queues.xml
--
2.14.0
7 years, 2 months