[libvirt] Repack git repo?
by Michal Privoznik
So I was checking out the repo the other day and it took ages. So it got
me thinking what might be the problem. Looks like a part of it is that
our pack is split among ~250 files. Therefore when somebody does
checkout git needs to repack it into a single pack every time. And this
may take ages on such slow processor as Atom is. However, reading some
docs on this it looks like 'git gc --aggressive' is not advised rather
than 'git repack'.
Any thoughts?
Michal
7 years, 3 months
[libvirt] [PATCH python] include usable memory in virDomainMemoryStats
by Tomáš Golembiovský
Signed-off-by: Tomáš Golembiovský <tgolembi(a)redhat.com>
---
libvirt-override.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libvirt-override.c b/libvirt-override.c
index 0abfc37..832e05c 100644
--- a/libvirt-override.c
+++ b/libvirt-override.c
@@ -398,6 +398,9 @@ libvirt_virDomainMemoryStats(PyObject *self ATTRIBUTE_UNUSED,
case VIR_DOMAIN_MEMORY_STAT_RSS:
key = libvirt_constcharPtrWrap("rss");
break;
+ case VIR_DOMAIN_MEMORY_STAT_USABLE:
+ key = libvirt_constcharPtrWrap("usable");
+ break;
default:
continue;
}
--
2.13.3
7 years, 3 months
[libvirt] [PATCH 00/24] qemu: refactor node name detection
by Peter Krempa
Since query-blockstats provides full hierarchy of node names without any doubtful
matching algorithm, use it to make the node name detector reliable.
Unfortunately some of the changes are ugly when viewed as a diff since they
delete and rewrite chunks of code.
This series can be fetched at:
git fetch git://pipo.sk/pipo/libvirt.git node-name-detect-refactor-1
Peter Krempa (24):
qemu: monitor: Extract call of 'query-blockstats' and add new API for
it
tests: qemumonitorjson: Consolidate basic node name detection test
cases
tests: qemumonitor: Prepare for more test data in
testBlockNodeNameDetect
tests: qemumonitorjson: Drop redundant data from
testBlockNodeNameDetectFormat
tests: utils: Don't calculate file size in virTestLoadFile
util: buffer: Add virBufferStrcatVArgs
tests: utils: Add virTestLoadFilePath helper
tests: qemuhelp: convert to virTestLoadFilePath
tests: utils: Add virTestLoadFileJSON helper
tests: qemumonitorjson: simplify path handling in
testBlockNodeNameDetect
tests: qemumontitorjson: temporarily disable node name detection tests
qemu: block: Rename qemuBlockFillNodeData and move it to the top
util: storagefile: rename 'nodebacking' to 'nodestorage' in
virStorageSource
qemu: block: Refactor node name detection code
tests: Extract mock library for making hash table deterministic
tests: qemumonitorjson: Simplify node name detection test
qemu: block: store and test driver names for detected storage nodes
tests: qemumonitorjson: Add data and fix 'same-backing' node detection
case
tests: qemumonitorjson: Fix 'relative' node name detection test case
tests: qemumonitorjson: Fix 'gluster' node name detection test case
tests: qemumonitorjson: Add test case for node name detection with
blockjob
tests: qemumonitorjson: Old and empty test case for node name
detection
tests: qemumonitorjson: Test extraction of LUKS node names
tests: qemumonitorjson: Test extraction of iSCSI device node names
src/libvirt_private.syms | 1 +
src/qemu/qemu_block.c | 344 ++-
src/qemu/qemu_block.h | 12 +-
src/qemu/qemu_driver.c | 10 +-
src/qemu/qemu_monitor.c | 15 +
src/qemu/qemu_monitor.h | 2 +
src/qemu/qemu_monitor_json.c | 44 +-
src/qemu/qemu_monitor_json.h | 2 +
src/util/virbuffer.c | 27 +-
src/util/virbuffer.h | 2 +
src/util/virstoragefile.c | 6 +-
src/util/virstoragefile.h | 2 +-
tests/Makefile.am | 17 +-
tests/qemuhelptest.c | 14 +-
.../qemumonitorjson-nodename-1.result | 15 -
.../qemumonitorjson-nodename-2.json | 2270 --------------------
.../qemumonitorjson-nodename-2.result | 60 -
.../qemumonitorjson-nodename-basic-blockstats.json | 166 ++
...emumonitorjson-nodename-basic-named-nodes.json} | 18 +-
.../qemumonitorjson-nodename-basic.result | 16 +
...mumonitorjson-nodename-blockjob-blockstats.json | 301 +++
...umonitorjson-nodename-blockjob-named-nodes.json | 682 ++++++
.../qemumonitorjson-nodename-blockjob.result | 26 +
.../qemumonitorjson-nodename-empty-blockstats.json | 2 +
...qemumonitorjson-nodename-empty-named-nodes.json | 2 +
.../qemumonitorjson-nodename-empty.result | 1 +
...emumonitorjson-nodename-gluster-blockstats.json | 111 +
...umonitorjson-nodename-gluster-named-nodes.json} | 90 +-
.../qemumonitorjson-nodename-gluster.result | 19 +-
.../qemumonitorjson-nodename-iscsi-blockstats.json | 113 +
...qemumonitorjson-nodename-iscsi-named-nodes.json | 114 +
.../qemumonitorjson-nodename-iscsi.result | 13 +
.../qemumonitorjson-nodename-luks-blockstats.json | 58 +
.../qemumonitorjson-nodename-luks-named-nodes.json | 109 +
.../qemumonitorjson-nodename-luks.result | 6 +
.../qemumonitorjson-nodename-old-blockstats.json | 160 ++
.../qemumonitorjson-nodename-old-named-nodes.json | 2 +
.../qemumonitorjson-nodename-old.result | 1 +
...mumonitorjson-nodename-relative-blockstats.json | 329 +++
...monitorjson-nodename-relative-named-nodes.json} | 26 +-
.../qemumonitorjson-nodename-relative.result | 56 +-
...nitorjson-nodename-same-backing-blockstats.json | 221 ++
...torjson-nodename-same-backing-named-nodes.json} | 16 +-
.../qemumonitorjson-nodename-same-backing.result | 32 +-
tests/qemumonitorjsontest.c | 97 +-
tests/testutils.c | 101 +-
tests/testutils.h | 6 +
...{virmacmapmock.c => virdeterministichashmock.c} | 0
tests/virmacmaptest.c | 2 +-
49 files changed, 2961 insertions(+), 2778 deletions(-)
delete mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-1.result
delete mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-2.json
delete mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-2.result
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-basic-blockstats.json
rename tests/qemumonitorjsondata/{qemumonitorjson-nodename-1.json => qemumonitorjson-nodename-basic-named-nodes.json} (96%)
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-basic.result
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-blockjob-blockstats.json
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-blockjob-named-nodes.json
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-blockjob.result
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-empty-blockstats.json
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-empty-named-nodes.json
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-empty.result
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-gluster-blockstats.json
rename tests/qemumonitorjsondata/{qemumonitorjson-nodename-gluster.json => qemumonitorjson-nodename-gluster-named-nodes.json} (89%)
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi-blockstats.json
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi-named-nodes.json
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi.result
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-luks-blockstats.json
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-luks-named-nodes.json
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-luks.result
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-old-blockstats.json
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-old-named-nodes.json
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-old.result
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-relative-blockstats.json
rename tests/qemumonitorjsondata/{qemumonitorjson-nodename-relative.json => qemumonitorjson-nodename-relative-named-nodes.json} (97%)
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-same-backing-blockstats.json
rename tests/qemumonitorjsondata/{qemumonitorjson-nodename-same-backing.json => qemumonitorjson-nodename-same-backing-named-nodes.json} (96%)
rename tests/{virmacmapmock.c => virdeterministichashmock.c} (100%)
--
2.13.2
7 years, 3 months
[libvirt] [PATCH v3 0/2] Allow saving VM state to pipe
by Chen Hanxiao
This series introduce flag VIR_DOMAIN_SAVE_DIRECT
to enable command 'save' to write to PIPE.
This will write QEMU_SAVE_MAGIC directly.
Base upon patches from Roy Keene <rkeene(a)knightpoint.com>
with some fixes.
Change from original patch:
1) Check whether the specified path is a PIPE.
2) Rebase on upstream.
3) Add doc for virsh command
v3:
add doc/news.xml
rebase on upstream
v2-resend:
rebase on upstream
v2:
rename VIR_DOMAIN_SAVE_PIPE to VIR_DOMAIN_SAVE_DIRECT
remove S_ISFIFO check
Chen Hanxiao (2):
qemu: Allow qemuDomainSaveMemory saving VM state to a pipe
virsh: introduce flage --direct for save command
docs/news.xml | 9 +++++++
include/libvirt/libvirt-domain.h | 1 +
src/qemu/qemu_driver.c | 54 ++++++++++++++++++++++++++--------------
tools/virsh-domain.c | 6 +++++
tools/virsh.pod | 5 +++-
5 files changed, 56 insertions(+), 19 deletions(-)
--
2.7.4
7 years, 3 months
[libvirt] [PATCH 0/2] Fix a couple of syntax check errors
by John Ferlan
Pushed under build breaker rule
John Ferlan (2):
docs: Fix syntax-check error
docs: Fix syntax-check error
docs/Makefile.am | 3 ++-
docs/manifest.json | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
--
2.9.4
7 years, 3 months
[libvirt] [PATCH] virCapabilitiesFormatCaches: free cpus_str right after use
by Ján Tomko
This will simplify the cleanup when we start checking for
buffer errors.
---
Pushed as trivial.
src/conf/capabilities.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c
index 0f99f3096..561a6cf9e 100644
--- a/src/conf/capabilities.c
+++ b/src/conf/capabilities.c
@@ -904,6 +904,7 @@ virCapabilitiesFormatCaches(virBufferPtr buf,
bank->size >> (kilos * 10),
kilos ? "KiB" : "B",
cpus_str);
+ VIR_FREE(cpus_str);
virBufferAdjustIndent(&controlBuf, indent + 4);
for (j = 0; j < bank->ncontrols; j++) {
@@ -937,8 +938,6 @@ virCapabilitiesFormatCaches(virBufferPtr buf,
} else {
virBufferAddLit(buf, "/>\n");
}
-
- VIR_FREE(cpus_str);
}
virBufferAdjustIndent(buf, -2);
--
2.13.0
7 years, 3 months
[libvirt] [PATCH] driver: conditionalize use of dlopen functions & use mingw-dlfcn
by Daniel P. Berrange
Not every platform is guaranteed to have dlopen/dlsym, so we should
conditionalize its use. Suprisingly it is actually present for Win32
via the mingw-dlfcn add on, but we should still conditionalize it.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
configure.ac | 2 +-
mingw-libvirt.spec.in | 2 ++
src/driver.c | 18 ++++++++++++++++--
3 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/configure.ac b/configure.ac
index b12b7fae1..2b3375138 100644
--- a/configure.ac
+++ b/configure.ac
@@ -328,7 +328,7 @@ dnl Availability of various common headers (non-fatal if missing).
AC_CHECK_HEADERS([pwd.h regex.h sys/un.h \
sys/poll.h syslog.h mntent.h net/ethernet.h linux/magic.h \
sys/un.h sys/syscall.h sys/sysctl.h netinet/tcp.h ifaddrs.h \
- libtasn1.h sys/ucred.h sys/mount.h stdarg.h])
+ libtasn1.h sys/ucred.h sys/mount.h stdarg.h dlfcn.h])
dnl Check whether endian provides handy macros.
AC_CHECK_DECLS([htole64], [], [], [[#include <endian.h>]])
AC_CHECK_FUNCS([stat stat64 __xstat __xstat64 lstat lstat64 __lxstat __lxstat64])
diff --git a/mingw-libvirt.spec.in b/mingw-libvirt.spec.in
index 553d14022..dcb0837f7 100644
--- a/mingw-libvirt.spec.in
+++ b/mingw-libvirt.spec.in
@@ -54,6 +54,8 @@ BuildRequires: mingw32-libxml2
BuildRequires: mingw64-libxml2
BuildRequires: mingw32-portablexdr
BuildRequires: mingw64-portablexdr
+BuildRequires: mingw32-dlfcn
+BuildRequires: mingw64-dlfcn
BuildRequires: pkgconfig
# Need native version for msgfmt
diff --git a/src/driver.c b/src/driver.c
index 2e7dd01df..04dd0a443 100644
--- a/src/driver.c
+++ b/src/driver.c
@@ -34,10 +34,11 @@ VIR_LOG_INIT("driver");
/* XXX re-implement this for other OS, or use libtools helper lib ? */
-
-#include <dlfcn.h>
#define DEFAULT_DRIVER_DIR LIBDIR "/libvirt/connection-driver"
+#ifdef HAVE_DLFCN_H
+# include <dlfcn.h>
+
static void *
virDriverLoadModuleFile(const char *file)
@@ -126,6 +127,19 @@ virDriverLoadModuleFull(const char *path,
return ret;
}
+#else /* ! HAVE_DLFCN_H */
+int
+virDriverLoadModuleFull(const char *path ATTRIBUTE_UNUSED,
+ const char *regfunc ATTRIBUTE_UNUSED,
+ void **handle)
+{
+ VIR_DEBUG("dlopen not available on this platform");
+ if (handle)
+ *handle = NULL;
+ return -1;
+}
+#endif /* ! HAVE_DLFCN_H */
+
int
virDriverLoadModule(const char *name,
--
2.13.3
7 years, 3 months
[libvirt] [PATCH v3] 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 v2:
- rebase to current HEAD
There's no fundamental change since v1. It's just discussion on this patch that
makes me send newer versions because the older ones do not apply cleanly
anymore.
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 | 1 +
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, 68 insertions(+), 14 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 91195be0b..47e21c10d 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -5074,7 +5074,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>
@@ -5204,6 +5204,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 a49ce9303..3f56d8f45 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -2711,6 +2711,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 34c8f45ed..c3a167576 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -9833,6 +9833,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;
@@ -10006,6 +10007,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",
@@ -10403,6 +10405,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,
@@ -10600,6 +10612,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);
@@ -22497,6 +22510,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 239b21813..f857f509e 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 afe70d00d..e61d2f7b0 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -435,7 +435,8 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
/* 265 */
"spapr-pci-host-bridge.numa_node",
- "vnc-multi-servers"
+ "vnc-multi-servers",
+ "virtio-net.tx_queue_size",
);
@@ -1705,6 +1706,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 8b856e1b2..8804cc781 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -422,6 +422,7 @@ typedef enum {
/* 265 */
QEMU_CAPS_SPAPR_PCI_HOST_BRIDGE_NUMA_NODE, /* spapr-pci-host-bridge.numa_node= */
QEMU_CAPS_VNC_MULTI_SERVERS, /* -vnc vnc=unix:/path */
+ 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 d1f5c3642..da6ddff6c 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -3725,6 +3725,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 6fe9aa855..fe27e1122 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -3226,11 +3226,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 c2c1767c7..aa83013a2 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1167,8 +1167,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 5b47b0711..bf4d507f6 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, 3 months
[libvirt] [dbus PATCH 0/9] code cleanup
by Pavel Hrdina
Pavel Hrdina (9):
util: move bus_path_for_domain and domain_from_bus_path
util: move and rename virDomainsFreep
domain: split domain code into separate file
events: split event code into separate file
util: rename function to follow libvirt naming rules
main: rename functions to follow libvirt naming rules
manager: rename functions and structures to follow libvirt naming
rules
domain: rename functions to follow libvirt naming rules
events: rename functions to follow libvirt naming rules
src/Makefile.am | 4 +-
src/domain.c | 549 +++++++++++++++++++++++++++++++++
src/domain.h | 10 +
src/events.c | 252 ++++++++++++++++
src/events.h | 9 +
src/main.c | 44 +--
src/manager.c | 920 ++++----------------------------------------------------
src/manager.h | 18 +-
src/util.c | 35 ++-
src/util.h | 39 ++-
10 files changed, 970 insertions(+), 910 deletions(-)
create mode 100644 src/domain.c
create mode 100644 src/domain.h
create mode 100644 src/events.c
create mode 100644 src/events.h
--
2.13.3
7 years, 3 months