[RFC DOCUMENT 00/12] kubevirt-and-kvm: Add documents
by Andrea Bolognani
Hello there!
Several weeks ago, a group of Red Hatters working on the
virtualization stack (primarily QEMU and libvirt) started a
conversation with developers from the KubeVirt project with the goal
of better understanding and documenting the interactions between the
two.
Specifically, we were interested in integration pain points, with the
underlying ideas being that only once those issues are understood it
becomes possible to look for solutions, and that better communication
would naturally lead to improvements on both sides.
This series of documents was born out of that conversation. We're
sharing them with the QEMU and libvirt communities in the hope that
they can be a valuable resource for understanding how the projects
they're working on are consumed by higher-level tools, and what
challenges are encountered in the process.
Note that, while the documents describe a number of potential
directions for things like development of new components, that's all
just brainstorming that naturally occurred as we were learning new
things: the actual design process should, and will, happen on the
upstream lists.
Right now the documents live in their own little git repository[1],
but the expectation is that eventually they will find a suitable
long-term home. The most likely candidate right now is the main
KubeVirt repository, but if you have other locations in mind please
do speak up!
I'm also aware of the fact that this delivery mechanism is fairly
unconventional, but I thought it would be the best way to spark a
discussion around these topics with the QEMU and libvirt developers.
Last but not least, please keep in mind that the documents are a work
in progress, and polish has been applied to them unevenly: while the
information presented is, to the best of our knowledge, all accurate,
some parts are in a rougher state than others. Improvements will
hopefully come over time - and if you feel like helping out in making
that happen, it would certainly be appreciated!
Looking forward to your feedback :)
[1] https://gitlab.com/abologna/kubevirt-and-kvm
--
Andrea Bolognani / Red Hat / Virtualization
4 years, 2 months
[libvirt PATCH] news: document recent esx API implementations
by Pino Toscano
Signed-off-by: Pino Toscano <ptoscano(a)redhat.com>
---
NEWS.rst | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/NEWS.rst b/NEWS.rst
index e992fbe471..7c723e6610 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -32,6 +32,13 @@ v6.8.0 (unreleased)
can now be passed using the ``passwd`` attribute on
the ``<graphics>`` element.
+ * esx: implement few APIs
+
+ The ``virConnectListAllNetworks()``, ``virDomainGetHostname()``, and
+ ``virDomainInterfaceAddresses()`` (only for
+ ``VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_AGENT`` source) APIs were implemented
+ in the esx driver.
+
* **Improvements**
* qemu: Allow migration over UNIX sockets
--
2.26.2
4 years, 2 months
[libvirt PATCH] news: add note about new virt-ssh-helper binary
by Daniel P. Berrangé
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
NEWS.rst | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/NEWS.rst b/NEWS.rst
index e992fbe471..13d2ff1d2f 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -32,6 +32,19 @@ v6.8.0 (unreleased)
can now be passed using the ``passwd`` attribute on
the ``<graphics>`` element.
+ * remote: ``virt-ssh-helper`` replaces ``nc`` for SSH tunnelling
+
+ Libvirt now provides a ``virt-ssh-helper`` binary on the server
+ side. The libvirt remote client will use this binary for setting
+ up an SSH tunnelled connection to hosts. If not present, it will
+ transparently fallback to the traditional ``nc`` tunnel. The new
+ binary makes it possible for libvirt to transparently connect
+ across hosts even if libvirt is built with a different installation
+ prefix on the client vs server. It also enables remote access to
+ the unprivileged per-user libvirt daemons(eg using a URI such as
+ ``qemu+ssh://hostname/session``. The only requirement is that
+ ``virt-ssh-helper`` is present in $PATH of the remote host.
+
* **Improvements**
* qemu: Allow migration over UNIX sockets
--
2.26.2
4 years, 2 months
[libvirt PATCH v4 00/11] remote: introduce a custom netcat impl for ssh tunnelling
by Daniel P. Berrangé
We have long had a problem with use of netcat for ssh tunnelling because
there's no guarantee the UNIX socket path the client builds will match
the UNIX socket path the remote host uses. We don't even allow session
mode SSH tunnelling for this reason. We also can't easily auto-spawn
libvirtd in session mode.
With the introduction of modular daemons we also have potential for two
completely different UNIX socket paths even for system mode, and the
client can't know which to use.
The solution to all these problems is to introduce a custom netcat impl.
Instead passing the UNIX socket path, we pass the libvirt driver URI.
The custom netcat then decides which socket path to use based on the
remote build host environment.
We still have to support netcat for interoperability with legacy libvirt
versions, but we can default to the new virt-nc.
v4: Now with many fixed bugs to make it actually work
v3: Now with more meson and less autotools !
Daniel P. Berrangé (11):
rpc: merge logic for generating remote SSH shell script
remote: push logic for default netcat binary into common helper
remote: split off enums into separate source file
remote: split out function for parsing URI scheme
remote: parse the remote transport string earlier
remote: split out function for constructing socket path
remote: extract logic for determining daemon to connect to
remote: introduce virt-ssh-helper binary
rpc: switch order of args in virNetClientNewSSH
rpc: use new virt-ssh-helper binary for remote tunnelling
remote: fix error reporting for invalid daemon mode
build-aux/syntax-check.mk | 2 +-
docs/uri.html.in | 24 +-
libvirt.spec.in | 2 +
po/POTFILES.in | 2 +
src/libvirt_remote.syms | 1 +
src/remote/meson.build | 18 ++
src/remote/remote_driver.c | 331 +++++--------------------
src/remote/remote_sockets.c | 277 +++++++++++++++++++++
src/remote/remote_sockets.h | 70 ++++++
src/remote/remote_ssh_helper.c | 425 +++++++++++++++++++++++++++++++++
src/rpc/virnetclient.c | 167 +++++++++----
src/rpc/virnetclient.h | 29 ++-
src/rpc/virnetsocket.c | 37 +--
src/rpc/virnetsocket.h | 4 +-
tests/virnetsockettest.c | 12 +-
15 files changed, 1030 insertions(+), 371 deletions(-)
create mode 100644 src/remote/remote_sockets.c
create mode 100644 src/remote/remote_sockets.h
create mode 100644 src/remote/remote_ssh_helper.c
--
2.26.2
4 years, 2 months
[PATCH V3] Modify virCPUarmCompare to perform compare actions
by Zhenyu Zheng
Modify virCPUarmCompare in cpu_arm.c to perform compare action.
This patch only adds host to host CPU compare, the rest cases
remains the same. This is useful for source and destination host
compare during migrations to avoid migration between different
CPU models that have different CPU freatures.
Signed-off-by: Zhenyu Zheng <zheng.zhenyu(a)outlook.com>
---
src/cpu/cpu_arm.c | 43 +++++++++++++++++++++++++++++++++++++++----
1 file changed, 39 insertions(+), 4 deletions(-)
diff --git a/src/cpu/cpu_arm.c b/src/cpu/cpu_arm.c
index 939a3b8390..b420b14e86 100644
--- a/src/cpu/cpu_arm.c
+++ b/src/cpu/cpu_arm.c
@@ -463,11 +463,46 @@ virCPUarmBaseline(virCPUDefPtr *cpus,
}
static virCPUCompareResult
-virCPUarmCompare(virCPUDefPtr host G_GNUC_UNUSED,
- virCPUDefPtr cpu G_GNUC_UNUSED,
- bool failMessages G_GNUC_UNUSED)
+virCPUarmCompare(virCPUDefPtr host,
+ virCPUDefPtr cpu,
+ bool failIncompatible
+)
{
- return VIR_CPU_COMPARE_IDENTICAL;
+ virCPUCompareResult ret = VIR_CPU_COMPARE_IDENTICAL;
+
+ /* Only support host to host CPU compare for ARM*/
+ if (cpu->type != VIR_CPU_TYPE_HOST)
+ return ret;
+
+ if (!host || !host->model) {
+ if (failIncompatible) {
+ virReportError(VIR_ERR_CPU_INCOMPATIBLE, "%s",
+ _("unknown host CPU"));
+ ret = VIR_CPU_COMPARE_ERROR;
+ } else {
+ VIR_WARN("unknown host CPU");
+ ret = VIR_CPU_COMPARE_INCOMPATIBLE;
+ }
+ return ret;
+ }
+
+ /* Compare vendor and model to check if CPUs are identical */
+ if (STRNEQ(host->vendor, cpu->vendor) ||
+ STRNEQ(host->model, cpu->model)) {
+ VIR_DEBUG("Host CPU model does not match required CPU model %s",
+ cpu->model);
+
+ if (failIncompatible) {
+ ret = VIR_CPU_COMPARE_ERROR;
+ virReportError(VIR_ERR_CPU_INCOMPATIBLE,
+ _("Host CPU model does not match required CPU model %s"),
+ cpu->model);
+ } else {
+ ret = VIR_CPU_COMPARE_INCOMPATIBLE;
+ }
+ }
+
+ return ret;
}
static int
--
2.20.1
4 years, 2 months
[PATCH v1 1/2] qemu: driver: use model name "host" for mode "host-passthrough"
by Collin Walling
When executing the hypervisor-cpu-compare/baseline commands and
the XML file contains a CPU definition using host-passthrough
and no model name, the commands will fail and return an error
message from the QMP response.
Let's fix this by checking for host-passthrough and a missing
model name after the CPU definition has been converted from
XML. If these conditions are matched, then the CPU definition's
model name will be set to "host".
Signed-off-by: Collin Walling <walling(a)linux.ibm.com>
---
src/qemu/qemu_driver.c | 41 +++++++++++++++++++++++++++++++----------
1 file changed, 31 insertions(+), 10 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 1cecef01f7..427d2419f3 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -12281,6 +12281,26 @@ qemuConnectCPUModelComparison(virQEMUCapsPtr qemuCaps,
}
+static int
+qemuConnectCheckCPUModel(virCPUDefPtr cpu)
+{
+ if (!cpu->model) {
+ /*
+ * On some architectures a model name is never present
+ * for the host-passthrough mode, so default it to "host"
+ */
+ if (cpu->mode == VIR_CPU_MODE_HOST_PASSTHROUGH) {
+ cpu->model = g_strdup("host");
+ } else {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("cpu parameter is missing a model name"));
+ return -1;
+ }
+ }
+ return 0;
+}
+
+
static int
qemuConnectCompareHypervisorCPU(virConnectPtr conn,
const char *emulator,
@@ -12336,15 +12356,9 @@ qemuConnectCompareHypervisorCPU(virConnectPtr conn,
if (virCPUDefParseXMLString(xmlCPU, VIR_CPU_TYPE_AUTO, &cpu) < 0)
goto cleanup;
- if (!cpu->model) {
- if (cpu->mode == VIR_CPU_MODE_HOST_PASSTHROUGH) {
- cpu->model = g_strdup("host");
- } else {
- virReportError(VIR_ERR_INVALID_ARG, "%s",
- _("cpu parameter is missing a model name"));
- goto cleanup;
- }
- }
+ if (qemuConnectCheckCPUModel(cpu) < 0)
+ goto cleanup;
+
ret = qemuConnectCPUModelComparison(qemuCaps, cfg->libDir,
cfg->user, cfg->group,
hvCPU, cpu, failIncompatible);
@@ -12470,10 +12484,17 @@ qemuConnectCPUModelBaseline(virQEMUCapsPtr qemuCaps,
if (VIR_ALLOC(baseline) < 0)
return NULL;
- if (virCPUDefCopyModel(baseline, cpus[0], false))
+ if (qemuConnectCheckCPUModel(cpus[0]) < 0)
+ return NULL;
+
+ if (virCPUDefCopyModel(baseline, cpus[0], false) < 0)
return NULL;
for (i = 1; i < ncpus; i++) {
+
+ if (qemuConnectCheckCPUModel(cpus[i]) < 0)
+ return NULL;
+
if (qemuMonitorGetCPUModelBaseline(proc->mon, baseline,
cpus[i], &result) < 0)
return NULL;
--
2.26.2
4 years, 2 months
[PATCH] virDomainNetFindIdx: add support for CCW addresses
by Cornelia Huck
Allow to match with CCW addresses in addition to PCI addresses
(and MAC addresses).
Signed-off-by: Cornelia Huck <cohuck(a)redhat.com>
---
src/conf/device_conf.c | 12 ++++++++++++
src/conf/device_conf.h | 3 +++
src/conf/domain_conf.c | 23 ++++++++++++++++++++++-
src/libvirt_private.syms | 1 +
4 files changed, 38 insertions(+), 1 deletion(-)
diff --git a/src/conf/device_conf.c b/src/conf/device_conf.c
index 9398191dfd84..87bf32bbc685 100644
--- a/src/conf/device_conf.c
+++ b/src/conf/device_conf.c
@@ -341,6 +341,18 @@ virDomainDeviceCCWAddressParseXML(xmlNodePtr node,
return 0;
}
+bool
+virDomainDeviceCCWAddressEqual(virDomainDeviceCCWAddressPtr addr1,
+ virDomainDeviceCCWAddressPtr addr2)
+{
+ if (addr1->cssid == addr2->cssid &&
+ addr1->ssid == addr2->ssid &&
+ addr1->devno == addr2->devno) {
+ return true;
+ }
+ return false;
+}
+
int
virDomainDeviceDriveAddressParseXML(xmlNodePtr node,
virDomainDeviceDriveAddressPtr addr)
diff --git a/src/conf/device_conf.h b/src/conf/device_conf.h
index d7395f220174..a51bdf10ee6e 100644
--- a/src/conf/device_conf.h
+++ b/src/conf/device_conf.h
@@ -207,6 +207,9 @@ void virPCIDeviceAddressFormat(virBufferPtr buf,
bool virDomainDeviceCCWAddressIsValid(virDomainDeviceCCWAddressPtr addr);
int virDomainDeviceCCWAddressParseXML(xmlNodePtr node,
virDomainDeviceCCWAddressPtr addr);
+bool virDomainDeviceCCWAddressEqual(virDomainDeviceCCWAddressPtr addr1,
+ virDomainDeviceCCWAddressPtr addr2);
+#define VIR_CCW_DEVICE_ADDRESS_FMT "%x.%x.%04x"
int virDomainDeviceDriveAddressParseXML(xmlNodePtr node,
virDomainDeviceDriveAddressPtr addr);
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 8d30557bdcbe..a91dbd4aa95b 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -17816,6 +17816,8 @@ virDomainNetFindIdx(virDomainDefPtr def, virDomainNetDefPtr net)
bool MACAddrSpecified = !net->mac_generated;
bool PCIAddrSpecified = virDomainDeviceAddressIsValid(&net->info,
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI);
+ bool CCWAddrSpecified = virDomainDeviceAddressIsValid(&net->info,
+ VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW);
for (i = 0; i < def->nnets; i++) {
if (MACAddrSpecified &&
@@ -17827,9 +17829,14 @@ virDomainNetFindIdx(virDomainDefPtr def, virDomainNetDefPtr net)
&net->info.addr.pci))
continue;
+ if (CCWAddrSpecified &&
+ !virDomainDeviceCCWAddressEqual(&def->nets[i]->info.addr.ccw,
+ &net->info.addr.ccw))
+ continue;
+
if (matchidx >= 0) {
/* there were multiple matches on mac address, and no
- * qualifying guest-side PCI address was given, so we must
+ * qualifying guest-side PCI/CCW address was given, so we must
* fail (NB: a USB address isn't adequate, since it may
* specify only vendor and product ID, and there may be
* multiples of those.
@@ -17859,6 +17866,14 @@ virDomainNetFindIdx(virDomainDefPtr def, virDomainNetDefPtr net)
net->info.addr.pci.bus,
net->info.addr.pci.slot,
net->info.addr.pci.function);
+ } else if (MACAddrSpecified && CCWAddrSpecified) {
+ virReportError(VIR_ERR_DEVICE_MISSING,
+ _("no device matching MAC address %s found on "
+ VIR_CCW_DEVICE_ADDRESS_FMT),
+ virMacAddrFormat(&net->mac, mac),
+ net->info.addr.ccw.cssid,
+ net->info.addr.ccw.ssid,
+ net->info.addr.ccw.devno);
} else if (PCIAddrSpecified) {
virReportError(VIR_ERR_DEVICE_MISSING,
_("no device found on " VIR_PCI_DEVICE_ADDRESS_FMT),
@@ -17866,6 +17881,12 @@ virDomainNetFindIdx(virDomainDefPtr def, virDomainNetDefPtr net)
net->info.addr.pci.bus,
net->info.addr.pci.slot,
net->info.addr.pci.function);
+ } else if (CCWAddrSpecified) {
+ virReportError(VIR_ERR_DEVICE_MISSING,
+ _("no device found on " VIR_CCW_DEVICE_ADDRESS_FMT),
+ net->info.addr.ccw.cssid,
+ net->info.addr.ccw.ssid,
+ net->info.addr.ccw.devno);
} else if (MACAddrSpecified) {
virReportError(VIR_ERR_DEVICE_MISSING,
_("no device matching MAC address %s found"),
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 1db9970cca08..6bcbfa667d0e 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -128,6 +128,7 @@ virDeviceInfoPCIAddressIsWanted;
virDomainDeviceAddressIsValid;
virDomainDeviceAddressTypeToString;
virDomainDeviceCcidAddressParseXML;
+virDomainDeviceCCWAddressEqual;
virDomainDeviceCCWAddressIsValid;
virDomainDeviceCCWAddressParseXML;
virDomainDeviceDriveAddressParseXML;
--
2.25.4
4 years, 2 months
[PATCH] qemuxml2argvtest: Append newline to tested error messages
by Peter Krempa
'virTestCompareToFile' automatically fixes newline if it is not present
in the input string but is present in the file. In this case we need to
append the erorr messages with a newline so that
VIR_TEST_REGENERATE_OUTPUT produces files which will pass syntax-check.
Fixes: 9ec77eef2df
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
tests/qemuxml2argvtest.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index a3c91fd5de..2b97eb80a4 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -621,9 +621,11 @@ testCompareXMLToArgv(const void *data)
VIR_TEST_DEBUG("no error was reported for expected parse error");
goto cleanup;
}
- if (flags & FLAG_EXPECT_PARSE_ERROR &&
- virTestCompareToFile(err->message, info->errfile) >= 0)
- goto ok;
+ if (flags & FLAG_EXPECT_PARSE_ERROR) {
+ g_autofree char *tmperr = g_strdup_printf("%s\n", NULLSTR(err->message));
+ if (virTestCompareToFile(tmperr, info->errfile) >= 0)
+ goto ok;
+ }
goto cleanup;
}
if (flags & FLAG_EXPECT_PARSE_ERROR) {
@@ -663,9 +665,11 @@ testCompareXMLToArgv(const void *data)
VIR_TEST_DEBUG("no error was reported for expected failure");
goto cleanup;
}
- if (flags & FLAG_EXPECT_FAILURE &&
- virTestCompareToFile(err->message, info->errfile) >= 0)
- goto ok;
+ if (flags & FLAG_EXPECT_FAILURE) {
+ g_autofree char *tmperr = g_strdup_printf("%s\n", NULLSTR(err->message));
+ if (virTestCompareToFile(tmperr, info->errfile) >= 0)
+ goto ok;
+ }
goto cleanup;
}
if (flags & FLAG_EXPECT_FAILURE) {
--
2.26.2
4 years, 2 months
[PATCH] cpu_map: Add EPYC-Rome model
by Markus Schade
Hi everyone,
I'd like to add support for the EPYC-Rome CPU model from qemu.
The following patch adds the model to cpu_map. While this allows to use
the model, I am aware that some tests are required as well.
However I am not certain what exactly is needed. I am happy to provide
CPU flags or any required information from an EPYC 7502 system
Signed-off-by: Markus Schade <markus.schade(a)hetzner.com>
diff --git a/src/cpu_map/index.xml b/src/cpu_map/index.xml
index 1486a29c65..fec01f324c 100644
--- a/src/cpu_map/index.xml
+++ b/src/cpu_map/index.xml
@@ -66,6 +66,7 @@
<include filename="x86_Opteron_G5.xml"/>
<include filename="x86_EPYC.xml"/>
<include filename="x86_EPYC-IBPB.xml"/>
+ <include filename="x86_EPYC-Rome.xml"/>
<!-- Hygon CPU models -->
<include filename="x86_Dhyana.xml"/>
diff --git a/src/cpu_map/meson.build b/src/cpu_map/meson.build
index 19daa7157b..b86612b6e0 100644
--- a/src/cpu_map/meson.build
+++ b/src/cpu_map/meson.build
@@ -32,6 +32,7 @@ cpumap_data = [
'x86_Dhyana.xml',
'x86_EPYC-IBPB.xml',
'x86_EPYC.xml',
+ 'x86_EPYC-Rome.xml',
'x86_features.xml',
'x86_Haswell-IBRS.xml',
'x86_Haswell-noTSX-IBRS.xml',
diff --git a/src/cpu_map/x86_EPYC-Rome.xml b/src/cpu_map/x86_EPYC-Rome.xml
new file mode 100644
index 0000000000..41d4123917
--- /dev/null
+++ b/src/cpu_map/x86_EPYC-Rome.xml
@@ -0,0 +1,81 @@
+<cpus>
+ <model name='EPYC-Rome'>
+ <decode host='on' guest='on'/>
+ <signature family='23' model='49'/>
+ <vendor name='AMD'/>
+ <feature name='3dnowprefetch'/>
+ <feature name='abm'/>
+ <feature name='adx'/>
+ <feature name='aes'/>
+ <feature name='amd-stibp'/>
+ <feature name='apic'/>
+ <feature name='arat'/>
+ <feature name='avx'/>
+ <feature name='avx2'/>
+ <feature name='bmi1'/>
+ <feature name='bmi2'/>
+ <feature name='clflush'/>
+ <feature name='clflushopt'/>
+ <feature name='clwb'/>
+ <feature name='clzero'/>
+ <feature name='cmov'/>
+ <feature name='cr8legacy'/>
+ <feature name='cx16'/>
+ <feature name='cx8'/>
+ <feature name='de'/>
+ <feature name='f16c'/>
+ <feature name='fma'/>
+ <feature name='fpu'/>
+ <feature name='fsgsbase'/>
+ <feature name='fxsr'/>
+ <feature name='fxsr_opt'/>
+ <feature name='ibpb'/>
+ <feature name='lahf_lm'/>
+ <feature name='lm'/>
+ <feature name='mca'/>
+ <feature name='mce'/>
+ <feature name='misalignsse'/>
+ <feature name='mmx'/>
+ <feature name='mmxext'/>
+ <feature name='monitor'/>
+ <feature name='movbe'/>
+ <feature name='msr'/>
+ <feature name='mtrr'/>
+ <feature name='nx'/>
+ <feature name='osvw'/>
+ <feature name='pae'/>
+ <feature name='pat'/>
+ <feature name='pclmuldq'/>
+ <feature name='pdpe1gb'/>
+ <feature name='perfctr_core'/>
+ <feature name='pge'/>
+ <feature name='pni'/>
+ <feature name='popcnt'/>
+ <feature name='pse'/>
+ <feature name='pse36'/>
+ <feature name='rdpid'/>
+ <feature name='rdrand'/>
+ <feature name='rdseed'/>
+ <feature name='rdtscp'/>
+ <feature name='sep'/>
+ <feature name='sha-ni'/>
+ <feature name='smap'/>
+ <feature name='smep'/>
+ <feature name='sse'/>
+ <feature name='sse2'/>
+ <feature name='sse4.1'/>
+ <feature name='sse4.2'/>
+ <feature name='sse4a'/>
+ <feature name='ssse3'/>
+ <feature name='svm'/>
+ <feature name='syscall'/>
+ <feature name='tsc'/>
+ <feature name='vme'/>
+ <feature name='wbnoinvd'/>
+ <feature name='xgetbv1'/>
+ <feature name='xsave'/>
+ <feature name='xsavec'/>
+ <feature name='xsaveerptr'/>
+ <feature name='xsaveopt'/>
+ </model>
+</cpus>
4 years, 2 months
[PATCH] util: stop probing for IFF_VNET_HDR
by Daniel P. Berrangé
This flag was added by Linux with:
commit f43798c27684ab925adde7d8acc34c78c6e50df8
Author: Rusty Russell <rusty(a)rustcorp.com.au>
Date: Thu Jul 3 03:48:02 2008 -0700
tun: Allow GSO using virtio_net_hdr
so we can assume all Linux distros we support have this flag available
and thus the compile time check is sufficient.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/util/virnetdevtap.c | 63 +----------------------------------------
1 file changed, 1 insertion(+), 62 deletions(-)
diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c
index cbce5c71b7..77c4d1c52c 100644
--- a/src/util/virnetdevtap.c
+++ b/src/util/virnetdevtap.c
@@ -183,66 +183,6 @@ virNetDevTapGetRealDeviceName(char *ifname G_GNUC_UNUSED)
}
-/**
- * virNetDevProbeVnetHdr:
- * @tapfd: a tun/tap file descriptor
- *
- * Check whether it is safe to enable the IFF_VNET_HDR flag on the
- * tap interface.
- *
- * Setting IFF_VNET_HDR enables QEMU's virtio_net driver to allow
- * guests to pass larger (GSO) packets, with partial checksums, to
- * the host. This greatly increases the achievable throughput.
- *
- * It is only useful to enable this when we're setting up a virtio
- * interface. And it is only *safe* to enable it when we know for
- * sure that a) qemu has support for IFF_VNET_HDR and b) the running
- * kernel implements the TUNGETIFF ioctl(), which qemu needs to query
- * the supplied tapfd.
- *
- * Returns 1 if VnetHdr is supported, 0 if not supported
- */
-#ifdef IFF_VNET_HDR
-static int
-virNetDevProbeVnetHdr(int tapfd)
-{
-# if defined(IFF_VNET_HDR) && defined(TUNGETFEATURES) && defined(TUNGETIFF)
- unsigned int features;
- struct ifreq dummy;
-
- if (ioctl(tapfd, TUNGETFEATURES, &features) != 0) {
- VIR_INFO("Not enabling IFF_VNET_HDR; "
- "TUNGETFEATURES ioctl() not implemented");
- return 0;
- }
-
- if (!(features & IFF_VNET_HDR)) {
- VIR_INFO("Not enabling IFF_VNET_HDR; "
- "TUNGETFEATURES ioctl() reports no IFF_VNET_HDR");
- return 0;
- }
-
- /* The kernel will always return -1 at this point.
- * If TUNGETIFF is not implemented then errno == EBADFD.
- */
- if (ioctl(tapfd, TUNGETIFF, &dummy) != -1 || errno != EBADFD) {
- VIR_INFO("Not enabling IFF_VNET_HDR; "
- "TUNGETIFF ioctl() not implemented");
- return 0;
- }
-
- VIR_INFO("Enabling IFF_VNET_HDR");
-
- return 1;
-# else
- (void) tapfd;
- VIR_INFO("Not enabling IFF_VNET_HDR; disabled at build time");
- return 0;
-# endif
-}
-#endif
-
-
#ifdef TUNSETIFF
/**
* virNetDevTapGenerateName:
@@ -363,8 +303,7 @@ int virNetDevTapCreate(char **ifname,
}
# ifdef IFF_VNET_HDR
- if ((flags & VIR_NETDEV_TAP_CREATE_VNET_HDR) &&
- virNetDevProbeVnetHdr(fd))
+ if (flags & VIR_NETDEV_TAP_CREATE_VNET_HDR)
ifr.ifr_flags |= IFF_VNET_HDR;
# endif
--
2.26.2
4 years, 2 months