Re: [libvirt] [Qemu-devel] Qemu migration with vhost-user-blk on top of local storage
by Stefan Hajnoczi
On Wed, Jan 09, 2019 at 06:23:42PM +0800, wuzhouhui wrote:
> Hi everyone,
>
> I'm working qemu with vhost target (e.g. spdk), and I attempt to migrate VM with
> 2 local storages. One local storage is a regular file, e.g. /tmp/c74.qcow2, and
> the other is a malloc bdev that spdk created. This malloc bdev will exported to
> VM via vhost-user-blk. When I execute following command:
>
> virsh migrate --live --persistent --unsafe --undefinesource --copy-storage-all \
> --p2p --auto-converge --verbose --desturi qemu+tcp://<uri>/system vm0
>
> The libvirt reports:
>
> qemu-2.12.1: error: internal error: unable to execute QEMU command \
> 'nbd-server-add': Cannot find device=drive-virtio-disk1 nor \
> node_name=drive-virtio-disk1
Please post your libvirt domain XML.
> Does it means that qemu with spdk on top of local storage don't support migration?
>
> QEMU: 2.12.1
> SPDK: 18.10
vhost-user-blk bypasses the QEMU block layer, so NBD storage migration
at the QEMU level will not work for the vhost-user-blk disk.
Stefan
1 year
[libvirt] [PATCH v3] openvswitch: Add new port VLAN mode "dot1q-tunnel"
by luzhipeng@uniudc.com
From: ZhiPeng Lu <luzhipeng(a)uniudc.com>
Signed-off-by: ZhiPeng Lu <luzhipeng(a)uniudc.com>
---
v1->v2:
1. Fix "make syntax-check" failure
v2->v3:
1. remove other_config when updating vlan
docs/formatnetwork.html.in | 17 +++++++++--------
docs/schemas/networkcommon.rng | 1 +
src/conf/netdev_vlan_conf.c | 2 +-
src/util/virnetdevopenvswitch.c | 7 +++++++
src/util/virnetdevvlan.h | 1 +
5 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/docs/formatnetwork.html.in b/docs/formatnetwork.html.in
index 363a72b..3c1ae62 100644
--- a/docs/formatnetwork.html.in
+++ b/docs/formatnetwork.html.in
@@ -688,16 +688,17 @@
</p>
<p>
For network connections using Open vSwitch it is also possible
- to configure 'native-tagged' and 'native-untagged' VLAN modes
+ to configure 'native-tagged' and 'native-untagged' and 'dot1q-tunnel'
+ VLAN modes.
<span class="since">Since 1.1.0.</span> This is done with the
- optional <code>nativeMode</code> attribute on
- the <code><tag></code> subelement: <code>nativeMode</code>
- may be set to 'tagged' or 'untagged'. The <code>id</code>
- attribute of the <code><tag></code> subelement
- containing <code>nativeMode</code> sets which VLAN is considered
- to be the "native" VLAN for this interface, and
+ optional <code>nativeMode</code> attribute on the
+ <code><tag></code> subelement: <code>nativeMode</code>
+ may be set to 'tagged' or 'untagged' or 'dot1q-tunnel'.
+ The <code>id</code> attribute of the <code><tag></code>
+ subelement containing <code>nativeMode</code> sets which VLAN is
+ considered to be the "native" VLAN for this interface, and
the <code>nativeMode</code> attribute determines whether or not
- traffic for that VLAN will be tagged.
+ traffic for that VLAN will be tagged or QinQ.
</p>
<p>
<code><vlan></code> elements can also be specified in
diff --git a/docs/schemas/networkcommon.rng b/docs/schemas/networkcommon.rng
index 2699555..11c48ff 100644
--- a/docs/schemas/networkcommon.rng
+++ b/docs/schemas/networkcommon.rng
@@ -223,6 +223,7 @@
<choice>
<value>tagged</value>
<value>untagged</value>
+ <value>dot1q-tunnel</value>
</choice>
</attribute>
</optional>
diff --git a/src/conf/netdev_vlan_conf.c b/src/conf/netdev_vlan_conf.c
index dff49c6..79710d9 100644
--- a/src/conf/netdev_vlan_conf.c
+++ b/src/conf/netdev_vlan_conf.c
@@ -29,7 +29,7 @@
#define VIR_FROM_THIS VIR_FROM_NONE
VIR_ENUM_IMPL(virNativeVlanMode, VIR_NATIVE_VLAN_MODE_LAST,
- "default", "tagged", "untagged")
+ "default", "tagged", "untagged", "dot1q-tunnel")
int
virNetDevVlanParse(xmlNodePtr node, xmlXPathContextPtr ctxt, virNetDevVlanPtr def)
diff --git a/src/util/virnetdevopenvswitch.c b/src/util/virnetdevopenvswitch.c
index 8fe06fd..9fec30b 100644
--- a/src/util/virnetdevopenvswitch.c
+++ b/src/util/virnetdevopenvswitch.c
@@ -91,6 +91,11 @@ virNetDevOpenvswitchConstructVlans(virCommandPtr cmd, virNetDevVlanPtr virtVlan)
virCommandAddArg(cmd, "vlan_mode=native-untagged");
virCommandAddArgFormat(cmd, "tag=%d", virtVlan->nativeTag);
break;
+ case VIR_NATIVE_VLAN_MODE_DOT1Q_TUNNEL:
+ virCommandAddArg(cmd, "vlan_mode=dot1q-tunnel");
+ virCommandAddArg(cmd, "other_config:qinq-ethtype=802.1q");
+ virCommandAddArgFormat(cmd, "tag=%d", virtVlan->nativeTag);
+ break;
case VIR_NATIVE_VLAN_MODE_DEFAULT:
default:
break;
@@ -504,6 +509,8 @@ int virNetDevOpenvswitchUpdateVlan(const char *ifname,
"--", "--if-exists", "clear", "Port", ifname, "tag",
"--", "--if-exists", "clear", "Port", ifname, "trunk",
"--", "--if-exists", "clear", "Port", ifname, "vlan_mode",
+ "--", "--if-exists", "remove", "Port", ifname, "other_config",
+ "qinq-ethtype", NULL,
"--", "--if-exists", "set", "Port", ifname, NULL);
if (virNetDevOpenvswitchConstructVlans(cmd, virtVlan) < 0)
diff --git a/src/util/virnetdevvlan.h b/src/util/virnetdevvlan.h
index be85f59..0667f9d 100644
--- a/src/util/virnetdevvlan.h
+++ b/src/util/virnetdevvlan.h
@@ -29,6 +29,7 @@ typedef enum {
VIR_NATIVE_VLAN_MODE_DEFAULT = 0,
VIR_NATIVE_VLAN_MODE_TAGGED,
VIR_NATIVE_VLAN_MODE_UNTAGGED,
+ VIR_NATIVE_VLAN_MODE_DOT1Q_TUNNEL,
VIR_NATIVE_VLAN_MODE_LAST
} virNativeVlanMode;
--
1.8.3.1
1 year
[libvirt] [PATCH] Fix compile error for stable 1.2.9
by Yang hongyang
Seems a backport miss. An extra member is passed to struct
virLXCBasicMountInfo.
Signed-off-by: Yang hongyang <hongyang.yang(a)easystack.cn>
---
src/lxc/lxc_container.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index 28dabec..1c65fa9 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -760,7 +760,7 @@ typedef struct {
static const virLXCBasicMountInfo lxcBasicMounts[] = {
{ "proc", "/proc", "proc", MS_NOSUID|MS_NOEXEC|MS_NODEV, false, false },
- { "/proc/sys", "/proc/sys", NULL, MS_BIND|MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_RDONLY, false, false, false },
+ { "/proc/sys", "/proc/sys", NULL, MS_BIND|MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_RDONLY, false, false },
{ "sysfs", "/sys", "sysfs", MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_RDONLY, false, false },
{ "securityfs", "/sys/kernel/security", "securityfs", MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_RDONLY, true, true },
#if WITH_SELINUX
--
1.7.1
1 year
[libvirt] Supporting vhost-net and macvtap in libvirt for QEMU
by Anthony Liguori
Disclaimer: I am neither an SR-IOV nor a vhost-net expert, but I've CC'd
people that are who can throw tomatoes at me for getting bits wrong :-)
I wanted to start a discussion about supporting vhost-net in libvirt.
vhost-net has not yet been merged into qemu but I expect it will be soon
so it's a good time to start this discussion.
There are two modes worth supporting for vhost-net in libvirt. The
first mode is where vhost-net backs to a tun/tap device. This is
behaves in very much the same way that -net tap behaves in qemu today.
Basically, the difference is that the virtio backend is in the kernel
instead of in qemu so there should be some performance improvement.
Current, libvirt invokes qemu with -net tap,fd=X where X is an already
open fd to a tun/tap device. I suspect that after we merge vhost-net,
libvirt could support vhost-net in this mode by just doing -net
vhost,fd=X. I think the only real question for libvirt is whether to
provide a user visible switch to use vhost or to just always use vhost
when it's available and it makes sense. Personally, I think the later
makes sense.
The more interesting invocation of vhost-net though is one where the
vhost-net device backs directly to a physical network card. In this
mode, vhost should get considerably better performance than the current
implementation. I don't know the syntax yet, but I think it's
reasonable to assume that it will look something like -net
tap,dev=eth0. The effect will be that eth0 is dedicated to the guest.
On most modern systems, there is a small number of network devices so
this model is not all that useful except when dealing with SR-IOV
adapters. In that case, each physical device can be exposed as many
virtual devices (VFs). There are a few restrictions here though. The
biggest is that currently, you can only change the number of VFs by
reloading a kernel module so it's really a parameter that must be set at
startup time.
I think there are a few ways libvirt could support vhost-net in this
second mode. The simplest would be to introduce a new tag similar to
<source network='br0'>. In fact, if you probed the device type for the
network parameter, you could probably do something like <source
network='eth0'> and have it Just Work.
Another model would be to have libvirt see an SR-IOV adapter as a
network pool whereas it handled all of the VF management. Considering
how inflexible SR-IOV is today, I'm not sure whether this is the best model.
Has anyone put any more thought into this problem or how this should be
modeled in libvirt? Michael, could you share your current thinking for
-net syntax?
--
Regards,
Anthony Liguori
1 year
[libvirt PATCH v3 00/16] Add QEMU "-display dbus" support
by marcandre.lureau@redhat.com
From: Marc-André Lureau <marcandre.lureau(a)redhat.com>
Hi,
This series implements supports for the uQEMU "-display dbus" support, that
landed earlier this week for 7.0.
By default, libvirt will start a private VM bus (sharing and reusing the
existing "vmstate" VM bus & code).
The feature set should cover the needs to replace Spice as local client of choice,
including 3daccel/dmabuf, audio, clipboard sharing, usb redirection, and arbitrary
chardev/channels (for serial etc).
The test Gtk4 client is also in progress, currently in development at
https://gitlab.com/marcandre.lureau/qemu-display/. A few dependencies, such as
zbus, require an upcoming release. virt-viewer & boxes will need a port to Gtk4
to make use of the shared widget.
Comments welcome, as we can still adjust the QEMU side etc.
thanks
v3: after QEMU 7.0 dev cycle opening and merge
- rebased
- add 7.0 x86-64 capabilities (instead of tweaking 6.2)
- fix version annotations
Marc-André Lureau (16):
qemu: add chardev-vdagent capability check
qemu: add -display dbus capability check
qemucapabilitiestest: Add x64 test data for the qemu-7.0 development
cycle
conf: add <graphics type='dbus'>
qemu: start the D-Bus daemon for the display
qemu: add -display dbus support
virsh: refactor/split cmdDomDisplay()
virsh: report the D-Bus bus URI for domdisplay
conf: add <audio type='dbus'> support
qemu: add audio type 'dbus'
conf: add dbus <clipboard>
qemu: add dbus clipboard sharing
conf: add <serial type='dbus'>
qemu: add -chardev dbus support
qemu: add usbredir type 'dbus'
docs: document <graphics> type dbus
NEWS.rst | 7 +-
docs/formatdomain.rst | 43 +-
docs/schemas/basictypes.rng | 7 +
docs/schemas/domaincommon.rng | 71 +
src/bhyve/bhyve_command.c | 1 +
src/conf/domain_conf.c | 141 +-
src/conf/domain_conf.h | 15 +
src/conf/domain_validate.c | 41 +-
src/libxl/libxl_conf.c | 1 +
src/qemu/qemu_capabilities.c | 8 +
src/qemu/qemu_capabilities.h | 4 +
src/qemu/qemu_command.c | 77 +-
src/qemu/qemu_domain.c | 1 +
src/qemu/qemu_driver.c | 10 +-
src/qemu/qemu_extdevice.c | 13 +
src/qemu/qemu_hotplug.c | 1 +
src/qemu/qemu_monitor_json.c | 10 +
src/qemu/qemu_process.c | 41 +-
src/qemu/qemu_validate.c | 33 +
src/security/security_dac.c | 2 +
src/vmx/vmx.c | 1 +
.../domaincapsdata/qemu_7.0.0-q35.x86_64.xml | 231 +
.../domaincapsdata/qemu_7.0.0-tcg.x86_64.xml | 237 +
tests/domaincapsdata/qemu_7.0.0.x86_64.xml | 231 +
.../caps_6.1.0.x86_64.xml | 1 +
.../caps_6.2.0.aarch64.xml | 1 +
.../caps_6.2.0.x86_64.xml | 1 +
.../caps_7.0.0.x86_64.replies | 37335 ++++++++++++++++
.../caps_7.0.0.x86_64.xml | 3720 ++
.../graphics-dbus-address.args | 30 +
.../graphics-dbus-address.xml | 35 +
.../qemuxml2argvdata/graphics-dbus-audio.args | 33 +
.../qemuxml2argvdata/graphics-dbus-audio.xml | 45 +
.../graphics-dbus-chardev.args | 32 +
.../graphics-dbus-chardev.xml | 43 +
.../graphics-dbus-clipboard.args | 31 +
.../graphics-dbus-clipboard.xml | 35 +
tests/qemuxml2argvdata/graphics-dbus-p2p.args | 30 +
tests/qemuxml2argvdata/graphics-dbus-p2p.xml | 33 +
.../graphics-dbus-usbredir.args | 34 +
.../graphics-dbus-usbredir.xml | 30 +
tests/qemuxml2argvdata/graphics-dbus.args | 30 +
tests/qemuxml2argvdata/graphics-dbus.xml | 33 +
tests/qemuxml2argvtest.c | 22 +
.../graphics-dbus-address.xml | 1 +
.../graphics-dbus-audio.xml | 1 +
.../graphics-dbus-chardev.xml | 1 +
.../graphics-dbus-clipboard.xml | 1 +
.../qemuxml2xmloutdata/graphics-dbus-p2p.xml | 1 +
tests/qemuxml2xmloutdata/graphics-dbus.xml | 1 +
tests/qemuxml2xmltest.c | 20 +
tools/virsh-domain.c | 366 +-
52 files changed, 42981 insertions(+), 192 deletions(-)
create mode 100644 tests/domaincapsdata/qemu_7.0.0-q35.x86_64.xml
create mode 100644 tests/domaincapsdata/qemu_7.0.0-tcg.x86_64.xml
create mode 100644 tests/domaincapsdata/qemu_7.0.0.x86_64.xml
create mode 100644 tests/qemucapabilitiesdata/caps_7.0.0.x86_64.replies
create mode 100644 tests/qemucapabilitiesdata/caps_7.0.0.x86_64.xml
create mode 100644 tests/qemuxml2argvdata/graphics-dbus-address.args
create mode 100644 tests/qemuxml2argvdata/graphics-dbus-address.xml
create mode 100644 tests/qemuxml2argvdata/graphics-dbus-audio.args
create mode 100644 tests/qemuxml2argvdata/graphics-dbus-audio.xml
create mode 100644 tests/qemuxml2argvdata/graphics-dbus-chardev.args
create mode 100644 tests/qemuxml2argvdata/graphics-dbus-chardev.xml
create mode 100644 tests/qemuxml2argvdata/graphics-dbus-clipboard.args
create mode 100644 tests/qemuxml2argvdata/graphics-dbus-clipboard.xml
create mode 100644 tests/qemuxml2argvdata/graphics-dbus-p2p.args
create mode 100644 tests/qemuxml2argvdata/graphics-dbus-p2p.xml
create mode 100644 tests/qemuxml2argvdata/graphics-dbus-usbredir.args
create mode 100644 tests/qemuxml2argvdata/graphics-dbus-usbredir.xml
create mode 100644 tests/qemuxml2argvdata/graphics-dbus.args
create mode 100644 tests/qemuxml2argvdata/graphics-dbus.xml
create mode 120000 tests/qemuxml2xmloutdata/graphics-dbus-address.xml
create mode 120000 tests/qemuxml2xmloutdata/graphics-dbus-audio.xml
create mode 120000 tests/qemuxml2xmloutdata/graphics-dbus-chardev.xml
create mode 120000 tests/qemuxml2xmloutdata/graphics-dbus-clipboard.xml
create mode 120000 tests/qemuxml2xmloutdata/graphics-dbus-p2p.xml
create mode 120000 tests/qemuxml2xmloutdata/graphics-dbus.xml
--
2.34.1.8.g35151cf07204
2 years, 6 months
[PATCH v2 00/19] Refactoring conf to use XPath
by Kristina Hanicova
This is v2 from
https://listman.redhat.com/archives/libvir-list/2021-April/msg00617.html
Changes since v1:
- rebase to the lastest git master
This series reworks the outdated way of parsing XML to parsing by XPath,
which is more obvious and saves a few lines of code.
Kristina Hanicova (19):
conf: Propagate xmlXPathContextPtr into
virDomainHostdevSubsysUSBDefParseXML()
Refactoring virDomainHostdevSubsysUSBDefParseXML() to use XPath
conf: Propagate xmlXPathContextPtr into virDomainBlkioDeviceParseXML()
Refactoring virDomainBlkioDeviceParseXML() to use XPath
conf: Propagate xmlXPathContextPtr into
virDomainHostdevSubsysPCIDefParseXML()
Refactoring virDomainHostdevSubsysPCIDefParseXML() to use XPath
conf: Propagate xmlXPathContextPtr into virDomainLeaseDefParseXML()
Refactoring virDomainLeaseDefParseXML() to use XPath
Refactoring virDomainFSDefParseXML() to use XPath
Refactoring virDomainNetDefParseXML() to use XPath
conf: Propagate xmlXPathContextPtr into
virDomainChrDefParseTargetXML()
Refactoring virDomainChrDefParseTargetXML() to use XPath
Refactoring virDomainChrSourceDefParseXML() to use XPath
Refactoring virDomainChrDefParseXML() to use XPath
Refactoring virDomainSmartcardDefParseXML() to use XPath
Refactoring virDomainGraphicsDefParseXMLSpice() to use XPath
conf: Propagate xmlXPathContextPtr into
virDomainVideoDriverDefParseXML()
Refactoring virDomainVideoDriverDefParseXML() to use XPath
Refactoring virDomainVideoDefParseXML() to use XPath
src/conf/domain_conf.c | 1641 +++++++++++++++++-----------------------
1 file changed, 707 insertions(+), 934 deletions(-)
--
2.30.2
2 years, 8 months
[PATCH 0/3] network: Generate TFTP config regardless of DHCP
by Michal Privoznik
See 3/3 for explanation.
Michal Prívozník (3):
network: Initialize variables in networkDnsmasqConfContents()
network: Separate DHCP config generator into a function
network: Generate TFTP config regardless of DHCP
src/network/bridge_driver.c | 262 ++++++++++--------
.../networkxml2confdata/netboot-network.conf | 4 +-
tests/networkxml2confdata/netboot-tftp.conf | 13 +
tests/networkxml2confdata/netboot-tftp.xml | 9 +
tests/networkxml2conftest.c | 1 +
tests/networkxml2xmlin/netboot-tftp.xml | 1 +
tests/networkxml2xmlout/netboot-tftp.xml | 1 +
tests/networkxml2xmltest.c | 1 +
8 files changed, 172 insertions(+), 120 deletions(-)
create mode 100644 tests/networkxml2confdata/netboot-tftp.conf
create mode 100644 tests/networkxml2confdata/netboot-tftp.xml
create mode 120000 tests/networkxml2xmlin/netboot-tftp.xml
create mode 120000 tests/networkxml2xmlout/netboot-tftp.xml
--
2.32.0
2 years, 9 months
[libvirt PATCH] qemu_firmware: don't error out for unknown firmware features
by Pavel Hrdina
When QEMU introduces new firmware features libvirt will fail until we
list that feature in our code as well which doesn't sound right.
We should simply ignore the new feature until we add a proper support
for it.
Reported-by: Laszlo Ersek <lersek(a)redhat.com>
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/qemu/qemu_firmware.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/qemu/qemu_firmware.c b/src/qemu/qemu_firmware.c
index 94e88ebe4b..e37a7edefa 100644
--- a/src/qemu/qemu_firmware.c
+++ b/src/qemu/qemu_firmware.c
@@ -567,6 +567,7 @@ qemuFirmwareFeatureParse(const char *path,
virJSONValue *featuresJSON;
g_autoptr(qemuFirmwareFeature) features = NULL;
size_t nfeatures;
+ size_t nparsed = 0;
size_t i;
if (!(featuresJSON = virJSONValueObjectGetArray(doc, "features"))) {
@@ -586,17 +587,16 @@ qemuFirmwareFeatureParse(const char *path,
int tmp;
if ((tmp = qemuFirmwareFeatureTypeFromString(tmpStr)) <= 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("unknown feature %s"),
- tmpStr);
- return -1;
+ VIR_DEBUG("unknown feature %s", tmpStr);
+ continue;
}
- features[i] = tmp;
+ features[nparsed] = tmp;
+ nparsed++;
}
fw->features = g_steal_pointer(&features);
- fw->nfeatures = nfeatures;
+ fw->nfeatures = nparsed;
return 0;
}
--
2.30.2
2 years, 9 months