[libvirt] [PATCH v2 0/5] Workaround mdev uevent race affecting node device driver
by Erik Skultety
v1 here https://www.redhat.com/archives/libvir-list/2017-June/msg00826.html
This series addresses [1]. It builds on top of [2], series which introduces
a few small fixes and improvements. Even though that one hasn't gotten a review
yet, you can fetch and build this from my github branch [3].
Changes since v1:
- moved the device handling routine into a detached worker thread, so the event
loop wouldn't block
- adjusted virFileAccess according to the reviewer's comments
Notes:
Merging the nodedev obj's refactor storing the list of nodedev objects in a
self-lockable object made it possible to drop the driver locks at certain
spots either completely or at least rearrange them according to the needs. The
worker thread therefore doesn't need to hold the driver lock while waiting on
the device's attributes to appear (which would be wrong anyway, since it would
still block the event loop) and only acquires the driver lock when doing sanity
checks on the udev monitor.
[1] https://bugzilla.redhat.com/show_bug.cgi?id=1463285
[2] https://www.redhat.com/archives/libvir-list/2017-July/msg01077.html
[3] https://github.com/eskultety/libvirt/commits/mdev-nodedev-next
Erik Skultety (5):
nodedev: Introduce udevCheckMonitorFD helper function
udev: Split udevEventHandleCallback in two functions
udev: Convert udevEventHandleThread to an actual thread routine
util: Introduce virFileWaitForAccess
nodedev: Work around the uevent race by hooking up
virFileWaitForAccess
src/libvirt_private.syms | 1 +
src/node_device/node_device_udev.c | 194 +++++++++++++++++++++++++++++++------
src/util/virfile.c | 29 ++++++
src/util/virfile.h | 2 +
4 files changed, 194 insertions(+), 32 deletions(-)
--
2.13.3
7 years, 4 months
[libvirt] [PATCH] nodedev: Fix double unlock of the driver on udevEnumerateDevices failure
by Erik Skultety
Commit @4cb719b2dc moved the driver locks around since these have become
unnecessary at spots where the code handles now self-lockable object
list, but missed the possible double unlock if udevEnumerateDevices
fails, because at that point the driver lock had been already dropped.
Signed-off-by: Erik Skultety <eskultet(a)redhat.com>
---
src/node_device/node_device_udev.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index 4762f1969..4c35fd5c9 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -1789,18 +1789,18 @@ nodeStateInitialize(bool privileged,
nodeDeviceLock();
if (!(driver->devs = virNodeDeviceObjListNew()))
- goto cleanup;
+ goto unlock;
driver->nodeDeviceEventState = virObjectEventStateNew();
if (udevPCITranslateInit(privileged) < 0)
- goto cleanup;
+ goto unlock;
udev = udev_new();
if (!udev) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("failed to create udev context"));
- goto cleanup;
+ goto unlock;
}
#if HAVE_UDEV_LOGGING
/* cast to get rid of missing-format-attribute warning */
@@ -1811,7 +1811,7 @@ nodeStateInitialize(bool privileged,
if (priv->udev_monitor == NULL) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("udev_monitor_new_from_netlink returned NULL"));
- goto cleanup;
+ goto unlock;
}
udev_monitor_enable_receiving(priv->udev_monitor);
@@ -1837,11 +1837,11 @@ nodeStateInitialize(bool privileged,
VIR_EVENT_HANDLE_READABLE,
udevEventHandleCallback, NULL, NULL);
if (priv->watch == -1)
- goto cleanup;
+ goto unlock;
/* Create a fictional 'computer' device to root the device tree. */
if (udevSetupSystemDev() != 0)
- goto cleanup;
+ goto unlock;
nodeDeviceUnlock();
@@ -1852,9 +1852,12 @@ nodeStateInitialize(bool privileged,
return 0;
cleanup:
- nodeDeviceUnlock();
nodeStateCleanup();
return -1;
+
+ unlock:
+ nodeDeviceUnlock();
+ goto cleanup;
}
--
2.13.3
7 years, 4 months
[libvirt] [PATCH] tools: virsh: Adding unix socket support to 'domdisplay' command.
by Julio Faracco
This commit adds the unix socket URL support to 'domdisplay' command.
Before, even if an user was using unix socket to define a spice graphics,
the command 'domdisplay' showed that the settings were not supported. Now,
the command shows the proper URL: spice+unix://foo/bar.sock.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1336720
Signed-off-by: Julio Faracco <jcfaracco(a)gmail.com>
---
tools/virsh-domain.c | 49 ++++++++++++++++++++++++++++++++++++++-----------
1 file changed, 38 insertions(+), 11 deletions(-)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 0684979..090714b 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -10948,6 +10948,8 @@ cmdDomDisplay(vshControl *ctl, const vshCmd *cmd)
char *xpath = NULL;
char *listen_addr = NULL;
int port, tls_port = 0;
+ char *type_conn = NULL;
+ char *socket = NULL;
char *passwd = NULL;
char *output = NULL;
const char *scheme[] = { "vnc", "spice", "rdp", NULL };
@@ -11008,9 +11010,6 @@ cmdDomDisplay(vshControl *ctl, const vshCmd *cmd)
if (tmp)
tls_port = 0;
- if (!port && !tls_port)
- continue;
-
/* Create our XPATH lookup for the current display's address */
if (virAsprintf(&xpath, xpath_fmt, scheme[iter], "@listen") < 0)
goto cleanup;
@@ -11021,6 +11020,29 @@ cmdDomDisplay(vshControl *ctl, const vshCmd *cmd)
listen_addr = virXPathString(xpath, ctxt);
VIR_FREE(xpath);
+ /* Create our XPATH lookup for the current spice type. */
+ if (virAsprintf(&xpath, xpath_fmt, scheme[iter], "listen/@type") < 0)
+ goto cleanup;
+
+ /* Attempt to get the type of spice connection */
+ VIR_FREE(type_conn);
+ type_conn = virXPathString(xpath, ctxt);
+ VIR_FREE(xpath);
+
+ if (STREQ_NULLABLE(type_conn, "socket")) {
+ if (!socket) {
+ if (virAsprintf(&xpath, xpath_fmt, scheme[iter], "listen/@socket") < 0)
+ goto cleanup;
+
+ socket = virXPathString(xpath, ctxt);
+
+ VIR_FREE(xpath);
+ }
+ }
+
+ if (!port && !tls_port && !socket)
+ continue;
+
if (!listen_addr) {
/* The subelement address - <listen address='xyz'/> -
* *should* have been automatically backfilled into its
@@ -11035,11 +11057,9 @@ cmdDomDisplay(vshControl *ctl, const vshCmd *cmd)
listen_addr = virXPathString(xpath, ctxt);
VIR_FREE(xpath);
- }
-
- /* If listen_addr is 0.0.0.0 or [::] we should try to parse URI and set
- * listen_addr based on current URI. */
- if (listen_addr) {
+ } else {
+ /* If listen_addr is 0.0.0.0 or [::] we should try to parse URI and set
+ * listen_addr based on current URI. */
if (virSocketAddrParse(&addr, listen_addr, AF_UNSPEC) > 0 &&
virSocketAddrIsWildcard(&addr)) {
@@ -11078,17 +11098,22 @@ cmdDomDisplay(vshControl *ctl, const vshCmd *cmd)
VIR_FREE(xpath);
/* Build up the full URI, starting with the scheme */
- virBufferAsprintf(&buf, "%s://", scheme[iter]);
+ if (socket)
+ virBufferAsprintf(&buf, "%s+unix://", scheme[iter]);
+ else
+ virBufferAsprintf(&buf, "%s://", scheme[iter]);
/* There is no user, so just append password if there's any */
if (STREQ(scheme[iter], "vnc") && passwd)
virBufferAsprintf(&buf, ":%s@", passwd);
/* Then host name or IP */
- if (!listen_addr)
+ if (!listen_addr && !socket)
virBufferAddLit(&buf, "localhost");
- else if (strchr(listen_addr, ':'))
+ else if (!socket && strchr(listen_addr, ':'))
virBufferAsprintf(&buf, "[%s]", listen_addr);
+ else if (STREQ(scheme[iter], "spice"))
+ virBufferAsprintf(&buf, "%s", socket);
else
virBufferAsprintf(&buf, "%s", listen_addr);
@@ -11148,6 +11173,8 @@ cmdDomDisplay(vshControl *ctl, const vshCmd *cmd)
cleanup:
VIR_FREE(xpath);
+ VIR_FREE(socket);
+ VIR_FREE(type_conn);
VIR_FREE(passwd);
VIR_FREE(listen_addr);
VIR_FREE(output);
--
2.7.4
7 years, 4 months
[libvirt] about support quorum and replication in xml
by wang.guang55@zte.com.cn
aGkNCg0KDQp3ZSB3aWlsbCB1c2UgcXVvcnVtIGFuZCByZXBsaWNhdGlvbiBpbiBxZW11Lg0KDQoN
CmJ1dCB3ZSBmb3VuZCB0aGF0IGxpYnZpcnQgZG9lcyBub3Qgc3VwcG9ydCBxdW9ydW0gYW5kIHJl
cGxpY2F0aW9uIGluIHhtbC4NCg0KDQpzbyB3ZSB3YW50IHN1Ym1pdCBzb21lIHBhdGNoZXMgZm9y
IHN1cHBvcnRpbmcgcXVvcnVtIGFuZCByZXBsaWNhdGlvbiBpbiB4bWwNCg0KDQoNCg0KDQoNCmhv
dyBhYm91dCBpdD8/Lg==
7 years, 4 months
[libvirt] about support quorum and replication in libvirt
by wang.guang55@zte.com.cn
aGkNCg0KDQp3ZSB3aWlsbCB1c2UgcXVvcnVtIGFuZCByZXBsaWNhdGlvbiBpbiBxZW11Lg0KDQoN
CmJ1dCB3ZSBmb3VuZCB0aGF0IGxpYnZpcnQgZG9lcyBub3Qgc3VwcG9ydCBxdW9ydW0gYW5kIHJl
cGxpY2F0aW9uIGluIHhtbC4NCg0KDQpzbyB3ZSB3YW50IHN1Ym1pdCBzb21lIHBhdGNoZXMgZm9y
IHN1cHBvcnRpbmcgcXVvcnVtIGFuZCByZXBsaWNhdGlvbiBpbiB4bWwuDQoNCg0KaG93IGFib3V0
IGl0Pz8u
7 years, 4 months
[libvirt] status of support for cache allocation technology?
by Chris Friesen
Hi,
I'm just wondering what the current status is about exposing/controlling cache
banks. Looking at the code, it appears that we report the banks as part of
"virsh capabilities". Is it possible to associate a particular bank with a
particular domain, or has that not yet merged?
Is the "[PATH V10 00/12] Support cache tune in libvirt" patch series the most
recent set of patches?
Thanks,
Chris
7 years, 4 months
[libvirt] question about support quorum and replication in libvirt
by wang.guang55@zte.com.cn
aGwNCg0Kd2Ugd2lpbGwgdXNlIHF1b3J1bSBhbmQgcmVwbGljYXRpb24gaW4gcWVtdS4NCg0KYnV0
IHdlIGZvdW5kIHRoYXQgbGlidmlydCBkb2VzIG5vdCBzdXBwb3J0IHF1b3J1bSBhbmQgcmVwbGlj
YXRpb24gLg0KDQpzbyB3ZSB3YW50IHN1Ym1pdCBzb21lIHBhdGNoZXMgZm9yIHN1cHBvcmluZyBx
dW9ydW0gYW5kIHJlcGxpY2F0aW9uIA0KDQpob3cgYWJvdXQgaXQ/Py4=
7 years, 4 months
[libvirt] [PATCH 00/12] Cleanup website generation & add favicons
by Daniel P. Berrange
This started as an attempt to add modern favicon support to
the website. This requires use of HTML5 only syntax, which
lead to the massive cleanup to stop using XHTML 1.0, which
forms all of this series except the last patch
Daniel P. Berrange (12):
docs: switch to using 'id' attribute instead of 'name' for links
docs: drop XHTML 1.0 validation of website
docs: make xmllint & xsltproc compulsory
docs: fix typo s/∧/&/
docs: remove use of in docs
docs: remove use of — entity
docs: use UTF-8 instead of HTML entities for decorated letters
docs: switch to using HTML5 doctype declaration
docs: generate pretty indented HTML for API docs
docs: remove bogus 'shape' attribute on links
docs: explicitly declare pages as being UTF-8 format
docs: add full set of "favicon" files to support modern clients
.travis.yml | 1 -
docs/404.html.in | 2 +-
docs/Makefile.am | 52 +--
docs/acl.html.in | 8 +-
docs/aclpolkit.html.in | 34 +-
docs/android-chrome-192x192.png | Bin 0 -> 13057 bytes
docs/android-chrome-256x256.png | Bin 0 -> 16597 bytes
docs/api.html.in | 10 +-
docs/api_extension.html.in | 14 +-
docs/apple-touch-icon.png | Bin 0 -> 10489 bytes
docs/apps.html.in | 38 +--
docs/architecture.html.in | 8 +-
docs/auditlog.html.in | 40 +--
docs/auth.html.in | 16 +-
docs/bindings.html.in | 2 +-
docs/browserconfig.xml | 9 +
docs/bugs.html.in | 12 +-
docs/cgroups.html.in | 26 +-
docs/compiling.html.in | 8 +-
docs/contact.html.in | 8 +-
docs/contribute.html.in | 12 +-
docs/csharp.html.in | 634 +++++++++++++++++------------------
docs/devguide.html.in | 2 +-
docs/docs.html.in | 2 +-
docs/downloads.html.in | 14 +-
docs/drivers.html.in | 6 +-
docs/drvbhyve.html.in | 22 +-
docs/drvesx.html.in | 46 +--
docs/drvhyperv.html.in | 12 +-
docs/drvlxc.html.in | 54 +--
docs/drvnodedev.html.in | 10 +-
docs/drvopenvz.html.in | 14 +-
docs/drvphyp.html.in | 8 +-
docs/drvqemu.html.in | 34 +-
docs/drvremote.html.in | 2 +-
docs/drvtest.html.in | 2 +-
docs/drvuml.html.in | 4 +-
docs/drvvbox.html.in | 6 +-
docs/drvvirtuozzo.html.in | 8 +-
docs/drvvmware.html.in | 6 +-
docs/drvxen.html.in | 16 +-
docs/errors.html.in | 2 +-
docs/favicon-16x16.png | Bin 0 -> 872 bytes
docs/favicon-32x32.png | Bin 0 -> 1793 bytes
docs/favicon.ico | Bin 0 -> 15086 bytes
docs/firewall.html.in | 8 +-
docs/format.html.in | 22 +-
docs/formatcaps.html.in | 10 +-
docs/formatdomain.html.in | 228 ++++++-------
docs/formatdomaincaps.html.in | 26 +-
docs/formatnetwork.html.in | 36 +-
docs/formatnode.html.in | 6 +-
docs/formatnwfilter.html.in | 70 ++--
docs/formatsecret.html.in | 12 +-
docs/formatsnapshot.html.in | 6 +-
docs/formatstorage.html.in | 30 +-
docs/formatstorageencryption.html.in | 12 +-
docs/genaclperms.pl | 2 +-
docs/goals.html.in | 2 +-
docs/governance.html.in | 14 +-
docs/hacking.html.in | 42 +--
docs/hooks.html.in | 34 +-
docs/hvsupport.pl | 2 +-
docs/index.html.in | 22 +-
docs/internals.html.in | 2 +-
docs/internals/command.html.in | 34 +-
docs/internals/eventloop.html.in | 8 +-
docs/internals/locking.html.in | 18 +-
docs/internals/oomtesting.html.in | 10 +-
docs/internals/rpc.html.in | 44 +--
docs/java.html.in | 2 +-
docs/locking-lockd.html.in | 10 +-
docs/locking-sanlock.html.in | 12 +-
docs/locking.html.in | 4 +-
docs/logging.html.in | 16 +-
docs/manifest.json | 18 +
docs/migration.html.in | 38 +--
docs/mstile-150x150.png | Bin 0 -> 7579 bytes
docs/newapi.xsl | 19 +-
docs/news-2005.html.in | 6 +-
docs/news-2006.html.in | 6 +-
docs/news-2007.html.in | 6 +-
docs/news-2008.html.in | 6 +-
docs/news-2009.html.in | 6 +-
docs/news-2010.html.in | 6 +-
docs/news-2011.html.in | 6 +-
docs/news-2012.html.in | 6 +-
docs/news-2013.html.in | 6 +-
docs/news-2014.html.in | 2 +-
docs/news-2015.html.in | 2 +-
docs/news-2016.html.in | 2 +-
docs/news-html.xsl | 2 +-
docs/nss.html.in | 12 +-
docs/page.xsl | 23 +-
docs/php.html.in | 2 +-
docs/python.html.in | 2 +-
docs/remote.html.in | 30 +-
docs/search.php.in | 2 +-
docs/secureusage.html.in | 16 +-
docs/securityprocess.html.in | 14 +-
docs/site.xsl | 4 +-
docs/storage.html.in | 28 +-
docs/subsite.xsl | 4 +-
docs/testapi.html.in | 2 +-
docs/testsuites.html.in | 2 +-
docs/testtck.html.in | 2 +-
docs/uri.html.in | 30 +-
docs/virshcmdref.html.in | 16 +-
docs/windows.html.in | 20 +-
libvirt.spec.in | 1 -
m4/virt-external-programs.m4 | 13 +-
111 files changed, 1150 insertions(+), 1158 deletions(-)
create mode 100644 docs/android-chrome-192x192.png
create mode 100644 docs/android-chrome-256x256.png
create mode 100644 docs/apple-touch-icon.png
create mode 100644 docs/browserconfig.xml
create mode 100644 docs/favicon-16x16.png
create mode 100644 docs/favicon-32x32.png
create mode 100644 docs/favicon.ico
create mode 100644 docs/manifest.json
create mode 100644 docs/mstile-150x150.png
--
2.13.3
7 years, 4 months
[libvirt] [PATCH v2] Add support for virtio-net.tx_queue_size
by Michal Privoznik
https://bugzilla.redhat.com/show_bug.cgi?id=1462653
Just like I've added support for setting rx_queue_size (in
c56cdf259 and friends), qemu just gained support for setting tx
ring size.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
diff to v1:
- Resend after 2e7d4916967 which introduced yet another qemu capability and
thus made my patch not apply cleanly.
docs/formatdomain.html.in | 16 +++++++++++++++-
docs/schemas/domaincommon.rng | 5 +++++
src/conf/domain_conf.c | 16 ++++++++++++++++
src/conf/domain_conf.h | 1 +
src/qemu/qemu_capabilities.c | 4 ++++
src/qemu/qemu_capabilities.h | 3 +++
src/qemu/qemu_command.c | 8 ++++++++
src/qemu/qemu_domain.c | 16 +++++++++++-----
...e.args => qemuxml2argv-net-virtio-rxtxqueuesize.args} | 4 ++--
...ize.xml => qemuxml2argv-net-virtio-rxtxqueuesize.xml} | 2 +-
tests/qemuxml2argvtest.c | 5 +++--
...e.xml => qemuxml2xmlout-net-virtio-rxtxqueuesize.xml} | 2 +-
tests/qemuxml2xmltest.c | 2 +-
13 files changed, 71 insertions(+), 13 deletions(-)
rename tests/qemuxml2argvdata/{qemuxml2argv-net-virtio-rxqueuesize.args => qemuxml2argv-net-virtio-rxtxqueuesize.args} (85%)
rename tests/qemuxml2argvdata/{qemuxml2argv-net-virtio-rxqueuesize.xml => qemuxml2argv-net-virtio-rxtxqueuesize.xml} (93%)
rename tests/qemuxml2xmloutdata/{qemuxml2xmlout-net-virtio-rxqueuesize.xml => qemuxml2xmlout-net-virtio-rxtxqueuesize.xml} (96%)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index c12efcf78..58662cf48 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -5071,7 +5071,7 @@ qemu-kvm -net nic,model=? /dev/null
<source network='default'/>
<target dev='vnet1'/>
<model type='virtio'/>
- <b><driver name='vhost' txmode='iothread' ioeventfd='on' event_idx='off' queues='5' rx_queue_size='256'>
+ <b><driver name='vhost' txmode='iothread' ioeventfd='on' event_idx='off' queues='5' rx_queue_size='256' tx_queue_size='256'>
<host csum='off' gso='off' tso4='off' tso6='off' ecn='off' ufo='off' mrg_rxbuf='off'/>
<guest csum='off' tso4='off' tso6='off' ecn='off' ufo='off'/>
</driver>
@@ -5201,6 +5201,20 @@ qemu-kvm -net nic,model=? /dev/null
<b>In general you should leave this option alone, unless you
are very certain you know what you are doing.</b>
</dd>
+ <dt><code>tx_queue_size</code></dt>
+ <dd>
+ The optional <code>tx_queue_size</code> attribute controls
+ the size of virtio ring for each queue as described above.
+ The default value is hypervisor dependent and may change
+ across its releases. Moreover, some hypervisors may pose
+ some restrictions on actual value. For instance, latest
+ QEMU (as of 2017-07-13) requires value to be a power of two
+ from [256, 1024] range.
+ <span class="since">Since 3.6.0 (QEMU and KVM only)</span><br/><br/>
+
+ <b>In general you should leave this option alone, unless you
+ are very certain you know what you are doing.</b>
+ </dd>
<dt>virtio options</dt>
<dd>
For virtio interfaces,
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index fc1a40f96..6558a1b2d 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -2709,6 +2709,11 @@
<ref name='positiveInteger'/>
</attribute>
</optional>
+ <optional>
+ <attribute name='tx_queue_size'>
+ <ref name='positiveInteger'/>
+ </attribute>
+ </optional>
<optional>
<attribute name="txmode">
<choice>
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 3feeccb9f..c525936cb 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -9920,6 +9920,7 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
char *event_idx = NULL;
char *queues = NULL;
char *rx_queue_size = NULL;
+ char *tx_queue_size = NULL;
char *str = NULL;
char *filter = NULL;
char *internal = NULL;
@@ -10093,6 +10094,7 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
event_idx = virXMLPropString(cur, "event_idx");
queues = virXMLPropString(cur, "queues");
rx_queue_size = virXMLPropString(cur, "rx_queue_size");
+ tx_queue_size = virXMLPropString(cur, "tx_queue_size");
} else if (xmlStrEqual(cur->name, BAD_CAST "filterref")) {
if (filter) {
virReportError(VIR_ERR_XML_ERROR, "%s",
@@ -10490,6 +10492,16 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
}
def->driver.virtio.rx_queue_size = q;
}
+ if (tx_queue_size) {
+ unsigned int q;
+ if (virStrToLong_uip(tx_queue_size, NULL, 10, &q) < 0) {
+ virReportError(VIR_ERR_XML_DETAIL,
+ _("'tx_queue_size' attribute must be positive number: %s"),
+ tx_queue_size);
+ goto error;
+ }
+ def->driver.virtio.tx_queue_size = q;
+ }
if ((str = virXPathString("string(./driver/host/@csum)", ctxt))) {
if ((val = virTristateSwitchTypeFromString(str)) <= 0) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
@@ -10687,6 +10699,7 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
VIR_FREE(event_idx);
VIR_FREE(queues);
VIR_FREE(rx_queue_size);
+ VIR_FREE(tx_queue_size);
VIR_FREE(str);
VIR_FREE(filter);
VIR_FREE(type);
@@ -22558,6 +22571,9 @@ virDomainVirtioNetDriverFormat(char **outstr,
if (def->driver.virtio.rx_queue_size)
virBufferAsprintf(&buf, " rx_queue_size='%u'",
def->driver.virtio.rx_queue_size);
+ if (def->driver.virtio.tx_queue_size)
+ virBufferAsprintf(&buf, " tx_queue_size='%u'",
+ def->driver.virtio.tx_queue_size);
virDomainVirtioOptionsFormat(&buf, def->virtio);
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index af15ee8b5..e3c736dc7 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -969,6 +969,7 @@ struct _virDomainNetDef {
virTristateSwitch event_idx;
unsigned int queues; /* Multiqueue virtio-net */
unsigned int rx_queue_size;
+ unsigned int tx_queue_size;
struct {
virTristateSwitch csum;
virTristateSwitch gso;
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 04aa8d53c..5a060ae98 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -431,6 +431,9 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
"virtio.ats",
"loadparm",
"spapr-pci-host-bridge",
+
+ /* 265 */
+ "virtio-net.tx_queue_size",
);
@@ -1697,6 +1700,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioNet[] = {
{ "tx", QEMU_CAPS_VIRTIO_TX_ALG },
{ "event_idx", QEMU_CAPS_VIRTIO_NET_EVENT_IDX },
{ "rx_queue_size", QEMU_CAPS_VIRTIO_NET_RX_QUEUE_SIZE },
+ { "tx_queue_size", QEMU_CAPS_VIRTIO_NET_TX_QUEUE_SIZE },
{ "host_mtu", QEMU_CAPS_VIRTIO_NET_HOST_MTU },
};
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index 8250b57b4..6e094e92e 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -418,6 +418,9 @@ typedef enum {
QEMU_CAPS_LOADPARM, /* -machine loadparm */
QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, /* -device spapr-pci-host-bridge */
+ /* 265 */
+ QEMU_CAPS_VIRTIO_NET_TX_QUEUE_SIZE, /* virtio-net-*.tx_queue_size */
+
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 6ac26af3e..8ff6d2176 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -3733,6 +3733,14 @@ qemuBuildNicDevStr(virDomainDefPtr def,
}
virBufferAsprintf(&buf, ",rx_queue_size=%u", net->driver.virtio.rx_queue_size);
}
+ if (usingVirtio && net->driver.virtio.tx_queue_size) {
+ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_NET_TX_QUEUE_SIZE)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("virtio tx_queue_size option is not supported with this QEMU binary"));
+ goto error;
+ }
+ virBufferAsprintf(&buf, ",tx_queue_size=%u", net->driver.virtio.tx_queue_size);
+ }
if (usingVirtio && net->mtu) {
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_NET_HOST_MTU)) {
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 464d3a1f9..50095b7df 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -3169,11 +3169,17 @@ qemuDomainDeviceDefValidate(const virDomainDeviceDef *dev,
goto cleanup;
}
- if (STREQ_NULLABLE(net->model, "virtio") &&
- net->driver.virtio.rx_queue_size & (net->driver.virtio.rx_queue_size - 1)) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("rx_queue_size has to be a power of two"));
- goto cleanup;
+ if (STREQ_NULLABLE(net->model, "virtio")) {
+ if (net->driver.virtio.rx_queue_size & (net->driver.virtio.rx_queue_size - 1)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("rx_queue_size has to be a power of two"));
+ goto cleanup;
+ }
+ if (net->driver.virtio.tx_queue_size & (net->driver.virtio.tx_queue_size - 1)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("tx_queue_size has to be a power of two"));
+ goto cleanup;
+ }
}
if (net->mtu &&
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-rxqueuesize.args b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-rxtxqueuesize.args
similarity index 85%
rename from tests/qemuxml2argvdata/qemuxml2argv-net-virtio-rxqueuesize.args
rename to tests/qemuxml2argvdata/qemuxml2argv-net-virtio-rxtxqueuesize.args
index 07c358a02..c78da3d17 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-rxqueuesize.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-rxtxqueuesize.args
@@ -21,7 +21,7 @@ server,nowait \
-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-net-pci,rx_queue_size=512,vlan=0,id=net0,mac=00:11:22:33:44:55,\
-bus=pci.0,addr=0x3 \
+-device virtio-net-pci,rx_queue_size=512,tx_queue_size=1024,vlan=0,id=net0,\
+mac=00:11:22:33:44:55,bus=pci.0,addr=0x3 \
-net user,vlan=0,name=hostnet0 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-rxqueuesize.xml b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-rxtxqueuesize.xml
similarity index 93%
rename from tests/qemuxml2argvdata/qemuxml2argv-net-virtio-rxqueuesize.xml
rename to tests/qemuxml2argvdata/qemuxml2argv-net-virtio-rxtxqueuesize.xml
index d64e31df2..b51931d52 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-rxqueuesize.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-rxtxqueuesize.xml
@@ -22,7 +22,7 @@
<interface type='user'>
<mac address='00:11:22:33:44:55'/>
<model type='virtio'/>
- <driver rx_queue_size='512'/>
+ <driver rx_queue_size='512' tx_queue_size='1024'/>
</interface>
<memballoon model='virtio'/>
</devices>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index b95ea46be..e496ac468 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1160,8 +1160,9 @@ mymain(void)
QEMU_CAPS_VIRTIO_S390);
DO_TEST("net-virtio-ccw",
QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
- DO_TEST("net-virtio-rxqueuesize",
- QEMU_CAPS_VIRTIO_NET_RX_QUEUE_SIZE);
+ DO_TEST("net-virtio-rxtxqueuesize",
+ QEMU_CAPS_VIRTIO_NET_RX_QUEUE_SIZE,
+ QEMU_CAPS_VIRTIO_NET_TX_QUEUE_SIZE);
DO_TEST_PARSE_ERROR("net-virtio-rxqueuesize-invalid-size", NONE);
DO_TEST("net-eth", NONE);
DO_TEST("net-eth-ifname", NONE);
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-virtio-rxqueuesize.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-virtio-rxtxqueuesize.xml
similarity index 96%
rename from tests/qemuxml2xmloutdata/qemuxml2xmlout-net-virtio-rxqueuesize.xml
rename to tests/qemuxml2xmloutdata/qemuxml2xmlout-net-virtio-rxtxqueuesize.xml
index 78433026c..5c33a58ad 100644
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-virtio-rxqueuesize.xml
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-virtio-rxtxqueuesize.xml
@@ -29,7 +29,7 @@
<interface type='user'>
<mac address='00:11:22:33:44:55'/>
<model type='virtio'/>
- <driver rx_queue_size='512'/>
+ <driver rx_queue_size='512' tx_queue_size='1024'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
<input type='mouse' bus='ps2'/>
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 5e4b1d17f..724c8efd0 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -537,7 +537,7 @@ mymain(void)
DO_TEST("net-eth-ifname", NONE);
DO_TEST("net-eth-hostip", NONE);
DO_TEST("net-virtio-network-portgroup", NONE);
- DO_TEST("net-virtio-rxqueuesize", NONE);
+ DO_TEST("net-virtio-rxtxqueuesize", NONE);
DO_TEST("net-hostdev", NONE);
DO_TEST("net-hostdev-vfio", NONE);
DO_TEST("net-midonet", NONE);
--
2.13.0
7 years, 4 months
[libvirt] [PATCH] Revert "build: distribute tests/virfilecachedata"
by Pavel Hrdina
This reverts commit d3d422e00c995d50c4b78066367bfbc4f872f586.
Already fixed by commit 5a30b817ec93543c7a6cc93b5a6091a6666e377e.
---
Sigh, Dan pushed it before me while I was waiting for "make distcheck".
Well, that happens :)
tests/Makefile.am | 1 -
1 file changed, 1 deletion(-)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index c96216766c..542c4a5729 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -145,7 +145,6 @@ EXTRA_DIST = \
vircgroupdata \
virconfdata \
virfiledata \
- virfilecachedata \
virjsondata \
virmacmaptestdata \
virmock.h \
--
2.13.3
7 years, 4 months