[PATCH v3] util: support PCI passthrough net device stats collection
by zhenwei pi
Collect PCI passthrough net device stats from kernel by netlink
API.
Currently, libvirt can not get PCI passthrough net device stats,
run command:
#virsh domifstat instance --interface=52:54:00:2d:b2:35
error: Failed to get interface stats instance 52:54:00:2d:b2:35
error: internal error: Interface name not provided
The PCI device(usually SR-IOV virtual function device) is detached
while it's used in PCI passthrough mode. And we can not parse this
device from /proc/net/dev any more.
In this patch, libvirt check net device is VF of not firstly, then
query virNetDevVFInterfaceStats(new API).
virNetDevVFInterfaceStats parses VFs info of all PFs, compares MAC
address until the two MAC addresses match.
'#ip -s link show' can get the same result. Instead of parsing the
output result, implement this feature by libnl API.
Notice that this feature deponds on driver of PF.
Test on Mellanox ConnectX-4 Lx, it works well.
Also test on Intel Corporation 82599ES, it works, but only get 0.
(ip-link command get the same result).
IFLA_VF_STATS is supported since Linux-4.2, suggested by Laine,
just using defined(__linux__) && WITH_LIBNL is enough.
Signed-off-by: zhenwei pi <pizhenwei(a)bytedance.com>
---
src/libvirt_private.syms | 1 +
src/qemu/qemu_driver.c | 3 ++
src/util/virnetdev.c | 121 +++++++++++++++++++++++++++++++++++++++++++++++
src/util/virnetdev.h | 5 ++
4 files changed, 130 insertions(+)
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index bdbe3431b8..bcc40b8d69 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -2585,6 +2585,7 @@ virNetDevSetRcvMulti;
virNetDevSetupControl;
virNetDevSysfsFile;
virNetDevValidateConfig;
+virNetDevVFInterfaceStats;
# util/virnetdevbandwidth.h
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index ae715c01d7..f554010c40 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -10196,6 +10196,9 @@ qemuDomainInterfaceStats(virDomainPtr dom,
if (virDomainNetGetActualType(net) == VIR_DOMAIN_NET_TYPE_VHOSTUSER) {
if (virNetDevOpenvswitchInterfaceStats(net->ifname, stats) < 0)
goto cleanup;
+ } else if (virDomainNetGetActualType(net) == VIR_DOMAIN_NET_TYPE_HOSTDEV) {
+ if (virNetDevVFInterfaceStats(&net->mac, stats) < 0)
+ goto cleanup;
} else {
if (virNetDevTapInterfaceStats(net->ifname, stats,
!virDomainNetTypeSharesHostView(net)) < 0)
diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
index e1a4cc2bef..3d54d07606 100644
--- a/src/util/virnetdev.c
+++ b/src/util/virnetdev.c
@@ -1489,6 +1489,7 @@ static struct nla_policy ifla_vf_policy[IFLA_VF_MAX+1] = {
.maxlen = sizeof(struct ifla_vf_mac) },
[IFLA_VF_VLAN] = { .type = NLA_UNSPEC,
.maxlen = sizeof(struct ifla_vf_vlan) },
+ [IFLA_VF_STATS] = { .type = NLA_NESTED },
};
@@ -2265,6 +2266,116 @@ virNetDevSetNetConfig(const char *linkdev, int vf,
return 0;
}
+static struct nla_policy ifla_vfstats_policy[IFLA_VF_STATS_MAX+1] = {
+ [IFLA_VF_STATS_RX_PACKETS] = { .type = NLA_U64 },
+ [IFLA_VF_STATS_TX_PACKETS] = { .type = NLA_U64 },
+ [IFLA_VF_STATS_RX_BYTES] = { .type = NLA_U64 },
+ [IFLA_VF_STATS_TX_BYTES] = { .type = NLA_U64 },
+ [IFLA_VF_STATS_BROADCAST] = { .type = NLA_U64 },
+ [IFLA_VF_STATS_MULTICAST] = { .type = NLA_U64 },
+};
+
+static int
+virNetDevParseVfStats(struct nlattr **tb, virMacAddrPtr mac,
+ virDomainInterfaceStatsPtr stats)
+{
+ int ret = -1, len;
+ struct ifla_vf_mac *vf_lladdr;
+ struct nlattr *nla, *t[IFLA_VF_MAX+1];
+ struct nlattr *stb[IFLA_VF_STATS_MAX+1];
+
+ if (tb == NULL || mac == NULL || stats == NULL) {
+ return -1;
+ }
+
+ if (!tb[IFLA_VFINFO_LIST])
+ return -1;
+
+ len = nla_len(tb[IFLA_VFINFO_LIST]);
+
+ for (nla = nla_data(tb[IFLA_VFINFO_LIST]); nla_ok(nla, len);
+ nla = nla_next(nla, &len)) {
+ ret = nla_parse(t, IFLA_VF_MAX, nla_data(nla), nla_len(nla),
+ ifla_vf_policy);
+ if (ret < 0)
+ return -1;
+
+ if (t[IFLA_VF_MAC] == NULL) {
+ continue;
+ }
+
+ vf_lladdr = nla_data(t[IFLA_VF_MAC]);
+ if (virMacAddrCmpRaw(mac, vf_lladdr->mac)) {
+ continue;
+ }
+
+ if (t[IFLA_VF_STATS]) {
+ ret = nla_parse_nested(stb, IFLA_VF_STATS_MAX,
+ t[IFLA_VF_STATS],
+ ifla_vfstats_policy);
+ if (ret < 0)
+ return -1;
+
+ stats->rx_bytes = nla_get_u64(stb[IFLA_VF_STATS_RX_BYTES]);
+ stats->tx_bytes = nla_get_u64(stb[IFLA_VF_STATS_TX_BYTES]);
+ stats->rx_packets = nla_get_u64(stb[IFLA_VF_STATS_RX_PACKETS]);
+ stats->tx_packets = nla_get_u64(stb[IFLA_VF_STATS_TX_PACKETS]);
+ }
+ return 0;
+ }
+
+ return ret;
+}
+
+/**
+ * virNetDevVFInterfaceStats:
+ * @mac: MAC address of the VF interface
+ * @stats: returns stats of the VF interface
+ *
+ * Get the VF interface from kernel by netlink.
+ * Returns 0 on success, -1 on failure.
+ */
+int
+virNetDevVFInterfaceStats(virMacAddrPtr mac,
+ virDomainInterfaceStatsPtr stats)
+{
+ int rc = -1;
+ void *nlData = NULL;
+ struct nlattr *tb[IFLA_MAX + 1] = {NULL, };
+ char *sysfsDevicePath = NULL;
+ DIR *dirp = NULL;
+ struct dirent *dp;
+
+ if (virDirOpen(&dirp, SYSFS_NET_DIR) < 0)
+ return -1;
+
+ /* get all PCI net devices, and parse VFs list from netlink API.
+ * compare MAC address, collect device stats if matching.
+ */
+ while (virDirRead(dirp, &dp, SYSFS_NET_DIR) > 0) {
+ if (virNetDevSysfsFile(&sysfsDevicePath, dp->d_name, "device") < 0)
+ break;
+
+ if (virNetDevIsPCIDevice(sysfsDevicePath)) {
+ rc = virNetlinkDumpLink(dp->d_name, -1, &nlData, tb, 0, 0);
+ if (rc < 0) {
+ rc = -1;
+ goto cleanup;
+ }
+
+ rc = virNetDevParseVfStats(tb, mac, stats);
+ VIR_FREE(nlData);
+ if (rc == 0)
+ goto cleanup;
+ }
+ VIR_FREE(sysfsDevicePath);
+ }
+
+ cleanup:
+ VIR_FREE(sysfsDevicePath);
+ VIR_DIR_CLOSE(dirp);
+ return rc;
+}
#else /* defined(__linux__) && defined(WITH_LIBNL) && defined(IFLA_VF_MAX) */
@@ -2309,6 +2420,16 @@ virNetDevSetNetConfig(const char *linkdev G_GNUC_UNUSED,
}
+int
+virNetDevVFInterfaceStats(virMacAddrPtr mac G_GNUC_UNUSED,
+ virDomainInterfaceStatsPtr stats G_GNUC_UNUSED)
+{
+ virReportSystemError(ENOSYS, "%s",
+ _("Unable to get VF net device stats on this platform"));
+ return -1;
+}
+
+
#endif /* defined(__linux__) && defined(WITH_LIBNL) && defined(IFLA_VF_MAX) */
VIR_ENUM_IMPL(virNetDevIfState,
diff --git a/src/util/virnetdev.h b/src/util/virnetdev.h
index 5f581323ed..ff59d9d341 100644
--- a/src/util/virnetdev.h
+++ b/src/util/virnetdev.h
@@ -312,4 +312,9 @@ int virNetDevSysfsFile(char **pf_sysfs_device_link,
int virNetDevRunEthernetScript(const char *ifname, const char *script)
G_GNUC_NO_INLINE;
+int virNetDevVFInterfaceStats(virMacAddrPtr mac,
+ virDomainInterfaceStatsPtr stats)
+ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+
+
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNetDevRxFilter, virNetDevRxFilterFree);
--
2.11.0
4 years, 2 months
[PATCH] qemu.conf: Re-word the description for *_tls_x509_verify
by Fangge Jin
The original descirption for *_tls_x509_verify is a little misleading
by saying that "Enabling this option will reject any client who does
not have a ca-cert.pem certificate".
Signed-off-by: Fangge Jin <fjin(a)redhat.com>
---
src/qemu/qemu.conf | 20 ++++++++------------
1 file changed, 8 insertions(+), 12 deletions(-)
diff --git a/src/qemu/qemu.conf b/src/qemu/qemu.conf
index a96bedb114..b1bd3cecbd 100644
--- a/src/qemu/qemu.conf
+++ b/src/qemu/qemu.conf
@@ -109,9 +109,8 @@
# issuing an x509 certificate to every client who needs to connect.
#
# Enabling this option will reject any client that does not have a
-# ca-cert.pem certificate signed by the CA in the vnc_tls_x509_cert_dir
-# (or default_tls_x509_cert_dir) as well as the corresponding client-*.pem
-# files described in default_tls_x509_cert_dir.
+# certificate(as described in default_tls_x509_verify) signed by the
+# CA in the vnc_tls_x509_cert_dir (or default_tls_x509_cert_dir).
#
# If this option is not supplied, it will be set to the value of
# "default_tls_x509_verify".
@@ -248,9 +247,8 @@
# issuing an x509 certificate to every client who needs to connect.
#
# Enabling this option will reject any client that does not have a
-# ca-cert.pem certificate signed by the CA in the chardev_tls_x509_cert_dir
-# (or default_tls_x509_cert_dir) as well as the corresponding client-*.pem
-# files described in default_tls_x509_cert_dir.
+# certificate(as described in default_tls_x509_verify) signed by the
+# CA in the chardev_tls_x509_cert_dir (or default_tls_x509_cert_dir).
#
# If this option is not supplied, it will be set to the value of
# "default_tls_x509_verify".
@@ -375,9 +373,8 @@
# issuing an x509 certificate to every client who needs to connect.
#
# Enabling this option will reject any client that does not have a
-# ca-cert.pem certificate signed by the CA in the migrate_tls_x509_cert_dir
-# (or default_tls_x509_cert_dir) as well as the corresponding client-*.pem
-# files described in default_tls_x509_cert_dir.
+# certificate(as described in default_tls_x509_verify) signed by the
+# CA in the migrate_tls_x509_cert_dir (or default_tls_x509_cert_dir).
#
# If this option is not supplied, it will be set to the value of
# "default_tls_x509_verify".
@@ -412,9 +409,8 @@
# issuing an x509 certificate to every client who needs to connect.
#
# Enabling this option will reject any client that does not have a
-# ca-cert.pem certificate signed by the CA in the backup_tls_x509_cert_dir
-# (or default_tls_x509_cert_dir) as well as the corresponding client-*.pem
-# files described in default_tls_x509_cert_dir.
+# certificate(as described in default_tls_x509_verify) signed by the
+# CA in the backup_tls_x509_cert_dir (or default_tls_x509_cert_dir).
#
# If this option is not supplied, it will be set to the value of
# "default_tls_x509_verify".
--
2.20.1
4 years, 2 months
[PATCH] the leading space in volmode check will never match the leading tab output from zfs get
by richardburakowski@gmail.com
Signed-off-by: Richard Burakowski <richard.burakowski(a)gmail.com>
---
src/storage/storage_backend_zfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/storage/storage_backend_zfs.c b/src/storage/storage_backend_zfs.c
index dc692f47ed..439f5b2fd5 100644
--- a/src/storage/storage_backend_zfs.c
+++ b/src/storage/storage_backend_zfs.c
@@ -71,7 +71,7 @@ virStorageBackendZFSVolModeNeeded(void)
return ret;
}
- if (strstr(error, " volmode "))
+ if (strstr(error, "volmode "))
return 1;
else
return 0;
--
2.26.2
4 years, 2 months
[libvirt PATCH v3 0/8] Make unknown XML elements fail CPU comparison
by Tim Wiederhake
We currently ignore unknown elements in the CPU XML description, e.g.
with virsh cpu-compare and hypervisor-cpu-compare. This makes
'<cpu><faeture name="..."/></cpu>' (note the typo in "faeture")
semantically identic to '<cpu/>'. No error is reported.
This series adds checks for unrecognized attributes and elements in
the "<cpu>" element, catching this kind of mistake.
V1: https://www.redhat.com/archives/libvir-list/2020-September/msg00933.html
V2: https://www.redhat.com/archives/libvir-list/2020-September/msg01073.html
Changed:
* Added more detailed commit messages
* Added missing man page details
* Split the changes slightly differently in the commits
* CPU tests now always validate XML documents
* Fixed typo "nonexistant" -> "nonexistent"
Tim Wiederhake (8):
schema: Unify apostrophe and quotation mark usage
schema: Move host cpu definition to cputypes.rng
schema: Move guest cpu definition to cputypes.rng
schema: Add schema for guest or host cpu definition
util: Allow validation for single XML node
cpu: Wire in XML validation
virsh: Add "validate" argument to [hypervisor-]cpu-compare
tests: Add tests for unknown elements and attributes in cpu defintion
docs/manpages/virsh.rst | 9 +-
docs/schemas/basictypes.rng | 82 +--
docs/schemas/capability.rng | 466 ++++++---------
docs/schemas/cpu.rng | 12 +
docs/schemas/cputypes.rng | 117 +++-
docs/schemas/domain.rng | 10 +-
docs/schemas/domainbackup.rng | 178 +++---
docs/schemas/domaincaps.rng | 236 ++++----
docs/schemas/domaincheckpoint.rng | 62 +-
docs/schemas/domaincommon.rng | 431 +++++++-------
docs/schemas/domainsnapshot.rng | 104 ++--
docs/schemas/interface.rng | 6 +-
docs/schemas/meson.build | 1 +
docs/schemas/network.rng | 44 +-
docs/schemas/networkcommon.rng | 26 +-
docs/schemas/networkport.rng | 6 +-
docs/schemas/nodedev.rng | 464 +++++++--------
docs/schemas/nwfilter.rng | 32 +-
docs/schemas/nwfilterbinding.rng | 4 +-
docs/schemas/secret.rng | 70 +--
docs/schemas/storagecommon.rng | 110 ++--
docs/schemas/storagepool.rng | 584 +++++++++----------
docs/schemas/storagepoolcaps.rng | 64 +-
docs/schemas/storagevol.rng | 150 ++---
include/libvirt/libvirt-host.h | 2 +
src/bhyve/bhyve_driver.c | 7 +-
src/conf/cpu_conf.c | 25 +-
src/conf/cpu_conf.h | 6 +-
src/conf/domain_conf.c | 3 +-
src/cpu/cpu.c | 5 +-
src/cpu/cpu.h | 3 +-
src/libxl/libxl_driver.c | 7 +-
src/qemu/qemu_domain.c | 5 +-
src/qemu/qemu_driver.c | 18 +-
src/qemu/qemu_migration_cookie.c | 3 +-
src/util/virxml.c | 15 +
src/util/virxml.h | 6 +
tests/cputest.c | 28 +-
tests/cputestdata/x86_64-bogus-attribute.xml | 2 +
tests/cputestdata/x86_64-bogus-element.xml | 3 +
tools/virsh-host.c | 14 +
41 files changed, 1762 insertions(+), 1658 deletions(-)
create mode 100644 docs/schemas/cpu.rng
create mode 100644 tests/cputestdata/x86_64-bogus-attribute.xml
create mode 100644 tests/cputestdata/x86_64-bogus-element.xml
--
2.26.2
4 years, 2 months
[PATCH V4] 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 | 39 ++++++++++++++++++++++++++++++++++++---
1 file changed, 36 insertions(+), 3 deletions(-)
diff --git a/src/cpu/cpu_arm.c b/src/cpu/cpu_arm.c
index 939a3b8390..64bd0f03c2 100644
--- a/src/cpu/cpu_arm.c
+++ b/src/cpu/cpu_arm.c
@@ -463,10 +463,43 @@ 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
+)
{
+ /* Only support host to host CPU compare for ARM*/
+ if (cpu->type != VIR_CPU_TYPE_HOST)
+ return VIR_CPU_COMPARE_IDENTICAL;
+
+ if (!host || !host->model) {
+ if (failIncompatible) {
+ virReportError(VIR_ERR_CPU_INCOMPATIBLE, "%s",
+ _("unknown host CPU"));
+ return VIR_CPU_COMPARE_ERROR;
+ } else {
+ VIR_WARN("unknown host CPU");
+ return VIR_CPU_COMPARE_INCOMPATIBLE;
+ }
+ }
+
+ /* Compare vendor and model to check if CPUs are identical */
+ if (STRNEQ_NULLABLE(host->vendor, cpu->vendor) ||
+ STRNEQ_NULLABLE(host->model, cpu->model)) {
+ VIR_DEBUG("Host CPU model does not match required CPU "
+ "vendor %s or(and) model %s",
+ NULLSTR(cpu->vendor), NULLSTR(cpu->model));
+
+ if (failIncompatible) {
+ virReportError(VIR_ERR_CPU_INCOMPATIBLE,
+ _("Host CPU model does not match required CPU "
+ "vendor %s or(and) model %s"),
+ NULLSTR(cpu->vendor), NULLSTR(cpu->model));
+ return VIR_CPU_COMPARE_ERROR;
+ } else {
+ return VIR_CPU_COMPARE_INCOMPATIBLE;
+ }
+ }
return VIR_CPU_COMPARE_IDENTICAL;
}
--
2.20.1
4 years, 2 months
[libvirt PATCH 0/9] Make unknown XML elements fail CPU comparison
by Tim Wiederhake
We currently ignore unknown elements in the CPU XML description, e.g.
with virsh cpu-compare and hypervisor-cpu-compare. This makes
'<cpu><faeture name=3D"..."/></cpu>' (note the typo in "faeture")
semantically identic to '<cpu/>'. No error is reported.
This series adds checks for unrecognized attributes and elements in
the "<cpu>" element, catching this kind of mistake.
V1: https://www.redhat.com/archives/libvir-list/2020-September/msg00933.html
Changed:
* Factored out Schema defintion of different cpu elements
* Performing validation against actual schema
* Add "--validate" option to virsh [hypervisor-]cpu-compare to opt-in to vali=
dation
* Drive-by: Unify quotation style in docs/schemas/*
Tim Wiederhake (9):
schema: Unify apostrophe and quotation mark usage
schema: Move host cpu definition to cputypes.rng
schema: Move guest cpu definition to cputypes.rng
schema: Add schema for guest or host cpu definition
util: Allow validation for single XML node
cpu: Validate XML
virsh: Add "validate" argument to [hypervisor-]cpu-compare
tests: cpu: Allow passing flags to cpuTestLoadXML
tests: Add tests for unknown elements and attributes in cpu defintion
docs/schemas/basictypes.rng | 82 +--
docs/schemas/capability.rng | 466 ++++++---------
docs/schemas/cpu.rng | 12 +
docs/schemas/cputypes.rng | 117 +++-
docs/schemas/domain.rng | 10 +-
docs/schemas/domainbackup.rng | 178 +++---
docs/schemas/domaincaps.rng | 236 ++++----
docs/schemas/domaincheckpoint.rng | 62 +-
docs/schemas/domaincommon.rng | 431 +++++++-------
docs/schemas/domainsnapshot.rng | 104 ++--
docs/schemas/interface.rng | 6 +-
docs/schemas/meson.build | 1 +
docs/schemas/network.rng | 44 +-
docs/schemas/networkcommon.rng | 26 +-
docs/schemas/networkport.rng | 6 +-
docs/schemas/nodedev.rng | 464 +++++++--------
docs/schemas/nwfilter.rng | 32 +-
docs/schemas/nwfilterbinding.rng | 4 +-
docs/schemas/secret.rng | 70 +--
docs/schemas/storagecommon.rng | 110 ++--
docs/schemas/storagepool.rng | 584 +++++++++----------
docs/schemas/storagepoolcaps.rng | 64 +-
docs/schemas/storagevol.rng | 150 ++---
include/libvirt/libvirt-host.h | 1 +
src/bhyve/bhyve_driver.c | 7 +-
src/conf/cpu_conf.c | 28 +-
src/conf/cpu_conf.h | 6 +-
src/conf/domain_conf.c | 3 +-
src/cpu/cpu.c | 5 +-
src/cpu/cpu.h | 3 +-
src/libxl/libxl_driver.c | 7 +-
src/qemu/qemu_domain.c | 5 +-
src/qemu/qemu_driver.c | 18 +-
src/qemu/qemu_migration_cookie.c | 3 +-
src/util/virxml.c | 15 +
src/util/virxml.h | 6 +
tests/cputest.c | 52 +-
tests/cputestdata/x86_64-bogus-attribute.xml | 2 +
tests/cputestdata/x86_64-bogus-element.xml | 3 +
tools/virsh-host.c | 14 +
40 files changed, 1773 insertions(+), 1664 deletions(-)
create mode 100644 docs/schemas/cpu.rng
create mode 100644 tests/cputestdata/x86_64-bogus-attribute.xml
create mode 100644 tests/cputestdata/x86_64-bogus-element.xml
--=20
2.26.2
4 years, 2 months
[PATCH] rpm: Simplify qemu+kvm conditionals and eliminate duplication
by Neal Gompa
The conditionals for enabling qemu+kvm were unnecessarily complex.
In practice, there were far fewer cases where the functionality would
be disabled than what the conditional logic expressed, and this change
simplifies it to the realistic set of options.
Signed-off-by: Neal Gompa <ngompa13(a)gmail.com>
---
libvirt.spec.in | 49 +++++++++++++++++++++++--------------------------
1 file changed, 23 insertions(+), 26 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index c4a7c30737..6940066de9 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -20,31 +20,12 @@
%define with_qemu_tcg %{with_qemu}
-%define qemu_kvm_arches %{ix86} x86_64
-
-%if 0%{?fedora}
- %define qemu_kvm_arches %{ix86} x86_64 %{power64} s390x %{arm} aarch64
-%endif
-
-%if 0%{?rhel}
- %define with_qemu_tcg 0
- %define qemu_kvm_arches x86_64 %{power64} aarch64 s390x
-%endif
-
# On RHEL 7 and older macro _vpath_builddir is not defined.
%if 0%{?rhel} && 0%{?rhel} <= 7
%define _vpath_builddir %{_target_platform}
%endif
-%ifarch %{qemu_kvm_arches}
- %define with_qemu_kvm %{with_qemu}
-%else
- %define with_qemu_kvm 0
-%endif
-
-%if ! %{with_qemu_tcg} && ! %{with_qemu_kvm}
- %define with_qemu 0
-%endif
+%define with_qemu_kvm %{with_qemu}
# Then the hypervisor drivers that run outside libvirtd, in libvirt.so
%define with_openvz 0%{!?_without_openvz:1}
@@ -61,12 +42,6 @@
%endif
%define with_storage_gluster 0%{!?_without_storage_gluster:1}
-%ifnarch %{qemu_kvm_arches}
- # gluster is only built where qemu driver is enabled on RHEL 8
- %if 0%{?rhel} >= 8
- %define with_storage_gluster 0
- %endif
-%endif
%define with_numactl 0%{!?_without_numactl:1}
@@ -97,6 +72,11 @@
# Finally set the OS / architecture specific special cases
+# KVM is available on most architectures
+%ifnarch %{ix86} x86_64 %{power64} s390x %{arm} aarch64
+ %define with_qemu_kvm 0
+%endif
+
# Xen is available only on i386 x86_64 ia64
%ifnarch %{ix86} x86_64 ia64
%define with_libxl 0
@@ -122,6 +102,23 @@
%define with_storage_rbd 0
%endif
+# RHEL does not ship qemu-tcg
+%if 0%{?rhel}
+ %define with_qemu_tcg 0
+%endif
+
+# In the event that qemu-tcg and qemu-kvm are unavailable, don't ship qemu
+%if ! %{with_qemu_tcg} && ! %{with_qemu_kvm}
+ %define with_qemu 0
+%endif
+
+%if ! %{with_qemu_kvm}
+ # gluster is only built where qemu driver is enabled on RHEL 8
+ %if 0%{?rhel} >= 8
+ %define with_storage_gluster 0
+ %endif
+%endif
+
# RHEL doesn't ship OpenVZ, VBox, PowerHypervisor,
# VMware, libxenlight (Xen 4.1 and newer),
# or HyperV.
--
2.26.2
4 years, 2 months
[libvirt PATCH v4 0/6] Add support for vDPA network devices
by Jonathon Jongsma
vDPA network devices allow high-performance networking in a virtual machine by
providing a wire-speed data path. These devices require a vendor-specific host
driver but the data path follows the virtio specification.
The support for vDPA devices was recently added to qemu. This allows
libvirt to support these devices. This patchset requires that the device is
configured on the host with the appropriate vendor-specific driver. This will
create a chardev on the host at e.g. /dev/vhost-vdpa-0. That chardev path can
then be used to define a new interface with type=3D'vdpa'.
Changes in v4:
- rebased to latest master
- added hotplug support
- report vdpa devices in node device list
Jonathon Jongsma (6):
conf: Add support for vDPA network devices
qemu: add vhost-vdpa capability
qemu: add vdpa support
qemu: add monitor functions for handling file descriptors
qemu: support hotplug of vdpa devices
Include vdpa devices in node device list
docs/formatdomain.rst | 24 +++
docs/schemas/domaincommon.rng | 15 ++
include/libvirt/libvirt-nodedev.h | 1 +
src/conf/domain_conf.c | 31 ++++
src/conf/domain_conf.h | 4 +
src/conf/netdev_bandwidth_conf.c | 1 +
src/conf/node_device_conf.c | 5 +
src/conf/node_device_conf.h | 4 +-
src/conf/virnodedeviceobj.c | 4 +-
src/libxl/libxl_conf.c | 1 +
src/libxl/xen_common.c | 1 +
src/lxc/lxc_controller.c | 1 +
src/lxc/lxc_driver.c | 3 +
src/lxc/lxc_process.c | 1 +
src/node_device/node_device_udev.c | 16 ++
src/qemu/qemu_capabilities.c | 4 +
src/qemu/qemu_capabilities.h | 3 +
src/qemu/qemu_command.c | 36 +++-
src/qemu/qemu_command.h | 3 +-
src/qemu/qemu_domain.c | 6 +-
src/qemu/qemu_hotplug.c | 73 +++++++-
src/qemu/qemu_interface.c | 25 +++
src/qemu/qemu_interface.h | 2 +
src/qemu/qemu_migration.c | 10 +-
src/qemu/qemu_monitor.c | 93 ++++++++++
src/qemu/qemu_monitor.h | 41 +++++
src/qemu/qemu_monitor_json.c | 173 ++++++++++++++++++
src/qemu/qemu_monitor_json.h | 12 ++
src/qemu/qemu_process.c | 2 +
src/qemu/qemu_validate.c | 15 ++
src/vmx/vmx.c | 1 +
.../caps_5.1.0.x86_64.xml | 1 +
.../caps_5.2.0.x86_64.xml | 1 +
tests/qemuhotplugmock.c | 9 +
tests/qemuhotplugtest.c | 16 ++
.../qemuhotplug-interface-vdpa.xml | 4 +
.../qemuhotplug-base-live+interface-vdpa.xml | 57 ++++++
.../net-vdpa.x86_64-latest.args | 37 ++++
tests/qemuxml2argvdata/net-vdpa.xml | 28 +++
tests/qemuxml2argvmock.c | 11 +-
tests/qemuxml2argvtest.c | 1 +
tests/qemuxml2xmloutdata/net-vdpa.xml | 34 ++++
tests/qemuxml2xmltest.c | 1 +
tools/virsh-domain.c | 1 +
tools/virsh-nodedev.c | 3 +
45 files changed, 799 insertions(+), 16 deletions(-)
create mode 100644 tests/qemuhotplugtestdevices/qemuhotplug-interface-vdpa.x=
ml
create mode 100644 tests/qemuhotplugtestdomains/qemuhotplug-base-live+interf=
ace-vdpa.xml
create mode 100644 tests/qemuxml2argvdata/net-vdpa.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/net-vdpa.xml
create mode 100644 tests/qemuxml2xmloutdata/net-vdpa.xml
--=20
2.26.2
4 years, 2 months
[PATCH 0/9] various build flag related fixes
by Laine Stump
These patches eliminate a few build flags that were necessary back 10
years ago when their associated features had been newly added to the
kernel, but are now pointless (because all supported Linuxes have the
feature) (1-6), makes it possible to to a successful (and usable,
albeit limited in some ways) build on a system that doesn't have
libnl3-devel installed (7-8) (macvtap and interface type='hostdev'
don't work, but standard tap devices do), and removes a duplicated
identifier check that I noticed in meson.build (9).
Laine Stump (9):
util: remove useless check for IFLA_VF_MAX
util: remove extraneous defined(__linux__) when checking for
WITH_LIBNL
build: eliminate useless WITH_VIRTUALPORT check
build: remove check for MACVLAN_MODE_PASSTHRU
build: simplify check for WITH_MACVTAP
build: eliminate WITH_MACVTAP flag
util: fix Linux build when libnl-devel isn't available
util: provide non-netlink/libnl alternative for virNetDevGetMaster()
build: remove duplicate check for GET_VLAN_VID_CMD
libvirt.spec.in | 1 -
meson.build | 30 ------------------------
src/util/virnetdev.c | 40 ++++++++++++++++++++++++++------
src/util/virnetdevbridge.c | 6 ++---
src/util/virnetdevip.c | 6 ++---
src/util/virnetdevmacvlan.c | 11 +++------
src/util/virnetdevvportprofile.c | 8 +++----
src/util/virnetlink.c | 4 ++--
src/util/virnetlink.h | 4 ++--
tools/virsh.c | 3 ---
10 files changed, 50 insertions(+), 63 deletions(-)
--
2.26.2
4 years, 2 months
[PATCH 0/3] logging: fix a couple of issues
by Nikolay Shirokovskiy
The code fixed in the first actual patch is quite venerable so I made up
a synthetic test to show issue/test it is fixed. Test covers both issues.
Initially I got /tmp/virtlogd-test size of only 2048 and after the first
fix I saw actual endless loop.
Nikolay Shirokovskiy (3):
DO NOT APPLY: code to show logging issues
logging: read all bytes on EOF in event handler
logging: fix endless loop on EOF
src/logging/log_handler.c | 10 ++++++----
src/qemu/qemu_process.c | 35 +++++++++++++++++++++++++++++++++++
2 files changed, 41 insertions(+), 4 deletions(-)
--
1.8.3.1
4 years, 2 months