[libvirt] question for <interface> in ethernet type and multiple queues in KVM (start VM failed)
by Wangrui (K)
Hi,
I use ethernet vif for VM (libvirt 1.1.0 qemu 1.5.1). xml as such
<interface type='ethernet'>
<script path='' />
<target dev='tap_mq'/>
<mac address='52:54:00:19:9e:4e'/>
<model type='virtio' />
<driver name='vhost' queues='2'/>
</interface>
tap_mq is a tap device with multi_queue property which was created on host by ip command, such as follows
#ip tuntap add tap_mq mode tap multi_queue
I want to use multiple queue feature for this vif so I set queues='2' in xml.
When start VM , an error occurs
"error: unsupported configuration: Multiqueue network is not supported for: ethernet".
This error is reported from function qemuBuildInterfaceCommandLine
/* Currently nothing besides TAP devices supports multiqueue. */
if (net->driver.virtio.queues > 0 &&
!(actualType == VIR_DOMAIN_NET_TYPE_NETWORK ||
actualType == VIR_DOMAIN_NET_TYPE_BRIDGE)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Multiqueue network is not supported for: %s"),
virDomainNetTypeToString(actualType));
return -1;
}
The comment specifies that only TAP device supports multiqueue. But VIR_DOMAIN_NET_TYPE_ETHERNET is also TAP device I think.
IMHO, libvirt can build qemu commandline as
"-device virtio-net,netdev=net1,mq=on,vectors=5,mac=52:54:00:19:9e:4e"
"-netdev type=tap,ifname=tap0,id=net1,vhost=on,vhostforce=on,queues=2".
Qemu can open tapfds and vhostfds by itself other than libvirt opens and transfers them to qemu in this case.
Or there's other way to use multiqueue feature in ethernet tpye ?
Regards,
Rui
10 years, 9 months
[libvirt] [PATCH] maint: use $(SED) instead of sed for syntax-check
by Roman Bogorodskiy
Some syntax-check rules use GNU sed specific regexps, so allow
to override which sed would be used to fix 'syntax-check' for
non GNU-userland systems.
---
cfg.mk | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/cfg.mk b/cfg.mk
index 207dfeb..bd984bd 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -614,7 +614,7 @@ sc_libvirt_unmarked_diagnostics:
$(_sc_search_regexp)
@{ grep -nE '\<$(func_re) *\(.*;$$' $$($(VC_LIST_EXCEPT)); \
grep -A1 -nE '\<$(func_re) *\(.*,$$' $$($(VC_LIST_EXCEPT)); } \
- | sed 's/_("\([^\"]\|\\.\)\+"//;s/[ ]"%s"//' \
+ | $(SED) 's/_("\([^\"]\|\\.\)\+"//;s/[ ]"%s"//' \
| grep '[ ]"' && \
{ echo '$(ME): found unmarked diagnostic(s)' 1>&2; \
exit 1; } || :
@@ -639,7 +639,7 @@ sc_prohibit_newline_at_end_of_diagnostic:
sc_prohibit_diagnostic_without_format:
@{ grep -nE '\<$(func_re) *\(.*;$$' $$($(VC_LIST_EXCEPT)); \
grep -A2 -nE '\<$(func_re) *\(.*,$$' $$($(VC_LIST_EXCEPT)); } \
- | sed -rn -e ':l; /[,"]$$/ {N;b l;}' \
+ | $(SED) -rn -e ':l; /[,"]$$/ {N;b l;}' \
-e '/(xenapiSessionErrorHandler|vah_(error|warning))/d' \
-e '/\<$(func_re) *\([^"]*"([^%"]|"\n[^"]*")*"[,)]/p' \
| grep -vE 'VIR_ERROR' && \
@@ -661,7 +661,7 @@ sc_prohibit_useless_translation:
# or \n on one side of the split.
sc_require_whitespace_in_translation:
@grep -n -A1 '"$$' $$($(VC_LIST_EXCEPT)) \
- | sed -ne ':l; /"$$/ {N;b l;}; s/"\n[^"]*"/""/g; s/\\n/ /g' \
+ | $(SED) -ne ':l; /"$$/ {N;b l;}; s/"\n[^"]*"/""/g; s/\\n/ /g' \
-e '/_(.*[^\ ]""[^\ ]/p' | grep . && \
{ echo '$(ME): missing whitespace at line split' 1>&2; \
exit 1; } || :
@@ -681,11 +681,11 @@ sc_preprocessor_indentation:
sc_spec_indentation:
@if cppi --version >/dev/null 2>&1; then \
for f in $$($(VC_LIST_EXCEPT) | grep '\.spec\.in$$'); do \
- sed -e 's|#|// #|; s|%ifn*\(arch\)* |#if a // |' \
+ $(SED) -e 's|#|// #|; s|%ifn*\(arch\)* |#if a // |' \
-e 's/%\(else\|endif\|define\)/#\1/' \
-e 's/^\( *\)\1\1\1#/#\1/' \
-e 's|^\( *[^#/ ]\)|// \1|; s|^\( */[^/]\)|// \1|' $$f \
- | cppi -a -c 2>&1 | sed "s|standard input|$$f|"; \
+ | cppi -a -c 2>&1 | $(SED) "s|standard input|$$f|"; \
done | { if grep . >&2; then false; else :; fi; } \
|| { echo '$(ME): incorrect preprocessor indentation' 1>&2; \
exit 1; }; \
@@ -777,7 +777,7 @@ sc_prohibit_cross_inclusion:
# elements added to the enum by using a _LAST marker.
sc_require_enum_last_marker:
@grep -A1 -nE '^[^#]*VIR_ENUM_IMPL *\(' $$($(VC_LIST_EXCEPT)) \
- | sed -ne '/VIR_ENUM_IMPL[^,]*,$$/N' \
+ | $(SED) -ne '/VIR_ENUM_IMPL[^,]*,$$/N' \
-e '/VIR_ENUM_IMPL[^,]*,[^,]*[^_,][^L,][^A,][^S,][^T,],/p' \
-e '/VIR_ENUM_IMPL[^,]*,[^,]\{0,4\},/p' \
| grep . && \
@@ -878,7 +878,7 @@ ifeq (0,$(MAKELEVEL))
# b653eda3ac4864de205419d9f41eec267cb89eeb
#
# Keep this logic in sync with autogen.sh.
- _submodule_hash = sed 's/^[ +-]//;s/ .*//'
+ _submodule_hash = $(SED) 's/^[ +-]//;s/ .*//'
_update_required := $(shell \
cd '$(srcdir)'; \
test -d .git || { echo 0; exit; }; \
--
1.8.4.3
10 years, 9 months
[libvirt] [PATCH] qemu: remove redundant virQEMUDriverGetConfig
by Tomoki Sekiyama
qemuDomainSetSchedulerParametersFlags() calls virQEMUDriverGetConfig() twice
and makes the reference counter leak. This removes redundant call.
---
src/qemu/qemu_driver.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 76f789e..ca971f3 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -9050,7 +9050,6 @@ qemuDomainSetSchedulerParametersFlags(virDomainPtr dom,
if (virDomainSetSchedulerParametersFlagsEnsureACL(dom->conn, vm->def, flags) < 0)
goto cleanup;
- cfg = virQEMUDriverGetConfig(driver);
if (!cfg->privileged) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("CPU tuning is not available in session mode"));
10 years, 9 months
[libvirt] [PATCH 0/3] Resolve recent/new Coverity warnings
by John Ferlan
For virlog.c and commandtest.c - it seems recent changes within the
modules have allowed Coverity to dig deeper and find different issues.
Not sure why Coverity has that "ability"... Since I was making changes,
figured I'd clean up the lxc_controller fd leak as well - these should
clean the Jenkins build environment.
John Ferlan (3):
Coverity: Resolve a CHECKED_RETURN message
Coverity: Resolve a FORWARD_NULL
Coverity: Resolve a RESOURCE_LEAK
src/lxc/lxc_controller.c | 14 ++++++++++----
src/util/virlog.c | 2 +-
tests/commandtest.c | 1 +
3 files changed, 12 insertions(+), 5 deletions(-)
--
1.8.5.3
10 years, 9 months
[libvirt] [libvirt-java] [PATCH] Set Java source level in pom
by Chris Ellis
Hi
Simple patch to set the Java source level within the pom, this makes it
easier to import the project into Eclipse. I've also added an ignore for
a local pom file.
I've added plugins to publish the sources and javadocs into Maven. This
allows Maven (and IDE integration) to automatically use the javadocs and
source. This should make life easier for users of libvirt-java.
Regards,
Chris
Chris Ellis (1):
Update pom to include Java source level
.gitignore | 1 +
pom.xml.in | 41 +++++++++++++++++++++++++++++++++++++++++
2 files changed, 42 insertions(+)
--
1.8.4.5
10 years, 9 months
[libvirt] [PATCHv2 0/2] Fix zero cpu shares handling
by Ján Tomko
Treat 0 as a valid value for cputune shares.
v1: https://www.redhat.com/archives/libvir-list/2014-March/msg00215.html
v2:
squashed the fixup that was sent as a separate patch to the first commit
and fixed two more occurences (one of them pointed out by Martin)
Ján Tomko (2):
Treat zero cpu shares as a valid value
Show the real cpu shares value in live xml
src/conf/domain_conf.c | 12 ++++----
src/conf/domain_conf.h | 1 +
src/lxc/lxc_cgroup.c | 13 ++++++--
src/lxc/lxc_driver.c | 8 ++++-
src/lxc/lxc_native.c | 8 +++--
src/parallels/parallels_driver.c | 1 +
src/qemu/qemu_cgroup.c | 14 ++++++---
src/qemu/qemu_command.c | 2 +-
src/qemu/qemu_driver.c | 13 ++++++--
src/vmx/vmx.c | 3 +-
.../qemuxml2argv-cputune-zero-shares.args | 5 ++++
.../qemuxml2argv-cputune-zero-shares.xml | 35 ++++++++++++++++++++++
tests/qemuxml2argvtest.c | 1 +
tests/qemuxml2xmltest.c | 1 +
14 files changed, 97 insertions(+), 20 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cputune-zero-shares.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cputune-zero-shares.xml
--
1.8.3.2
10 years, 9 months
[libvirt] [libivrt][RFC]Send "netdev_del" command after receive the DEVICE_DELETED event
by x00221466
Hi all:
There maybe a bug about detaching virtual net device(such as virtio nic、
RTL8138、E1000)。
When live detaching the net device, there are some problems:
(1)If the Guest OS don't support the hot plugging pci device, detach
the virtual network device by Libvirt, the "net device" in Qemu will
still exist, but "hostnet"(tap) in Qemu will be removed. so the net device
in Guest OS will be of no effect.
(2)If reject the nic in Guest OS, Qemu will remove the "net device",
then Qemu send DEVICE_DELETED to Libvirt, Libvirt receive the event
in event-loop thread and release info of the net device in
qemuDomainRemoveNetDevice func. but "hostnet" in Qemu still exist.
So next live attaching virtual net device will be failed because of
"Duplicate ID".
#virsh attach-device win2008_st_r2_64 net.xml --live
error: Failed to attach device from net.xml
error: internal error: unable to execute QEMU command 'netdev_add':
Duplicate ID 'hostnet0' for netdev
(3)In addition, in qemuDomainDetachNetDevice, detach net device func,
"netdev_del" command will be sent after sending "device_del" command
at once. So it is violent to remove the tap device before the net device
is completely removed.
So I think it's more logical that doing the work of sending Qemu command
"netdev_del" after receive the DEVICE_DELETED event. It can avoid the conflict
of device info between Libvirt side and Qemu side. I create a thread in
qemuDomainRemoveDevice,the handle of DEVICE_DELETED event, to execute QEMU
command "netdev_del". But I find there is another problem when sending monitor
msg in multiply threads. in "qemuMonitorSend", monitor lock maybe unlocked
and locked, so another thread has the opportunity to get the monitor lock,
and use the same monitor. It will occur error.
I wonder if it is workable that sending "netdev_del" command after receive the
DEVICE_DELETED event.
Thanks.
-xie
10 years, 9 months
[libvirt] [PATCH python 0/4] setup.py: Don't unconditionally run pkg-config
by Cole Robinson
This series reorganizes setup.py to not unconditionally call
pkg-config. This will allow 'setup.py clean' and 'setup.py --help'
to work correctly even if pkg-config or libvirt-devel aren't installed.
https://bugzilla.redhat.com/show_bug.cgi?id=1074170
Cole Robinson (4):
setup.py: Remove unused import
setup.py: Move module list building to its own function
setup.py: Make have_libvirt_lxc a function
setup.py: Allow running --help or clean without pkg-config
setup.py | 144 +++++++++++++++++++++++++++++++++++++--------------------------
1 file changed, 85 insertions(+), 59 deletions(-)
--
1.8.5.3
10 years, 9 months
[libvirt] [PATCH] bhyve: don't fail on busy tap devices
by Roman Bogorodskiy
We use virBhyveTapGetRealDeviceName() to map network interface name
to a real device path, trying to open possible devices and getting
names by ioctl.
Make it skip devices that fail to open with EBUSY because they're
most likely already used by other VMs.
---
src/bhyve/bhyve_command.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c
index 6d64c27..e569aab 100644
--- a/src/bhyve/bhyve_command.c
+++ b/src/bhyve/bhyve_command.c
@@ -69,6 +69,8 @@ virBhyveTapGetRealDeviceName(char *name)
goto cleanup;
}
if ((fd = open(devpath, O_RDWR)) < 0) {
+ if (errno == EBUSY)
+ continue;
virReportSystemError(errno, _("Unable to open '%s'"), devpath);
goto cleanup;
}
--
1.8.4.2
10 years, 9 months
[libvirt] [PATCH] libxl: Create log directory earlier
by Stefan Bader
Commit d9f19c30d054c86b15a304f4118baa4fa75af9d2 moved a lot of the
configuration setup into libxlDriverConfigNew().
However that tries to create the libxl/libxl-driver.log before the
libxl directory gets created in libxlStateInitialize().
This causes the daemon to fail on systems that have not had the directory
created before.
Move the code to create the libxl directory into libxlDriverConfigNew().
Signed-off-by: Stefan Bader <stefan.bader(a)canonical.com>
---
src/libxl/libxl_conf.c | 8 ++++++++
src/libxl/libxl_driver.c | 7 -------
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index a6bf1cf..56bb84a 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -1108,6 +1108,14 @@ libxlDriverConfigNew(void)
if (virAsprintf(&log_file, "%s/libxl-driver.log", cfg->logDir) < 0)
goto error;
+ if (virFileMakePath(cfg->logDir) < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("failed to create log dir '%s': %s"),
+ cfg->logDir,
+ virStrerror(errno, ebuf, sizeof(ebuf)));
+ goto error;
+ }
+
if ((cfg->logger_file = fopen(log_file, "a")) == NULL) {
VIR_ERROR(_("Failed to create log file '%s': %s"),
log_file, virStrerror(errno, ebuf, sizeof(ebuf)));
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index 0c6672b..e6316a7 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -306,13 +306,6 @@ libxlStateInitialize(bool privileged,
goto error;
libxl_driver->config = cfg;
- if (virFileMakePath(cfg->logDir) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("failed to create log dir '%s': %s"),
- cfg->logDir,
- virStrerror(errno, ebuf, sizeof(ebuf)));
- goto error;
- }
if (virFileMakePath(cfg->stateDir) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("failed to create state dir '%s': %s"),
--
1.7.9.5
10 years, 9 months