[PATCH 1/1] set vm physical bits(phys_bits)
by Paul Schlacter
Set the vm phys_bits through the phys and hostphysbits in XML
<phys bits='43' /> corresponds to "-cpu-phys-bits=42"
<hostphysbits /> corresponds to "host-phys-bits=on"
<cpu mode='host-passthrough' check='none'>
<phys bits='43' />
<hostphysbits />
</cpu>
---
src/conf/cpu_conf.c | 34 ++++++++++++++++++++++++++++++++++
src/conf/cpu_conf.h | 2 ++
src/qemu/qemu_command.c | 6 ++++++
3 files changed, 42 insertions(+)
diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c
index 380a74691d..41f7c26f63 100644
--- a/src/conf/cpu_conf.c
+++ b/src/conf/cpu_conf.c
@@ -158,6 +158,8 @@ virCPUDefCopyModelFilter(virCPUDefPtr dst,
dst->model = g_strdup(src->model);
dst->vendor = g_strdup(src->vendor);
dst->vendor_id = g_strdup(src->vendor_id);
+ dst->phys_bits = src->phys_bits;
+ dst->host_phys_bits = src->host_phys_bits;
dst->microcodeVersion = src->microcodeVersion;
dst->nfeatures_max = src->nfeatures;
dst->nfeatures = 0;
@@ -540,6 +542,18 @@ virCPUDefParseXML(xmlXPathContextPtr ctxt,
return -1;
}
+ if (virXPathNode("./phys[1]", ctxt)) {
+ unsigned long phys_bits;
+ if (virXPathULong("string(./phys[1]/@bits)",
+ ctxt, &phys_bits) >=0 ) {
+ def->phys_bits = (unsigned int) phys_bits;
+ }
+ }
+
+ if (virXPathNode("./hostphysbits[1]", ctxt)) {
+ def->host_phys_bits = true;
+ }
+
if (virXPathNode("./topology[1]", ctxt)) {
unsigned long ul;
@@ -811,6 +825,12 @@ virCPUDefFormatBuf(virBufferPtr buf,
virBufferAddLit(buf, "/>\n");
}
+ if (def->phys_bits > 0)
+ virBufferAsprintf(buf, "<phys bits='%u' />\n", def->phys_bits);
+
+ if (def->host_phys_bits)
+ virBufferAddLit(buf, "<hostphysbits />\n");
+
if (def->sockets && def->dies && def->cores && def->threads) {
virBufferAddLit(buf, "<topology");
virBufferAsprintf(buf, " sockets='%u'", def->sockets);
@@ -1067,6 +1087,20 @@ virCPUDefIsEqual(virCPUDefPtr src,
return false;
}
+ if (src->phys_bits != dst->phys_bits) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Target CPU phys_bits %d does not match source
%d"),
+ dst->phys_bits, src->phys_bits);
+ goto cleanup;
+ }
+
+ if (src->host_phys_bits != dst->host_phys_bits) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Target CPU host_phys_bits %d does not match
source %d"),
+ dst->host_phys_bits, src->host_phys_bits);
+ goto cleanup;
+ }
+
if (src->sockets != dst->sockets) {
MISMATCH(_("Target CPU sockets %d does not match source %d"),
dst->sockets, src->sockets);
diff --git a/src/conf/cpu_conf.h b/src/conf/cpu_conf.h
index 7ab198d370..f2a23ad41e 100644
--- a/src/conf/cpu_conf.h
+++ b/src/conf/cpu_conf.h
@@ -132,6 +132,8 @@ struct _virCPUDef {
char *vendor_id; /* vendor id returned by CPUID in the guest */
int fallback; /* enum virCPUFallback */
char *vendor;
+ unsigned int phys_bits;
+ bool host_phys_bits;
unsigned int microcodeVersion;
unsigned int sockets;
unsigned int dies;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 1b4fa77867..d9bf3d5ce8 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -6729,6 +6729,12 @@ qemuBuildCpuCommandLine(virCommandPtr cmd,
virBufferAddLit(&buf, ",l3-cache=off");
}
+ if (def->cpu && def->cpu->phys_bits > 0)
+ virBufferAsprintf(&buf, ",phys-bits=%u", def->cpu->phys_bits);
+
+ if (def->cpu && def->cpu->host_phys_bits)
+ virBufferAddLit(&buf, ",host-phys-bits=on");
+
cpu = virBufferContentAndReset(&cpu_buf);
cpu_flags = virBufferContentAndReset(&buf);
--
2.24.3
3 years, 8 months
[PATCH 0/1] set vm physical bits(phys_bits)
by Paul Schlacter
wlfightup (1):
set vm physical bits(phys_bits)
src/conf/cpu_conf.c | 34 ++++++++++++++++++++++++++++++++++
src/conf/cpu_conf.h | 2 ++
src/qemu/qemu_command.c | 6 ++++++
3 files changed, 42 insertions(+)
--
2.24.3
3 years, 8 months
[libvirt PATCH] ci: Refresh information
by Andrea Bolognani
Notable changes:
* HAL is no longer installed on FreeBSD;
* the native version of libwsman is no longer installed in
containers intended for cross-compilation;
* Meson 0.55 is used instead of 0.54 when installing from
PyPI.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
Test pipeline:
https://gitlab.com/abologna/libvirt/-/pipelines/275067437
ci/cirrus/freebsd-12.vars | 2 +-
ci/cirrus/freebsd-current.vars | 2 +-
ci/containers/centos-7.Dockerfile | 4 ++--
ci/containers/centos-8.Dockerfile | 4 ++--
ci/containers/centos-stream.Dockerfile | 4 ++--
ci/containers/debian-10-cross-aarch64.Dockerfile | 4 ++--
ci/containers/debian-10-cross-armv6l.Dockerfile | 4 ++--
ci/containers/debian-10-cross-armv7l.Dockerfile | 4 ++--
ci/containers/debian-10-cross-i686.Dockerfile | 4 ++--
ci/containers/debian-10-cross-mips.Dockerfile | 4 ++--
ci/containers/debian-10-cross-mips64el.Dockerfile | 4 ++--
ci/containers/debian-10-cross-mipsel.Dockerfile | 4 ++--
ci/containers/debian-10-cross-ppc64le.Dockerfile | 4 ++--
ci/containers/debian-10-cross-s390x.Dockerfile | 4 ++--
ci/containers/debian-10.Dockerfile | 4 ++--
ci/containers/debian-sid-cross-aarch64.Dockerfile | 2 +-
ci/containers/debian-sid-cross-armv6l.Dockerfile | 2 +-
ci/containers/debian-sid-cross-armv7l.Dockerfile | 2 +-
ci/containers/debian-sid-cross-i686.Dockerfile | 2 +-
ci/containers/debian-sid-cross-mips64el.Dockerfile | 2 +-
ci/containers/debian-sid-cross-mipsel.Dockerfile | 2 +-
ci/containers/debian-sid-cross-ppc64le.Dockerfile | 2 +-
ci/containers/debian-sid-cross-s390x.Dockerfile | 2 +-
ci/containers/debian-sid.Dockerfile | 2 +-
ci/containers/fedora-32.Dockerfile | 2 +-
ci/containers/fedora-33.Dockerfile | 2 +-
ci/containers/fedora-rawhide-cross-mingw32.Dockerfile | 3 +--
ci/containers/fedora-rawhide-cross-mingw64.Dockerfile | 3 +--
ci/containers/fedora-rawhide.Dockerfile | 2 +-
ci/containers/opensuse-152.Dockerfile | 4 ++--
ci/containers/ubuntu-1804.Dockerfile | 4 ++--
ci/containers/ubuntu-2004.Dockerfile | 4 ++--
32 files changed, 48 insertions(+), 50 deletions(-)
diff --git a/ci/cirrus/freebsd-12.vars b/ci/cirrus/freebsd-12.vars
index 5add0fb058..f50c3da65f 100644
--- a/ci/cirrus/freebsd-12.vars
+++ b/ci/cirrus/freebsd-12.vars
@@ -5,4 +5,4 @@ MAKE='/usr/local/bin/gmake'
NINJA='/usr/local/bin/ninja'
PYTHON='/usr/local/bin/python3'
PIP3='/usr/local/bin/pip-3.7'
-PKGS='augeas avahi bash-completion ca_root_nss ccache cppi curl cyrus-sasl dbus diffutils diskscrub dnsmasq fusefs-libs gettext git glib gmake gnutls hal libpcap libpciaccess libssh libssh2 libxml2 libxslt meson ninja perl5 pkgconf polkit py37-docutils py37-flake8 python3 qemu radvd readline yajl'
+PKGS='augeas avahi bash-completion ca_root_nss ccache cppi curl cyrus-sasl dbus diffutils diskscrub dnsmasq fusefs-libs gettext git glib gmake gnutls libpcap libpciaccess libssh libssh2 libxml2 libxslt meson ninja perl5 pkgconf polkit py37-docutils py37-flake8 python3 qemu radvd readline yajl'
diff --git a/ci/cirrus/freebsd-current.vars b/ci/cirrus/freebsd-current.vars
index 5add0fb058..f50c3da65f 100644
--- a/ci/cirrus/freebsd-current.vars
+++ b/ci/cirrus/freebsd-current.vars
@@ -5,4 +5,4 @@ MAKE='/usr/local/bin/gmake'
NINJA='/usr/local/bin/ninja'
PYTHON='/usr/local/bin/python3'
PIP3='/usr/local/bin/pip-3.7'
-PKGS='augeas avahi bash-completion ca_root_nss ccache cppi curl cyrus-sasl dbus diffutils diskscrub dnsmasq fusefs-libs gettext git glib gmake gnutls hal libpcap libpciaccess libssh libssh2 libxml2 libxslt meson ninja perl5 pkgconf polkit py37-docutils py37-flake8 python3 qemu radvd readline yajl'
+PKGS='augeas avahi bash-completion ca_root_nss ccache cppi curl cyrus-sasl dbus diffutils diskscrub dnsmasq fusefs-libs gettext git glib gmake gnutls libpcap libpciaccess libssh libssh2 libxml2 libxslt meson ninja perl5 pkgconf polkit py37-docutils py37-flake8 python3 qemu radvd readline yajl'
diff --git a/ci/containers/centos-7.Dockerfile b/ci/containers/centos-7.Dockerfile
index c499e7a19d..c71d1bcbcf 100644
--- a/ci/containers/centos-7.Dockerfile
+++ b/ci/containers/centos-7.Dockerfile
@@ -2,7 +2,7 @@
#
# $ lcitool dockerfile centos-7 libvirt
#
-# https://gitlab.com/libvirt/libvirt-ci/-/commit/891c7d56be1d0eb5adaf78fced...
+# https://gitlab.com/libvirt/libvirt-ci/-/commit/5bbc9986c2184aef7f5aee1fa7...
FROM docker.io/library/centos:7
RUN yum update -y && \
@@ -124,7 +124,7 @@ WEiJKtQrZDJloqtyi/mmRa1VsV7RYR0VPJjhK/R8EQ7Ysshy\n\
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/$(basename /usr/bin/gcc)
RUN pip3 install \
- meson==0.54.0
+ meson==0.55.3
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
diff --git a/ci/containers/centos-8.Dockerfile b/ci/containers/centos-8.Dockerfile
index e600598329..21cf916d8d 100644
--- a/ci/containers/centos-8.Dockerfile
+++ b/ci/containers/centos-8.Dockerfile
@@ -2,7 +2,7 @@
#
# $ lcitool dockerfile centos-8 libvirt
#
-# https://gitlab.com/libvirt/libvirt-ci/-/commit/891c7d56be1d0eb5adaf78fced...
+# https://gitlab.com/libvirt/libvirt-ci/-/commit/5bbc9986c2184aef7f5aee1fa7...
FROM docker.io/library/centos:8
RUN dnf update -y && \
@@ -96,7 +96,7 @@ RUN dnf update -y && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/$(basename /usr/bin/gcc)
RUN pip3 install \
- meson==0.54.0
+ meson==0.55.3
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
diff --git a/ci/containers/centos-stream.Dockerfile b/ci/containers/centos-stream.Dockerfile
index 2b51eccc8d..0e66d4ae99 100644
--- a/ci/containers/centos-stream.Dockerfile
+++ b/ci/containers/centos-stream.Dockerfile
@@ -2,7 +2,7 @@
#
# $ lcitool dockerfile centos-stream libvirt
#
-# https://gitlab.com/libvirt/libvirt-ci/-/commit/891c7d56be1d0eb5adaf78fced...
+# https://gitlab.com/libvirt/libvirt-ci/-/commit/5bbc9986c2184aef7f5aee1fa7...
FROM docker.io/library/centos:8
RUN dnf install -y centos-release-stream && \
@@ -98,7 +98,7 @@ RUN dnf install -y centos-release-stream && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/$(basename /usr/bin/gcc)
RUN pip3 install \
- meson==0.54.0
+ meson==0.55.3
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
diff --git a/ci/containers/debian-10-cross-aarch64.Dockerfile b/ci/containers/debian-10-cross-aarch64.Dockerfile
index 272c809f17..31bf9fce7a 100644
--- a/ci/containers/debian-10-cross-aarch64.Dockerfile
+++ b/ci/containers/debian-10-cross-aarch64.Dockerfile
@@ -2,7 +2,7 @@
#
# $ lcitool dockerfile --cross aarch64 debian-10 libvirt
#
-# https://gitlab.com/libvirt/libvirt-ci/-/commit/891c7d56be1d0eb5adaf78fced...
+# https://gitlab.com/libvirt/libvirt-ci/-/commit/5bbc9986c2184aef7f5aee1fa7...
FROM docker.io/library/debian:10-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
@@ -118,7 +118,7 @@ cpu = 'aarch64'\n\
endian = 'little'" > /usr/local/share/meson/cross/aarch64-linux-gnu
RUN pip3 install \
- meson==0.54.0
+ meson==0.55.3
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
diff --git a/ci/containers/debian-10-cross-armv6l.Dockerfile b/ci/containers/debian-10-cross-armv6l.Dockerfile
index e877b5e0b3..df0dd1b649 100644
--- a/ci/containers/debian-10-cross-armv6l.Dockerfile
+++ b/ci/containers/debian-10-cross-armv6l.Dockerfile
@@ -2,7 +2,7 @@
#
# $ lcitool dockerfile --cross armv6l debian-10 libvirt
#
-# https://gitlab.com/libvirt/libvirt-ci/-/commit/891c7d56be1d0eb5adaf78fced...
+# https://gitlab.com/libvirt/libvirt-ci/-/commit/5bbc9986c2184aef7f5aee1fa7...
FROM docker.io/library/debian:10-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
@@ -117,7 +117,7 @@ cpu = 'arm'\n\
endian = 'little'" > /usr/local/share/meson/cross/arm-linux-gnueabi
RUN pip3 install \
- meson==0.54.0
+ meson==0.55.3
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
diff --git a/ci/containers/debian-10-cross-armv7l.Dockerfile b/ci/containers/debian-10-cross-armv7l.Dockerfile
index d8cbc82334..0b07fcaa2e 100644
--- a/ci/containers/debian-10-cross-armv7l.Dockerfile
+++ b/ci/containers/debian-10-cross-armv7l.Dockerfile
@@ -2,7 +2,7 @@
#
# $ lcitool dockerfile --cross armv7l debian-10 libvirt
#
-# https://gitlab.com/libvirt/libvirt-ci/-/commit/891c7d56be1d0eb5adaf78fced...
+# https://gitlab.com/libvirt/libvirt-ci/-/commit/5bbc9986c2184aef7f5aee1fa7...
FROM docker.io/library/debian:10-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
@@ -118,7 +118,7 @@ cpu = 'armhf'\n\
endian = 'little'" > /usr/local/share/meson/cross/arm-linux-gnueabihf
RUN pip3 install \
- meson==0.54.0
+ meson==0.55.3
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
diff --git a/ci/containers/debian-10-cross-i686.Dockerfile b/ci/containers/debian-10-cross-i686.Dockerfile
index ed056c31b5..9c3f2cdfd4 100644
--- a/ci/containers/debian-10-cross-i686.Dockerfile
+++ b/ci/containers/debian-10-cross-i686.Dockerfile
@@ -2,7 +2,7 @@
#
# $ lcitool dockerfile --cross i686 debian-10 libvirt
#
-# https://gitlab.com/libvirt/libvirt-ci/-/commit/891c7d56be1d0eb5adaf78fced...
+# https://gitlab.com/libvirt/libvirt-ci/-/commit/5bbc9986c2184aef7f5aee1fa7...
FROM docker.io/library/debian:10-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
@@ -117,7 +117,7 @@ cpu = 'i686'\n\
endian = 'little'" > /usr/local/share/meson/cross/i686-linux-gnu
RUN pip3 install \
- meson==0.54.0
+ meson==0.55.3
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
diff --git a/ci/containers/debian-10-cross-mips.Dockerfile b/ci/containers/debian-10-cross-mips.Dockerfile
index 969964faf2..148b43f7e2 100644
--- a/ci/containers/debian-10-cross-mips.Dockerfile
+++ b/ci/containers/debian-10-cross-mips.Dockerfile
@@ -2,7 +2,7 @@
#
# $ lcitool dockerfile --cross mips debian-10 libvirt
#
-# https://gitlab.com/libvirt/libvirt-ci/-/commit/891c7d56be1d0eb5adaf78fced...
+# https://gitlab.com/libvirt/libvirt-ci/-/commit/5bbc9986c2184aef7f5aee1fa7...
FROM docker.io/library/debian:10-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
@@ -117,7 +117,7 @@ cpu = 'mips'\n\
endian = 'big'" > /usr/local/share/meson/cross/mips-linux-gnu
RUN pip3 install \
- meson==0.54.0
+ meson==0.55.3
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
diff --git a/ci/containers/debian-10-cross-mips64el.Dockerfile b/ci/containers/debian-10-cross-mips64el.Dockerfile
index a78492971f..df782b4b9b 100644
--- a/ci/containers/debian-10-cross-mips64el.Dockerfile
+++ b/ci/containers/debian-10-cross-mips64el.Dockerfile
@@ -2,7 +2,7 @@
#
# $ lcitool dockerfile --cross mips64el debian-10 libvirt
#
-# https://gitlab.com/libvirt/libvirt-ci/-/commit/891c7d56be1d0eb5adaf78fced...
+# https://gitlab.com/libvirt/libvirt-ci/-/commit/5bbc9986c2184aef7f5aee1fa7...
FROM docker.io/library/debian:10-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
@@ -117,7 +117,7 @@ cpu = 'mips64el'\n\
endian = 'little'" > /usr/local/share/meson/cross/mips64el-linux-gnuabi64
RUN pip3 install \
- meson==0.54.0
+ meson==0.55.3
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
diff --git a/ci/containers/debian-10-cross-mipsel.Dockerfile b/ci/containers/debian-10-cross-mipsel.Dockerfile
index 857173f261..a61a9fc365 100644
--- a/ci/containers/debian-10-cross-mipsel.Dockerfile
+++ b/ci/containers/debian-10-cross-mipsel.Dockerfile
@@ -2,7 +2,7 @@
#
# $ lcitool dockerfile --cross mipsel debian-10 libvirt
#
-# https://gitlab.com/libvirt/libvirt-ci/-/commit/891c7d56be1d0eb5adaf78fced...
+# https://gitlab.com/libvirt/libvirt-ci/-/commit/5bbc9986c2184aef7f5aee1fa7...
FROM docker.io/library/debian:10-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
@@ -117,7 +117,7 @@ cpu = 'mipsel'\n\
endian = 'little'" > /usr/local/share/meson/cross/mipsel-linux-gnu
RUN pip3 install \
- meson==0.54.0
+ meson==0.55.3
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
diff --git a/ci/containers/debian-10-cross-ppc64le.Dockerfile b/ci/containers/debian-10-cross-ppc64le.Dockerfile
index 349cc1e487..46aab91e28 100644
--- a/ci/containers/debian-10-cross-ppc64le.Dockerfile
+++ b/ci/containers/debian-10-cross-ppc64le.Dockerfile
@@ -2,7 +2,7 @@
#
# $ lcitool dockerfile --cross ppc64le debian-10 libvirt
#
-# https://gitlab.com/libvirt/libvirt-ci/-/commit/891c7d56be1d0eb5adaf78fced...
+# https://gitlab.com/libvirt/libvirt-ci/-/commit/5bbc9986c2184aef7f5aee1fa7...
FROM docker.io/library/debian:10-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
@@ -117,7 +117,7 @@ cpu = 'powerpc64le'\n\
endian = 'little'" > /usr/local/share/meson/cross/powerpc64le-linux-gnu
RUN pip3 install \
- meson==0.54.0
+ meson==0.55.3
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
diff --git a/ci/containers/debian-10-cross-s390x.Dockerfile b/ci/containers/debian-10-cross-s390x.Dockerfile
index e79381e69a..80f2564caf 100644
--- a/ci/containers/debian-10-cross-s390x.Dockerfile
+++ b/ci/containers/debian-10-cross-s390x.Dockerfile
@@ -2,7 +2,7 @@
#
# $ lcitool dockerfile --cross s390x debian-10 libvirt
#
-# https://gitlab.com/libvirt/libvirt-ci/-/commit/891c7d56be1d0eb5adaf78fced...
+# https://gitlab.com/libvirt/libvirt-ci/-/commit/5bbc9986c2184aef7f5aee1fa7...
FROM docker.io/library/debian:10-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
@@ -117,7 +117,7 @@ cpu = 's390x'\n\
endian = 'big'" > /usr/local/share/meson/cross/s390x-linux-gnu
RUN pip3 install \
- meson==0.54.0
+ meson==0.55.3
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
diff --git a/ci/containers/debian-10.Dockerfile b/ci/containers/debian-10.Dockerfile
index bac8589f2c..ce4c27899a 100644
--- a/ci/containers/debian-10.Dockerfile
+++ b/ci/containers/debian-10.Dockerfile
@@ -2,7 +2,7 @@
#
# $ lcitool dockerfile debian-10 libvirt
#
-# https://gitlab.com/libvirt/libvirt-ci/-/commit/891c7d56be1d0eb5adaf78fced...
+# https://gitlab.com/libvirt/libvirt-ci/-/commit/5bbc9986c2184aef7f5aee1fa7...
FROM docker.io/library/debian:10-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
@@ -98,7 +98,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/$(basename /usr/bin/gcc)
RUN pip3 install \
- meson==0.54.0
+ meson==0.55.3
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
diff --git a/ci/containers/debian-sid-cross-aarch64.Dockerfile b/ci/containers/debian-sid-cross-aarch64.Dockerfile
index f0831c1fed..8ea2e6172d 100644
--- a/ci/containers/debian-sid-cross-aarch64.Dockerfile
+++ b/ci/containers/debian-sid-cross-aarch64.Dockerfile
@@ -2,7 +2,7 @@
#
# $ lcitool dockerfile --cross aarch64 debian-sid libvirt
#
-# https://gitlab.com/libvirt/libvirt-ci/-/commit/891c7d56be1d0eb5adaf78fced...
+# https://gitlab.com/libvirt/libvirt-ci/-/commit/5bbc9986c2184aef7f5aee1fa7...
FROM docker.io/library/debian:sid-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
diff --git a/ci/containers/debian-sid-cross-armv6l.Dockerfile b/ci/containers/debian-sid-cross-armv6l.Dockerfile
index c3661e2e7d..cc5ca035de 100644
--- a/ci/containers/debian-sid-cross-armv6l.Dockerfile
+++ b/ci/containers/debian-sid-cross-armv6l.Dockerfile
@@ -2,7 +2,7 @@
#
# $ lcitool dockerfile --cross armv6l debian-sid libvirt
#
-# https://gitlab.com/libvirt/libvirt-ci/-/commit/891c7d56be1d0eb5adaf78fced...
+# https://gitlab.com/libvirt/libvirt-ci/-/commit/5bbc9986c2184aef7f5aee1fa7...
FROM docker.io/library/debian:sid-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
diff --git a/ci/containers/debian-sid-cross-armv7l.Dockerfile b/ci/containers/debian-sid-cross-armv7l.Dockerfile
index 4322046e8d..de53f630c9 100644
--- a/ci/containers/debian-sid-cross-armv7l.Dockerfile
+++ b/ci/containers/debian-sid-cross-armv7l.Dockerfile
@@ -2,7 +2,7 @@
#
# $ lcitool dockerfile --cross armv7l debian-sid libvirt
#
-# https://gitlab.com/libvirt/libvirt-ci/-/commit/891c7d56be1d0eb5adaf78fced...
+# https://gitlab.com/libvirt/libvirt-ci/-/commit/5bbc9986c2184aef7f5aee1fa7...
FROM docker.io/library/debian:sid-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
diff --git a/ci/containers/debian-sid-cross-i686.Dockerfile b/ci/containers/debian-sid-cross-i686.Dockerfile
index a48ff3471c..3b351b58cb 100644
--- a/ci/containers/debian-sid-cross-i686.Dockerfile
+++ b/ci/containers/debian-sid-cross-i686.Dockerfile
@@ -2,7 +2,7 @@
#
# $ lcitool dockerfile --cross i686 debian-sid libvirt
#
-# https://gitlab.com/libvirt/libvirt-ci/-/commit/891c7d56be1d0eb5adaf78fced...
+# https://gitlab.com/libvirt/libvirt-ci/-/commit/5bbc9986c2184aef7f5aee1fa7...
FROM docker.io/library/debian:sid-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
diff --git a/ci/containers/debian-sid-cross-mips64el.Dockerfile b/ci/containers/debian-sid-cross-mips64el.Dockerfile
index 9f3325b546..56979fb07e 100644
--- a/ci/containers/debian-sid-cross-mips64el.Dockerfile
+++ b/ci/containers/debian-sid-cross-mips64el.Dockerfile
@@ -2,7 +2,7 @@
#
# $ lcitool dockerfile --cross mips64el debian-sid libvirt
#
-# https://gitlab.com/libvirt/libvirt-ci/-/commit/891c7d56be1d0eb5adaf78fced...
+# https://gitlab.com/libvirt/libvirt-ci/-/commit/5bbc9986c2184aef7f5aee1fa7...
FROM docker.io/library/debian:sid-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
diff --git a/ci/containers/debian-sid-cross-mipsel.Dockerfile b/ci/containers/debian-sid-cross-mipsel.Dockerfile
index 39993132ac..f7e9aa98d1 100644
--- a/ci/containers/debian-sid-cross-mipsel.Dockerfile
+++ b/ci/containers/debian-sid-cross-mipsel.Dockerfile
@@ -2,7 +2,7 @@
#
# $ lcitool dockerfile --cross mipsel debian-sid libvirt
#
-# https://gitlab.com/libvirt/libvirt-ci/-/commit/891c7d56be1d0eb5adaf78fced...
+# https://gitlab.com/libvirt/libvirt-ci/-/commit/5bbc9986c2184aef7f5aee1fa7...
FROM docker.io/library/debian:sid-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
diff --git a/ci/containers/debian-sid-cross-ppc64le.Dockerfile b/ci/containers/debian-sid-cross-ppc64le.Dockerfile
index ebb4389e69..149c5e26be 100644
--- a/ci/containers/debian-sid-cross-ppc64le.Dockerfile
+++ b/ci/containers/debian-sid-cross-ppc64le.Dockerfile
@@ -2,7 +2,7 @@
#
# $ lcitool dockerfile --cross ppc64le debian-sid libvirt
#
-# https://gitlab.com/libvirt/libvirt-ci/-/commit/891c7d56be1d0eb5adaf78fced...
+# https://gitlab.com/libvirt/libvirt-ci/-/commit/5bbc9986c2184aef7f5aee1fa7...
FROM docker.io/library/debian:sid-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
diff --git a/ci/containers/debian-sid-cross-s390x.Dockerfile b/ci/containers/debian-sid-cross-s390x.Dockerfile
index 8cc22358cf..61da0135c2 100644
--- a/ci/containers/debian-sid-cross-s390x.Dockerfile
+++ b/ci/containers/debian-sid-cross-s390x.Dockerfile
@@ -2,7 +2,7 @@
#
# $ lcitool dockerfile --cross s390x debian-sid libvirt
#
-# https://gitlab.com/libvirt/libvirt-ci/-/commit/891c7d56be1d0eb5adaf78fced...
+# https://gitlab.com/libvirt/libvirt-ci/-/commit/5bbc9986c2184aef7f5aee1fa7...
FROM docker.io/library/debian:sid-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
diff --git a/ci/containers/debian-sid.Dockerfile b/ci/containers/debian-sid.Dockerfile
index a1ef98e67c..ce05150c09 100644
--- a/ci/containers/debian-sid.Dockerfile
+++ b/ci/containers/debian-sid.Dockerfile
@@ -2,7 +2,7 @@
#
# $ lcitool dockerfile debian-sid libvirt
#
-# https://gitlab.com/libvirt/libvirt-ci/-/commit/891c7d56be1d0eb5adaf78fced...
+# https://gitlab.com/libvirt/libvirt-ci/-/commit/5bbc9986c2184aef7f5aee1fa7...
FROM docker.io/library/debian:sid-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
diff --git a/ci/containers/fedora-32.Dockerfile b/ci/containers/fedora-32.Dockerfile
index 71d391b7bd..6ea7537006 100644
--- a/ci/containers/fedora-32.Dockerfile
+++ b/ci/containers/fedora-32.Dockerfile
@@ -2,7 +2,7 @@
#
# $ lcitool dockerfile fedora-32 libvirt
#
-# https://gitlab.com/libvirt/libvirt-ci/-/commit/891c7d56be1d0eb5adaf78fced...
+# https://gitlab.com/libvirt/libvirt-ci/-/commit/5bbc9986c2184aef7f5aee1fa7...
FROM registry.fedoraproject.org/fedora:32
RUN dnf install -y nosync && \
diff --git a/ci/containers/fedora-33.Dockerfile b/ci/containers/fedora-33.Dockerfile
index 5fb30380b0..aeddc7ec30 100644
--- a/ci/containers/fedora-33.Dockerfile
+++ b/ci/containers/fedora-33.Dockerfile
@@ -2,7 +2,7 @@
#
# $ lcitool dockerfile fedora-33 libvirt
#
-# https://gitlab.com/libvirt/libvirt-ci/-/commit/891c7d56be1d0eb5adaf78fced...
+# https://gitlab.com/libvirt/libvirt-ci/-/commit/5bbc9986c2184aef7f5aee1fa7...
FROM registry.fedoraproject.org/fedora:33
RUN dnf install -y nosync && \
diff --git a/ci/containers/fedora-rawhide-cross-mingw32.Dockerfile b/ci/containers/fedora-rawhide-cross-mingw32.Dockerfile
index c718778acb..a72b9a56f7 100644
--- a/ci/containers/fedora-rawhide-cross-mingw32.Dockerfile
+++ b/ci/containers/fedora-rawhide-cross-mingw32.Dockerfile
@@ -2,7 +2,7 @@
#
# $ lcitool dockerfile --cross mingw32 fedora-rawhide libvirt
#
-# https://gitlab.com/libvirt/libvirt-ci/-/commit/891c7d56be1d0eb5adaf78fced...
+# https://gitlab.com/libvirt/libvirt-ci/-/commit/5bbc9986c2184aef7f5aee1fa7...
FROM registry.fedoraproject.org/fedora:rawhide
RUN dnf update -y --nogpgcheck fedora-gpg-keys && \
@@ -35,7 +35,6 @@ exec "$@"' > /usr/bin/nosync && \
iptables \
iscsi-initiator-utils \
kmod \
- libwsman-devel \
libxml2 \
libxslt \
lvm2 \
diff --git a/ci/containers/fedora-rawhide-cross-mingw64.Dockerfile b/ci/containers/fedora-rawhide-cross-mingw64.Dockerfile
index 6058d0c0b2..abcf18831b 100644
--- a/ci/containers/fedora-rawhide-cross-mingw64.Dockerfile
+++ b/ci/containers/fedora-rawhide-cross-mingw64.Dockerfile
@@ -2,7 +2,7 @@
#
# $ lcitool dockerfile --cross mingw64 fedora-rawhide libvirt
#
-# https://gitlab.com/libvirt/libvirt-ci/-/commit/891c7d56be1d0eb5adaf78fced...
+# https://gitlab.com/libvirt/libvirt-ci/-/commit/5bbc9986c2184aef7f5aee1fa7...
FROM registry.fedoraproject.org/fedora:rawhide
RUN dnf update -y --nogpgcheck fedora-gpg-keys && \
@@ -35,7 +35,6 @@ exec "$@"' > /usr/bin/nosync && \
iptables \
iscsi-initiator-utils \
kmod \
- libwsman-devel \
libxml2 \
libxslt \
lvm2 \
diff --git a/ci/containers/fedora-rawhide.Dockerfile b/ci/containers/fedora-rawhide.Dockerfile
index 027e8a7c41..fde3699202 100644
--- a/ci/containers/fedora-rawhide.Dockerfile
+++ b/ci/containers/fedora-rawhide.Dockerfile
@@ -2,7 +2,7 @@
#
# $ lcitool dockerfile fedora-rawhide libvirt
#
-# https://gitlab.com/libvirt/libvirt-ci/-/commit/891c7d56be1d0eb5adaf78fced...
+# https://gitlab.com/libvirt/libvirt-ci/-/commit/5bbc9986c2184aef7f5aee1fa7...
FROM registry.fedoraproject.org/fedora:rawhide
RUN dnf update -y --nogpgcheck fedora-gpg-keys && \
diff --git a/ci/containers/opensuse-152.Dockerfile b/ci/containers/opensuse-152.Dockerfile
index 00521f7796..2fba8969f6 100644
--- a/ci/containers/opensuse-152.Dockerfile
+++ b/ci/containers/opensuse-152.Dockerfile
@@ -2,7 +2,7 @@
#
# $ lcitool dockerfile opensuse-152 libvirt
#
-# https://gitlab.com/libvirt/libvirt-ci/-/commit/891c7d56be1d0eb5adaf78fced...
+# https://gitlab.com/libvirt/libvirt-ci/-/commit/5bbc9986c2184aef7f5aee1fa7...
FROM registry.opensuse.org/opensuse/leap:15.2
RUN zypper update -y && \
@@ -92,7 +92,7 @@ RUN zypper update -y && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/$(basename /usr/bin/gcc)
RUN pip3 install \
- meson==0.54.0
+ meson==0.55.3
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
diff --git a/ci/containers/ubuntu-1804.Dockerfile b/ci/containers/ubuntu-1804.Dockerfile
index 3d18274d00..9cfdc21594 100644
--- a/ci/containers/ubuntu-1804.Dockerfile
+++ b/ci/containers/ubuntu-1804.Dockerfile
@@ -2,7 +2,7 @@
#
# $ lcitool dockerfile ubuntu-1804 libvirt
#
-# https://gitlab.com/libvirt/libvirt-ci/-/commit/891c7d56be1d0eb5adaf78fced...
+# https://gitlab.com/libvirt/libvirt-ci/-/commit/5bbc9986c2184aef7f5aee1fa7...
FROM docker.io/library/ubuntu:18.04
RUN export DEBIAN_FRONTEND=noninteractive && \
@@ -100,7 +100,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/$(basename /usr/bin/gcc)
RUN pip3 install \
- meson==0.54.0
+ meson==0.55.3
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
diff --git a/ci/containers/ubuntu-2004.Dockerfile b/ci/containers/ubuntu-2004.Dockerfile
index 9018c9d22e..5616825c46 100644
--- a/ci/containers/ubuntu-2004.Dockerfile
+++ b/ci/containers/ubuntu-2004.Dockerfile
@@ -2,7 +2,7 @@
#
# $ lcitool dockerfile ubuntu-2004 libvirt
#
-# https://gitlab.com/libvirt/libvirt-ci/-/commit/891c7d56be1d0eb5adaf78fced...
+# https://gitlab.com/libvirt/libvirt-ci/-/commit/5bbc9986c2184aef7f5aee1fa7...
FROM docker.io/library/ubuntu:20.04
RUN export DEBIAN_FRONTEND=noninteractive && \
@@ -99,7 +99,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/$(basename /usr/bin/gcc)
RUN pip3 install \
- meson==0.54.0
+ meson==0.55.3
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
--
2.26.3
3 years, 8 months
[PATCH] Virtuozzo URL has been changed (RESEND FROM GITLAB)
by Erik Skultety
From: Yaroslav Kargin <ykargin(a)virtuozzo.com>
Signed-off-by: Yaroslav Kargin <ykargin(a)virtuozzo.com>
---
This patch was merged in gitlab, resending it to the list.
docs/drvvirtuozzo.html.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/drvvirtuozzo.html.in b/docs/drvvirtuozzo.html.in
index 8813d00ad8..e47f72bad1 100644
--- a/docs/drvvirtuozzo.html.in
+++ b/docs/drvvirtuozzo.html.in
@@ -12,7 +12,7 @@
<h2><a id="project">Project Links</a></h2>
<ul>
<li>
- The <a href="http://www.odin.com/products/virtuozzo/">Virtuozzo</a> Solution.
+ The <a href="https://www.virtuozzo.com/">Virtuozzo</a> Solution.
</li>
</ul>
--
2.30.2
3 years, 8 months
[PATCH 0/1] set vm physical bits(phys_bits)
by Wang,Liang(ACG CCN)
wangliang (1):
set vm physical bits(phys_bits)
src/conf/cpu_conf.c | 34 ++++++++++++++++++++++++++++++++++
src/conf/cpu_conf.h | 2 ++
src/qemu/qemu_command.c | 6 ++++++
3 files changed, 42 insertions(+)
--
2.24.3
3 years, 8 months
[libvirt PATCH 0/5] Formalize the deprecation of arguments in virsh
by Tim Wiederhake
virsh has several arguments that are better not used. This series introduces
a formal way of marking them as deprecated.
Tim Wiederhake (5):
vsh: Set default log level to "warning"
vsh: Introduce flag for deprecated options
vsh: setmem: Mark '--kilobytes' as deprecated
vsh: setmaxmem: Mark '--kilobytes' as deprecated
vsh: secret-set-value: Mark '--base64' as deprecated
tools/virsh-domain.c | 2 ++
tools/virsh-secret.c | 3 +--
tools/vsh.c | 11 +++++++++--
tools/vsh.h | 11 ++++++-----
4 files changed, 18 insertions(+), 9 deletions(-)
--
2.26.2
3 years, 8 months
[libvirt PATCH v2 0/3] docs: Convert html.in to rst (volume 1)
by Erik Skultety
since v1:
- fixed a broken heading reference from a kbase article caused by RST convers=
ion
- dropped architecture.html.in along with images
v1: https://listman.redhat.com/archives/libvir-list/2021-March/msg00584.html
Erik Skultety (3):
docs: html.in: Drop the architecture page
docs: html.in: Convert auth to rst
docs: kbase: Fix a broken formatdomain reference in locking-sanlock
docs/architecture.gif | Bin 5571 -> 0 bytes
docs/architecture.html.in | 82 --------
docs/architecture.svg | 239 ---------------------
docs/auth.html.in | 368 ---------------------------------
docs/auth.rst | 343 ++++++++++++++++++++++++++++++
docs/kbase/locking-sanlock.rst | 4 +-
docs/meson.build | 4 +-
7 files changed, 346 insertions(+), 694 deletions(-)
delete mode 100644 docs/architecture.gif
delete mode 100644 docs/architecture.html.in
delete mode 100644 docs/architecture.svg
delete mode 100644 docs/auth.html.in
create mode 100644 docs/auth.rst
--=20
2.29.2
3 years, 8 months
[PATCH v2] qemu: don't raise error upon interface update without <frames/> for <rx/> in coalesce
by Kristina Hanicova
With this, incomplete XML without <frames/> for <rx/> in coalesce
won't raise error as before. It will leave the coalesce parameter
empty, thanks to passing it as a parameter and return an integer
to indicate error state - previously it returned pointer (or NULL
for both error and incomplete XML).
I also added a test case to test this functionality in the
qemuxml2xmltest.
The code went through some refactoring:
* change of a condition
* addition of a parameter
* change of order, that allowed removal of VIR_FREE
* removal of redundant labels and variables
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1535930
Signed-off-by: Kristina Hanicova <khanicov(a)redhat.com>
---
diff to v1:
- Added qemuxml2xmlout testcase, per Martin's review
src/conf/domain_conf.c | 25 +++++++++--------------
tests/qemuxml2argvdata/net-coalesce.xml | 9 ++++++++
tests/qemuxml2xmloutdata/net-coalesce.xml | 8 +++++++-
3 files changed, 26 insertions(+), 16 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index b731744f04..798594f520 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -7516,11 +7516,11 @@ virDomainNetIPInfoParseXML(const char *source,
}
-static virNetDevCoalescePtr
+static int
virDomainNetDefCoalesceParseXML(xmlNodePtr node,
- xmlXPathContextPtr ctxt)
+ xmlXPathContextPtr ctxt,
+ virNetDevCoalescePtr *coalesce)
{
- virNetDevCoalescePtr ret = NULL;
VIR_XPATH_NODE_AUTORESTORE(ctxt)
unsigned long long tmp = 0;
g_autofree char *str = NULL;
@@ -7529,15 +7529,13 @@ virDomainNetDefCoalesceParseXML(xmlNodePtr node,
str = virXPathString("string(./rx/frames/@max)", ctxt);
if (!str)
- return NULL;
-
- ret = g_new0(virNetDevCoalesce, 1);
+ return 0;
if (virStrToLong_ullp(str, NULL, 10, &tmp) < 0) {
virReportError(VIR_ERR_XML_DETAIL,
_("cannot parse value '%s' for coalesce parameter"),
str);
- goto error;
+ return -1;
}
if (tmp > UINT32_MAX) {
@@ -7545,15 +7543,13 @@ virDomainNetDefCoalesceParseXML(xmlNodePtr node,
_("value '%llu' is too big for coalesce "
"parameter, maximum is '%lu'"),
tmp, (unsigned long) UINT32_MAX);
- goto error;
+ return -1;
}
- ret->rx_max_coalesced_frames = tmp;
- return ret;
+ *coalesce = g_new0(virNetDevCoalesce, 1);
+ (*coalesce)->rx_max_coalesced_frames = tmp;
- error:
- VIR_FREE(ret);
- return NULL;
+ return 0;
}
static void
@@ -11517,8 +11513,7 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
node = virXPathNode("./coalesce", ctxt);
if (node) {
- def->coalesce = virDomainNetDefCoalesceParseXML(node, ctxt);
- if (!def->coalesce)
+ if (virDomainNetDefCoalesceParseXML(node, ctxt, &def->coalesce) < 0)
goto error;
}
diff --git a/tests/qemuxml2argvdata/net-coalesce.xml b/tests/qemuxml2argvdata/net-coalesce.xml
index bdcf786429..6fa3641e7d 100644
--- a/tests/qemuxml2argvdata/net-coalesce.xml
+++ b/tests/qemuxml2argvdata/net-coalesce.xml
@@ -55,6 +55,15 @@
</rx>
</coalesce>
</interface>
+ <interface type='network'>
+ <source network='default'/>
+ <mac address='52:54:00:e5:48:60'/>
+ <model type='virtio'/>
+ <coalesce>
+ <rx>
+ </rx>
+ </coalesce>
+ </interface>
<serial type='pty'>
<target port='0'/>
</serial>
diff --git a/tests/qemuxml2xmloutdata/net-coalesce.xml b/tests/qemuxml2xmloutdata/net-coalesce.xml
index 3a37587dde..452ed94de3 100644
--- a/tests/qemuxml2xmloutdata/net-coalesce.xml
+++ b/tests/qemuxml2xmloutdata/net-coalesce.xml
@@ -56,6 +56,12 @@
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</interface>
+ <interface type='network'>
+ <mac address='52:54:00:e5:48:60'/>
+ <source network='default'/>
+ <model type='virtio'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
+ </interface>
<serial type='pty'>
<target type='isa-serial' port='0'>
<model name='isa-serial'/>
@@ -67,7 +73,7 @@
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
<memballoon model='virtio'>
- <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
</memballoon>
</devices>
</domain>
--
2.29.2
3 years, 8 months
[libvirt PATCH] conf: allow for a partial match when searching for an <interface>
by Laine Stump
Commit 114e3b42 modified virDomainNetFindIdx() to compare the alias
name of the <interface> being matched (in addition to already-existing
match of MAC address and PCI/CCW address). This was done in response
to https://bugzilla.redhat.com/1926190 which complained that it wasn't
possible to unplug an interface that had the same MAC address as
another <interface> (which is the way interfaces are setup when using
<teaming> - the "team" is identified in the guest virtio-net driver by
looking for another interface with the same MAC as the virtio-net
device) - the reporter of that bug did not have PCI addresses of the
devices easily available when attempting to unplug one of the two
devices, and so needed some other way to disambiguate the two
interfaces with matching MACs.
Unfortunately, this caused a regression which was caught during QE
testing - in the past it had been possible to use
virDomainUpdateDevice (which also calls virDomainNetFindIdx()) to
modify the alias name of an existing interface - with the change in
commit 114e3b42 this was no longer possible (since we would try to
match the new alias, which would of course always fail).
The solution to this regression is to allow mismatched alias names
when calling virDomainNetFindIdx() for purposes of updating a device
(indicated by the new bool argument "partialMatch"). When calling for
unplug the old behavior is maintained - in that case the alias name
must still match.
Because we need to keep track of potentially multiple "partial"
matches so that we can go back later and try to disambiguate when
necessary, I needed an array to hold the indexes of all the matches
during the "first round". There is guidance in glib-adoption.rst
saying that new libvirt code should prefer GArray/GPtrArray. A couple
of adventurous souls have used GPtrArray, but so far nobody has used
GArray, and I decided this was a good chance to try that out. It went
okay.
Reported-by: Yalan Zhang <yalzhang(a)redhat.com>
Signed-off-by: Laine Stump <laine(a)redhat.com>
---
I realized while writing this patch that an update-device test case in
qemuhotplugtest would have caught this regression and so I probably
should add such a test case to prevent it happening again, but the
testing harness for update-device was only ever made to work for
graphics devices, meaning there's some unknown amount of investigating
and rejiggering that needs to be done to make such a test work (a
quick attempt failed). Since someone is waiting on the fix for this
regression, I'm hoping that I can get a reprieve on the "add a test
case to catch thre regression" part that should accompany a bugfix
like this in exchange for a promise that I will start looking into
that immediately after I get this pushed (and then backported so
testing of the bugzilla above can be completed)
src/conf/domain_conf.c | 207 +++++++++++++++++++++++++--------------
src/conf/domain_conf.h | 2 +-
src/libxl/libxl_driver.c | 4 +-
src/lxc/lxc_driver.c | 6 +-
src/qemu/qemu_driver.c | 6 +-
src/qemu/qemu_hotplug.c | 4 +-
6 files changed, 145 insertions(+), 84 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 95602ae57e..f071bf93d0 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -16871,109 +16871,170 @@ int virDomainNetInsert(virDomainDefPtr def, virDomainNetDefPtr net)
* virDomainNetFindIdx:
* @def: domain definition
* @net: interface definition
+ * @matchPartial: true if mismatched alias is still a match
*
- * Lookup domain's network interface based on passed @net
- * definition. If @net's MAC address was auto generated,
- * the MAC comparison is ignored.
+ * Find a network interface from the domain's nets list by looking for
+ * a match to @net. The following attributes are compared when
+ * specified in @net: MAC address, PCI/CCW address, and alias name.
+ *
+ * If matchPartial is true, then an entry with mismatched alias name
+ * still counts as a match (as long as everything else that was
+ * specified matches).
+ *
+ * If @net matches multiple items in nets, that is an error.
*
* Return: index of match if unique match found,
* -1 otherwise and an error is logged.
*/
int
-virDomainNetFindIdx(virDomainDefPtr def, virDomainNetDefPtr net)
+virDomainNetFindIdx(virDomainDefPtr def,
+ virDomainNetDefPtr net,
+ bool matchPartial)
{
+ guint gi;
size_t i;
- int matchidx = -1;
+ g_autoptr(GArray) matches
+ = g_array_sized_new(false, false, sizeof(size_t), def->nnets);
char mac[VIR_MAC_STRING_BUFLEN];
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);
+ bool ambiguousPartial = false;
+ g_auto(virBuffer) errBuf = VIR_BUFFER_INITIALIZER;
+
+ /* initialize the matches array to contain the indexes for all
+ * NetDefs. We will then go through this array for each field we
+ * want to match on, removing the indexes of NetDefs that don't
+ * match for that field. At the end we'll have no match, one
+ * match, or ambiguous (multiple) matches.
+ */
+ for (i = 0; i < def->nnets; i++)
+ g_array_append_val(matches, i);
+
+ for (gi = 0; gi < matches->len;) {
+
+ i = g_array_index(matches, size_t, gi);
+ /*
+ * mac/pci/ccw addresses must always match if they are
+ * specified in the search template object
+ */
- for (i = 0; i < def->nnets; i++) {
if (MACAddrSpecified &&
- virMacAddrCmp(&def->nets[i]->mac, &net->mac) != 0)
+ virMacAddrCmp(&def->nets[i]->mac, &net->mac) != 0) {
+ g_array_remove_index(matches, gi);
continue;
+ }
if (PCIAddrSpecified &&
!virPCIDeviceAddressEqual(&def->nets[i]->info.addr.pci,
- &net->info.addr.pci))
+ &net->info.addr.pci)) {
+ g_array_remove_index(matches, gi);
continue;
+ }
if (CCWAddrSpecified &&
!virDomainDeviceCCWAddressEqual(&def->nets[i]->info.addr.ccw,
- &net->info.addr.ccw))
- continue;
-
- if (net->info.alias &&
- STRNEQ_NULLABLE(def->nets[i]->info.alias, net->info.alias)) {
- continue;
+ &net->info.addr.ccw)) {
+ g_array_remove_index(matches, gi);
+ continue;
}
- if (matchidx >= 0) {
- /* there were multiple matches on mac address, and no
- * 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.
- */
- if (MACAddrSpecified) {
- virReportError(VIR_ERR_OPERATION_FAILED,
- _("multiple devices matching MAC address %s found"),
- virMacAddrFormat(&net->mac, mac));
- } else {
- virReportError(VIR_ERR_OPERATION_FAILED, "%s",
- _("multiple matching devices found"));
- }
+ /* this NetDef matches all the mandatory fields, so keep it for now */
+ gi++;
+ }
- return -1;
- }
+ if (matches->len == 0)
+ goto cleanup;
- matchidx = i;
- }
-
- if (matchidx < 0) {
- if (MACAddrSpecified && PCIAddrSpecified) {
- virReportError(VIR_ERR_DEVICE_MISSING,
- _("no device matching MAC address %s found on "
- VIR_PCI_DEVICE_ADDRESS_FMT),
- virMacAddrFormat(&net->mac, mac),
- net->info.addr.pci.domain,
- 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),
- net->info.addr.pci.domain,
- 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"),
- virMacAddrFormat(&net->mac, mac));
- } else {
- virReportError(VIR_ERR_DEVICE_MISSING, "%s",
- _("no matching device found"));
+ /* A "partial match" is when everything but alias matches. When
+ * we've already determined that exactly one NetDef matches
+ * everything else that was specified in the object we're trying
+ * to match, counting this "partial match" as a success allows for
+ * finding an interface based on MAC/pci address, with the intent
+ * to update the alias (i.e. the alias name doesn't match because
+ * it's the *new* alias name we want to change to).
+ *
+ * We can't *always* ignore the alias though, since it is
+ * sometimes used to disambiguate between multiple NetDefs when
+ * searching for a NetDef to remove (rather than update) - in
+ * particular if there are multiple NetDefs with the same MAC
+ * address, and the caller didn't specify PCI address (because
+ * they don't know it). Obviously when it's necessary to look at
+ * the alias in order to disambiguate between two NetDefs, it
+ * won't be possible to update the alias; updating other
+ * attributes, or unplugging the device, shouldn't be a problem
+ * though.
+ */
+ if (matchPartial) {
+ if (matches->len == 1)
+ goto cleanup;
+
+ /* by the time we've checked the multiple remaining NetDefs
+ * for a match to the alias, we'll no longer have the
+ * information about ambiguity in the match prior to checking
+ * aliases, but we'll need to know that in order to report the
+ * proper error, so save that fact now.
+ */
+ ambiguousPartial = true;
+ }
+
+ if (net->info.alias) {
+ for (gi = 0; gi < matches->len;) {
+ i = g_array_index(matches, size_t, gi);
+
+ if (STRNEQ_NULLABLE(def->nets[i]->info.alias, net->info.alias))
+ g_array_remove_index(matches, gi);
+ else
+ gi++;
}
}
- return matchidx;
+
+ cleanup:
+ if (matches->len == 1)
+ return g_array_index(matches, size_t, 0);
+
+ /* make a string describing all the match terms */
+ if (MACAddrSpecified)
+ virBufferAsprintf(&errBuf, "MAC address '%s' ", virMacAddrFormat(&net->mac, mac));
+
+ if (PCIAddrSpecified) {
+ g_autofree char *pciAddrStr = virPCIDeviceAddressAsString(&net->info.addr.pci);
+
+ virBufferAsprintf(&errBuf, "PCI address '%s' ", pciAddrStr);
+ }
+
+ if (CCWAddrSpecified) {
+ virBufferAsprintf(&errBuf, "CCW address '" VIR_CCW_DEVICE_ADDRESS_FMT "' ",
+ net->info.addr.ccw.cssid,
+ net->info.addr.ccw.ssid,
+ net->info.addr.ccw.devno);
+ }
+
+ if (net->info.alias)
+ virBufferAsprintf(&errBuf, "alias name '%s' ", net->info.alias);
+
+ virBufferTrim(&errBuf, " ");
+
+ /* we either matched too many... */
+
+ if (matches->len > 1 || ambiguousPartial) {
+ virReportError(VIR_ERR_OPERATION_FAILED,
+ _("found multiple devices matching requested <interface> (%s)"),
+ virBufferContentAndReset(&errBuf));
+ return -1;
+ }
+
+
+ /* ...or not enough
+ * (at this point we know matches->len == 0, no need to check)
+ */
+
+ virReportError(VIR_ERR_OPERATION_FAILED,
+ _("found no devices matching requested <interface> (%s)"),
+ virBufferContentAndReset(&errBuf));
+ return -1;
}
bool
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 87bc7e8625..da32016b01 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -3554,7 +3554,7 @@ virDomainDiskRemove(virDomainDefPtr def, size_t i);
virDomainDiskDefPtr
virDomainDiskRemoveByName(virDomainDefPtr def, const char *name);
-int virDomainNetFindIdx(virDomainDefPtr def, virDomainNetDefPtr net);
+int virDomainNetFindIdx(virDomainDefPtr def, virDomainNetDefPtr net, bool matchPartial);
virDomainNetDefPtr virDomainNetFind(virDomainDefPtr def, const char *device);
virDomainNetDefPtr virDomainNetFindByName(virDomainDefPtr def, const char *ifname);
bool virDomainHasNet(virDomainDefPtr def, virDomainNetDefPtr net);
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index 830634b2bd..bfbfdf94e6 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -3861,7 +3861,7 @@ libxlDomainDetachNetDevice(libxlDriverPrivatePtr driver,
libxl_device_nic_init(&nic);
- if ((detachidx = virDomainNetFindIdx(vm->def, net)) < 0)
+ if ((detachidx = virDomainNetFindIdx(vm->def, net, false)) < 0)
goto cleanup;
detach = vm->def->nets[detachidx];
@@ -3990,7 +3990,7 @@ libxlDomainDetachDeviceConfig(virDomainDefPtr vmdef, virDomainDeviceDefPtr dev)
case VIR_DOMAIN_DEVICE_NET:
net = dev->data.net;
- if ((idx = virDomainNetFindIdx(vmdef, net)) < 0)
+ if ((idx = virDomainNetFindIdx(vmdef, net, false)) < 0)
return -1;
/* this is guaranteed to succeed */
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 8e0ec82e0b..d96a6f5f2e 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -3096,7 +3096,7 @@ lxcDomainUpdateDeviceConfig(virDomainDefPtr vmdef,
switch (dev->type) {
case VIR_DOMAIN_DEVICE_NET:
net = dev->data.net;
- if ((idx = virDomainNetFindIdx(vmdef, net)) < 0)
+ if ((idx = virDomainNetFindIdx(vmdef, net, true)) < 0)
return -1;
oldDev.data.net = vmdef->nets[idx];
@@ -3150,7 +3150,7 @@ lxcDomainDetachDeviceConfig(virDomainDefPtr vmdef,
case VIR_DOMAIN_DEVICE_NET:
net = dev->data.net;
- if ((idx = virDomainNetFindIdx(vmdef, net)) < 0)
+ if ((idx = virDomainNetFindIdx(vmdef, net, false)) < 0)
return -1;
/* this is guaranteed to succeed */
@@ -3962,7 +3962,7 @@ lxcDomainDetachDeviceNetLive(virDomainObjPtr vm,
const virNetDevVPortProfile *vport = NULL;
virErrorPtr save_err = NULL;
- if ((detachidx = virDomainNetFindIdx(vm->def, dev->data.net)) < 0)
+ if ((detachidx = virDomainNetFindIdx(vm->def, dev->data.net, false)) < 0)
goto cleanup;
detach = vm->def->nets[detachidx];
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index f3f8caab44..df69782f9c 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -7159,7 +7159,7 @@ qemuDomainUpdateDeviceLive(virDomainObjPtr vm,
break;
case VIR_DOMAIN_DEVICE_NET:
- if ((idx = virDomainNetFindIdx(vm->def, dev->data.net)) >= 0) {
+ if ((idx = virDomainNetFindIdx(vm->def, dev->data.net, true)) >= 0) {
oldDev.data.net = vm->def->nets[idx];
if (virDomainDefCompatibleDevice(vm->def, dev, &oldDev,
VIR_DOMAIN_DEVICE_ACTION_UPDATE,
@@ -7459,7 +7459,7 @@ qemuDomainDetachDeviceConfig(virDomainDefPtr vmdef,
case VIR_DOMAIN_DEVICE_NET:
net = dev->data.net;
- if ((idx = virDomainNetFindIdx(vmdef, net)) < 0)
+ if ((idx = virDomainNetFindIdx(vmdef, net, false)) < 0)
return -1;
/* this is guaranteed to succeed */
@@ -7686,7 +7686,7 @@ qemuDomainUpdateDeviceConfig(virDomainDefPtr vmdef,
case VIR_DOMAIN_DEVICE_NET:
net = dev->data.net;
- if ((pos = virDomainNetFindIdx(vmdef, net)) < 0)
+ if ((pos = virDomainNetFindIdx(vmdef, net, true)) < 0)
return -1;
oldDev.data.net = vmdef->nets[pos];
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 58d2abb862..f0cf75e547 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -3512,7 +3512,7 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
g_autoptr(virConnect) conn = NULL;
virErrorPtr save_err = NULL;
- if ((changeidx = virDomainNetFindIdx(vm->def, newdev)) < 0)
+ if ((changeidx = virDomainNetFindIdx(vm->def, newdev, true)) < 0)
goto cleanup;
devslot = &vm->def->nets[changeidx];
olddev = *devslot;
@@ -5664,7 +5664,7 @@ qemuDomainDetachPrepNet(virDomainObjPtr vm,
{
int detachidx;
- if ((detachidx = virDomainNetFindIdx(vm->def, match)) < 0)
+ if ((detachidx = virDomainNetFindIdx(vm->def, match, false)) < 0)
return -1;
*detach = vm->def->nets[detachidx];
--
2.30.2
3 years, 8 months
[libvirt PATCH] ci: Drop FreeBSD 11 build
by Andrea Bolognani
FreeBSD 12 was released in December 2018, so according to our
platform support policy we can now drop support for the previous
major release. It would be going EOL in September anyway.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
.gitlab-ci.yml | 10 ----------
ci/cirrus/freebsd-11.vars | 8 --------
2 files changed, 18 deletions(-)
delete mode 100644 ci/cirrus/freebsd-11.vars
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index a059ad229c..cbc1292839 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -404,16 +404,6 @@ x64-ubuntu-2004:
variables:
NAME: ubuntu-2004
-x64-freebsd-11-build:
- extends: .cirrus_build_job
- variables:
- NAME: freebsd-11
- CIRRUS_VM_INSTANCE_TYPE: freebsd_instance
- CIRRUS_VM_IMAGE_SELECTOR: image_family
- CIRRUS_VM_IMAGE_NAME: freebsd-11-4
- UPDATE_COMMAND: pkg update
- INSTALL_COMMAND: pkg install -y
-
x64-freebsd-12-build:
extends: .cirrus_build_job
variables:
diff --git a/ci/cirrus/freebsd-11.vars b/ci/cirrus/freebsd-11.vars
deleted file mode 100644
index 5add0fb058..0000000000
--- a/ci/cirrus/freebsd-11.vars
+++ /dev/null
@@ -1,8 +0,0 @@
-PACKAGING_COMMAND='pkg'
-CC='/usr/bin/clang'
-CCACHE='/usr/local/bin/ccache'
-MAKE='/usr/local/bin/gmake'
-NINJA='/usr/local/bin/ninja'
-PYTHON='/usr/local/bin/python3'
-PIP3='/usr/local/bin/pip-3.7'
-PKGS='augeas avahi bash-completion ca_root_nss ccache cppi curl cyrus-sasl dbus diffutils diskscrub dnsmasq fusefs-libs gettext git glib gmake gnutls hal libpcap libpciaccess libssh libssh2 libxml2 libxslt meson ninja perl5 pkgconf polkit py37-docutils py37-flake8 python3 qemu radvd readline yajl'
--
2.26.3
3 years, 8 months