[libvirt PATCH 0/7] Change reallocation APIs to return void
by Jiri Denemark
They can never return anything but zero anyway.
Jiri Denemark (7):
util: Drop G_GNUC_WARN_UNUSED_RESULT from reallocation APIs
Do not check return value of VIR_RESIZE_N
util: Make virResizeN return void
Do not check return value of VIR_EXPAND_N
util: Make virExpandN return void
Do not check return value of VIR_REALLOC_N
util: Make virReallocN return void
src/access/viraccessdriverstack.c | 3 +-
src/bhyve/bhyve_capabilities.c | 5 +--
src/bhyve/bhyve_parse_command.c | 19 +++-----
src/conf/backup_conf.c | 3 +-
src/conf/capabilities.c | 43 +++++-------------
src/conf/cpu_conf.c | 11 +----
src/conf/domain_addr.c | 6 +--
src/conf/domain_capabilities.c | 5 +--
src/conf/domain_conf.c | 14 +++---
src/conf/nwfilter_conf.c | 6 +--
src/conf/nwfilter_params.c | 8 +---
src/conf/storage_conf.c | 3 +-
src/conf/virinterfaceobj.c | 2 +-
src/conf/virnetworkobj.c | 4 +-
src/conf/virnodedeviceobj.c | 2 +-
src/conf/virsecretobj.c | 2 +-
src/conf/virstorageobj.c | 2 +-
src/esx/esx_driver.c | 7 +--
src/esx/esx_stream.c | 3 +-
src/hyperv/hyperv_driver.c | 3 +-
src/hyperv/hyperv_wmi.c | 3 +-
src/hypervisor/domain_driver.c | 3 +-
src/hypervisor/virclosecallbacks.c | 2 +-
src/interface/interface_backend_netcf.c | 2 +-
src/interface/interface_backend_udev.c | 2 +-
src/libxl/libxl_capabilities.c | 3 +-
src/libxl/libxl_conf.c | 23 ++++------
src/libxl/libxl_driver.c | 15 +++----
src/libxl/xen_common.c | 6 +--
src/locking/lock_driver_lockd.c | 4 +-
src/lxc/lxc_controller.c | 18 ++------
src/lxc/lxc_native.c | 33 +++++---------
src/qemu/qemu_agent.c | 11 ++---
src/qemu/qemu_capabilities.c | 3 +-
src/qemu/qemu_conf.c | 6 +--
src/qemu/qemu_domain.c | 13 +++---
src/qemu/qemu_firmware.c | 5 +--
src/qemu/qemu_hotplug.c | 36 +++++----------
src/qemu/qemu_monitor.c | 4 +-
src/qemu/qemu_monitor_json.c | 12 +----
src/qemu/qemu_process.c | 25 +----------
src/rpc/virnetclient.c | 19 ++------
src/rpc/virnetdaemon.c | 3 +-
src/rpc/virnetlibsshsession.c | 8 +---
src/rpc/virnetmessage.c | 12 ++---
src/rpc/virnetserver.c | 19 ++------
src/rpc/virnetsocket.c | 3 +-
src/rpc/virnetsshsession.c | 8 +---
src/storage/storage_backend_disk.c | 4 +-
src/storage/storage_backend_logical.c | 3 +-
src/storage/storage_backend_rbd.c | 6 +--
.../storage_file_backend_gluster.c | 3 +-
.../storage_source_backingstore.c | 3 +-
src/util/viralloc.c | 44 +++++++++----------
src/util/viralloc.h | 18 ++++----
src/util/virarptable.c | 3 +-
src/util/virbitmap.c | 5 +--
src/util/vircommand.c | 23 +++++-----
src/util/virdnsmasq.c | 13 ++----
src/util/virfile.c | 22 +++-------
src/util/virfirewall.c | 8 +---
src/util/virjson.c | 13 ++----
src/util/virlockspace.c | 7 +--
src/util/virnetlink.c | 7 ++-
src/util/virnuma.c | 14 +++---
src/util/virprocess.c | 17 +------
src/util/virresctrl.c | 42 +++++++-----------
src/util/virstring.c | 9 ++--
src/util/virsysinfo.c | 37 ++++------------
src/util/virsystemd.c | 3 +-
src/util/virthreadpool.c | 3 +-
src/util/virtypedparam-public.c | 24 ++++------
src/util/virtypedparam.c | 9 ++--
src/util/viruri.c | 8 +---
src/util/virutil.c | 14 ++----
src/vbox/vbox_common.c | 4 +-
src/vbox/vbox_snapshot_conf.c | 29 +++---------
tests/domaincapstest.c | 8 +---
tests/qemublocktest.c | 3 +-
tests/qemudomaincheckpointxml2xmltest.c | 3 +-
tests/qemumonitortestutils.c | 12 ++---
tests/securityselinuxlabeltest.c | 7 +--
tests/viralloctest.c | 15 +++----
tools/virsh-console.c | 22 ++++------
tools/virsh-domain.c | 27 +++---------
tools/virt-login-shell-helper.c | 3 +-
tools/vsh.c | 6 +--
87 files changed, 284 insertions(+), 669 deletions(-)
--
2.31.0
3 years, 8 months
[libvirt PATCH 0/2] qemu: Use g_auto* in a few more places
by Jiri Denemark
I'll be touching these functions soon, let's modernize them first.
Jiri Denemark (2):
qemu: Use g_autofree in qemuMigrationJobCheckStatus
qemu: Use g_autoptr in qemuMonitorJSONSetCapabilities
src/qemu/qemu_migration.c | 15 +++++----------
src/qemu/qemu_monitor_json.c | 19 ++++++++-----------
2 files changed, 13 insertions(+), 21 deletions(-)
--
2.31.0
3 years, 8 months
[libvirt PATCH] qemu: Drop redundant checks for qemuCaps before virQEMUCapsGet
by Jiri Denemark
virQEMUCapsGet checks for qemuCaps itself, no need to do it explicitly.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/qemu/qemu_domain.c | 5 +----
src/qemu/qemu_process.c | 3 +--
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 5c98f8ff1a..fff67481a7 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -5289,7 +5289,6 @@ qemuDomainDeviceDiskDefPostParseRestoreSecAlias(virDomainDiskDefPtr disk,
g_autofree char *encalias = NULL;
if (!(parseFlags & VIR_DOMAIN_DEF_PARSE_STATUS) ||
- !qemuCaps ||
virStorageSourceIsEmpty(disk->src) ||
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_SECRET))
return 0;
@@ -5475,7 +5474,6 @@ qemuDomainDeviceHostdevDefPostParseRestoreSecAlias(virDomainHostdevDefPtr hostde
g_autofree char *authalias = NULL;
if (!(parseFlags & VIR_DOMAIN_DEF_PARSE_STATUS) ||
- !qemuCaps ||
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_SECRET))
return 0;
@@ -5520,8 +5518,7 @@ qemuDomainDeviceHostdevDefPostParseRestoreBackendAlias(virDomainHostdevDefPtr ho
if (!(parseFlags & VIR_DOMAIN_DEF_PARSE_STATUS))
return 0;
- if (!qemuCaps ||
- hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS ||
+ if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS ||
hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI ||
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV_HOSTDEV_SCSI))
return 0;
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 0b79dde2c3..b86afe4daa 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -8349,8 +8349,7 @@ qemuProcessReconnect(void *opaque)
if (qemuHostdevUpdateActiveDomainDevices(driver, obj->def) < 0)
goto error;
- if (priv->qemuCaps &&
- virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_CHARDEV_FD_PASS))
+ if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_CHARDEV_FD_PASS))
retry = false;
if (qemuDomainObjStartWorker(obj) < 0)
--
2.31.0
3 years, 8 months
[libvirt PATCH] ci: Drop prefix from Dockerfiles
by Andrea Bolognani
Since the string "ci" is already contained in the path, it
seems unnecessary to include it into the filename too: in fact,
we only do that for Dockerfiles and not for files in ci/cirrus,
even though those are generated the very same way.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
.gitlab-ci.yml | 2 +-
ci/containers/{ci-centos-7.Dockerfile => centos-7.Dockerfile} | 0
ci/containers/{ci-centos-8.Dockerfile => centos-8.Dockerfile} | 0
.../{ci-centos-stream.Dockerfile => centos-stream.Dockerfile} | 0
...-aarch64.Dockerfile => debian-10-cross-aarch64.Dockerfile} | 0
...ss-armv6l.Dockerfile => debian-10-cross-armv6l.Dockerfile} | 0
...ss-armv7l.Dockerfile => debian-10-cross-armv7l.Dockerfile} | 0
...-cross-i686.Dockerfile => debian-10-cross-i686.Dockerfile} | 0
...-cross-mips.Dockerfile => debian-10-cross-mips.Dockerfile} | 0
...ips64el.Dockerfile => debian-10-cross-mips64el.Dockerfile} | 0
...ss-mipsel.Dockerfile => debian-10-cross-mipsel.Dockerfile} | 0
...-ppc64le.Dockerfile => debian-10-cross-ppc64le.Dockerfile} | 0
...ross-s390x.Dockerfile => debian-10-cross-s390x.Dockerfile} | 0
.../{ci-debian-10.Dockerfile => debian-10.Dockerfile} | 0
...aarch64.Dockerfile => debian-sid-cross-aarch64.Dockerfile} | 0
...s-armv6l.Dockerfile => debian-sid-cross-armv6l.Dockerfile} | 0
...s-armv7l.Dockerfile => debian-sid-cross-armv7l.Dockerfile} | 0
...cross-i686.Dockerfile => debian-sid-cross-i686.Dockerfile} | 0
...ps64el.Dockerfile => debian-sid-cross-mips64el.Dockerfile} | 0
...s-mipsel.Dockerfile => debian-sid-cross-mipsel.Dockerfile} | 0
...ppc64le.Dockerfile => debian-sid-cross-ppc64le.Dockerfile} | 0
...oss-s390x.Dockerfile => debian-sid-cross-s390x.Dockerfile} | 0
.../{ci-debian-sid.Dockerfile => debian-sid.Dockerfile} | 0
.../{ci-fedora-32.Dockerfile => fedora-32.Dockerfile} | 0
.../{ci-fedora-33.Dockerfile => fedora-33.Dockerfile} | 0
...w32.Dockerfile => fedora-rawhide-cross-mingw32.Dockerfile} | 0
...w64.Dockerfile => fedora-rawhide-cross-mingw64.Dockerfile} | 0
...ci-fedora-rawhide.Dockerfile => fedora-rawhide.Dockerfile} | 0
.../{ci-opensuse-152.Dockerfile => opensuse-152.Dockerfile} | 0
.../{ci-ubuntu-1804.Dockerfile => ubuntu-1804.Dockerfile} | 0
.../{ci-ubuntu-2004.Dockerfile => ubuntu-2004.Dockerfile} | 0
ci/helper | 4 ++--
32 files changed, 3 insertions(+), 3 deletions(-)
rename ci/containers/{ci-centos-7.Dockerfile => centos-7.Dockerfile} (100%)
rename ci/containers/{ci-centos-8.Dockerfile => centos-8.Dockerfile} (100%)
rename ci/containers/{ci-centos-stream.Dockerfile => centos-stream.Dockerfile} (100%)
rename ci/containers/{ci-debian-10-cross-aarch64.Dockerfile => debian-10-cross-aarch64.Dockerfile} (100%)
rename ci/containers/{ci-debian-10-cross-armv6l.Dockerfile => debian-10-cross-armv6l.Dockerfile} (100%)
rename ci/containers/{ci-debian-10-cross-armv7l.Dockerfile => debian-10-cross-armv7l.Dockerfile} (100%)
rename ci/containers/{ci-debian-10-cross-i686.Dockerfile => debian-10-cross-i686.Dockerfile} (100%)
rename ci/containers/{ci-debian-10-cross-mips.Dockerfile => debian-10-cross-mips.Dockerfile} (100%)
rename ci/containers/{ci-debian-10-cross-mips64el.Dockerfile => debian-10-cross-mips64el.Dockerfile} (100%)
rename ci/containers/{ci-debian-10-cross-mipsel.Dockerfile => debian-10-cross-mipsel.Dockerfile} (100%)
rename ci/containers/{ci-debian-10-cross-ppc64le.Dockerfile => debian-10-cross-ppc64le.Dockerfile} (100%)
rename ci/containers/{ci-debian-10-cross-s390x.Dockerfile => debian-10-cross-s390x.Dockerfile} (100%)
rename ci/containers/{ci-debian-10.Dockerfile => debian-10.Dockerfile} (100%)
rename ci/containers/{ci-debian-sid-cross-aarch64.Dockerfile => debian-sid-cross-aarch64.Dockerfile} (100%)
rename ci/containers/{ci-debian-sid-cross-armv6l.Dockerfile => debian-sid-cross-armv6l.Dockerfile} (100%)
rename ci/containers/{ci-debian-sid-cross-armv7l.Dockerfile => debian-sid-cross-armv7l.Dockerfile} (100%)
rename ci/containers/{ci-debian-sid-cross-i686.Dockerfile => debian-sid-cross-i686.Dockerfile} (100%)
rename ci/containers/{ci-debian-sid-cross-mips64el.Dockerfile => debian-sid-cross-mips64el.Dockerfile} (100%)
rename ci/containers/{ci-debian-sid-cross-mipsel.Dockerfile => debian-sid-cross-mipsel.Dockerfile} (100%)
rename ci/containers/{ci-debian-sid-cross-ppc64le.Dockerfile => debian-sid-cross-ppc64le.Dockerfile} (100%)
rename ci/containers/{ci-debian-sid-cross-s390x.Dockerfile => debian-sid-cross-s390x.Dockerfile} (100%)
rename ci/containers/{ci-debian-sid.Dockerfile => debian-sid.Dockerfile} (100%)
rename ci/containers/{ci-fedora-32.Dockerfile => fedora-32.Dockerfile} (100%)
rename ci/containers/{ci-fedora-33.Dockerfile => fedora-33.Dockerfile} (100%)
rename ci/containers/{ci-fedora-rawhide-cross-mingw32.Dockerfile => fedora-rawhide-cross-mingw32.Dockerfile} (100%)
rename ci/containers/{ci-fedora-rawhide-cross-mingw64.Dockerfile => fedora-rawhide-cross-mingw64.Dockerfile} (100%)
rename ci/containers/{ci-fedora-rawhide.Dockerfile => fedora-rawhide.Dockerfile} (100%)
rename ci/containers/{ci-opensuse-152.Dockerfile => opensuse-152.Dockerfile} (100%)
rename ci/containers/{ci-ubuntu-1804.Dockerfile => ubuntu-1804.Dockerfile} (100%)
rename ci/containers/{ci-ubuntu-2004.Dockerfile => ubuntu-2004.Dockerfile} (100%)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 81a4e80fd8..a059ad229c 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -31,7 +31,7 @@ stages:
- docker login registry.gitlab.com -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD"
script:
- docker pull "$TAG" || docker pull "$COMMON_TAG" || true
- - docker build --cache-from "$TAG" --cache-from "$COMMON_TAG" --tag "$TAG" -f "ci/containers/ci-$NAME.Dockerfile" ci/containers
+ - docker build --cache-from "$TAG" --cache-from "$COMMON_TAG" --tag "$TAG" -f "ci/containers/$NAME.Dockerfile" ci/containers
- docker push "$TAG"
after_script:
- docker logout
diff --git a/ci/containers/ci-centos-7.Dockerfile b/ci/containers/centos-7.Dockerfile
similarity index 100%
rename from ci/containers/ci-centos-7.Dockerfile
rename to ci/containers/centos-7.Dockerfile
diff --git a/ci/containers/ci-centos-8.Dockerfile b/ci/containers/centos-8.Dockerfile
similarity index 100%
rename from ci/containers/ci-centos-8.Dockerfile
rename to ci/containers/centos-8.Dockerfile
diff --git a/ci/containers/ci-centos-stream.Dockerfile b/ci/containers/centos-stream.Dockerfile
similarity index 100%
rename from ci/containers/ci-centos-stream.Dockerfile
rename to ci/containers/centos-stream.Dockerfile
diff --git a/ci/containers/ci-debian-10-cross-aarch64.Dockerfile b/ci/containers/debian-10-cross-aarch64.Dockerfile
similarity index 100%
rename from ci/containers/ci-debian-10-cross-aarch64.Dockerfile
rename to ci/containers/debian-10-cross-aarch64.Dockerfile
diff --git a/ci/containers/ci-debian-10-cross-armv6l.Dockerfile b/ci/containers/debian-10-cross-armv6l.Dockerfile
similarity index 100%
rename from ci/containers/ci-debian-10-cross-armv6l.Dockerfile
rename to ci/containers/debian-10-cross-armv6l.Dockerfile
diff --git a/ci/containers/ci-debian-10-cross-armv7l.Dockerfile b/ci/containers/debian-10-cross-armv7l.Dockerfile
similarity index 100%
rename from ci/containers/ci-debian-10-cross-armv7l.Dockerfile
rename to ci/containers/debian-10-cross-armv7l.Dockerfile
diff --git a/ci/containers/ci-debian-10-cross-i686.Dockerfile b/ci/containers/debian-10-cross-i686.Dockerfile
similarity index 100%
rename from ci/containers/ci-debian-10-cross-i686.Dockerfile
rename to ci/containers/debian-10-cross-i686.Dockerfile
diff --git a/ci/containers/ci-debian-10-cross-mips.Dockerfile b/ci/containers/debian-10-cross-mips.Dockerfile
similarity index 100%
rename from ci/containers/ci-debian-10-cross-mips.Dockerfile
rename to ci/containers/debian-10-cross-mips.Dockerfile
diff --git a/ci/containers/ci-debian-10-cross-mips64el.Dockerfile b/ci/containers/debian-10-cross-mips64el.Dockerfile
similarity index 100%
rename from ci/containers/ci-debian-10-cross-mips64el.Dockerfile
rename to ci/containers/debian-10-cross-mips64el.Dockerfile
diff --git a/ci/containers/ci-debian-10-cross-mipsel.Dockerfile b/ci/containers/debian-10-cross-mipsel.Dockerfile
similarity index 100%
rename from ci/containers/ci-debian-10-cross-mipsel.Dockerfile
rename to ci/containers/debian-10-cross-mipsel.Dockerfile
diff --git a/ci/containers/ci-debian-10-cross-ppc64le.Dockerfile b/ci/containers/debian-10-cross-ppc64le.Dockerfile
similarity index 100%
rename from ci/containers/ci-debian-10-cross-ppc64le.Dockerfile
rename to ci/containers/debian-10-cross-ppc64le.Dockerfile
diff --git a/ci/containers/ci-debian-10-cross-s390x.Dockerfile b/ci/containers/debian-10-cross-s390x.Dockerfile
similarity index 100%
rename from ci/containers/ci-debian-10-cross-s390x.Dockerfile
rename to ci/containers/debian-10-cross-s390x.Dockerfile
diff --git a/ci/containers/ci-debian-10.Dockerfile b/ci/containers/debian-10.Dockerfile
similarity index 100%
rename from ci/containers/ci-debian-10.Dockerfile
rename to ci/containers/debian-10.Dockerfile
diff --git a/ci/containers/ci-debian-sid-cross-aarch64.Dockerfile b/ci/containers/debian-sid-cross-aarch64.Dockerfile
similarity index 100%
rename from ci/containers/ci-debian-sid-cross-aarch64.Dockerfile
rename to ci/containers/debian-sid-cross-aarch64.Dockerfile
diff --git a/ci/containers/ci-debian-sid-cross-armv6l.Dockerfile b/ci/containers/debian-sid-cross-armv6l.Dockerfile
similarity index 100%
rename from ci/containers/ci-debian-sid-cross-armv6l.Dockerfile
rename to ci/containers/debian-sid-cross-armv6l.Dockerfile
diff --git a/ci/containers/ci-debian-sid-cross-armv7l.Dockerfile b/ci/containers/debian-sid-cross-armv7l.Dockerfile
similarity index 100%
rename from ci/containers/ci-debian-sid-cross-armv7l.Dockerfile
rename to ci/containers/debian-sid-cross-armv7l.Dockerfile
diff --git a/ci/containers/ci-debian-sid-cross-i686.Dockerfile b/ci/containers/debian-sid-cross-i686.Dockerfile
similarity index 100%
rename from ci/containers/ci-debian-sid-cross-i686.Dockerfile
rename to ci/containers/debian-sid-cross-i686.Dockerfile
diff --git a/ci/containers/ci-debian-sid-cross-mips64el.Dockerfile b/ci/containers/debian-sid-cross-mips64el.Dockerfile
similarity index 100%
rename from ci/containers/ci-debian-sid-cross-mips64el.Dockerfile
rename to ci/containers/debian-sid-cross-mips64el.Dockerfile
diff --git a/ci/containers/ci-debian-sid-cross-mipsel.Dockerfile b/ci/containers/debian-sid-cross-mipsel.Dockerfile
similarity index 100%
rename from ci/containers/ci-debian-sid-cross-mipsel.Dockerfile
rename to ci/containers/debian-sid-cross-mipsel.Dockerfile
diff --git a/ci/containers/ci-debian-sid-cross-ppc64le.Dockerfile b/ci/containers/debian-sid-cross-ppc64le.Dockerfile
similarity index 100%
rename from ci/containers/ci-debian-sid-cross-ppc64le.Dockerfile
rename to ci/containers/debian-sid-cross-ppc64le.Dockerfile
diff --git a/ci/containers/ci-debian-sid-cross-s390x.Dockerfile b/ci/containers/debian-sid-cross-s390x.Dockerfile
similarity index 100%
rename from ci/containers/ci-debian-sid-cross-s390x.Dockerfile
rename to ci/containers/debian-sid-cross-s390x.Dockerfile
diff --git a/ci/containers/ci-debian-sid.Dockerfile b/ci/containers/debian-sid.Dockerfile
similarity index 100%
rename from ci/containers/ci-debian-sid.Dockerfile
rename to ci/containers/debian-sid.Dockerfile
diff --git a/ci/containers/ci-fedora-32.Dockerfile b/ci/containers/fedora-32.Dockerfile
similarity index 100%
rename from ci/containers/ci-fedora-32.Dockerfile
rename to ci/containers/fedora-32.Dockerfile
diff --git a/ci/containers/ci-fedora-33.Dockerfile b/ci/containers/fedora-33.Dockerfile
similarity index 100%
rename from ci/containers/ci-fedora-33.Dockerfile
rename to ci/containers/fedora-33.Dockerfile
diff --git a/ci/containers/ci-fedora-rawhide-cross-mingw32.Dockerfile b/ci/containers/fedora-rawhide-cross-mingw32.Dockerfile
similarity index 100%
rename from ci/containers/ci-fedora-rawhide-cross-mingw32.Dockerfile
rename to ci/containers/fedora-rawhide-cross-mingw32.Dockerfile
diff --git a/ci/containers/ci-fedora-rawhide-cross-mingw64.Dockerfile b/ci/containers/fedora-rawhide-cross-mingw64.Dockerfile
similarity index 100%
rename from ci/containers/ci-fedora-rawhide-cross-mingw64.Dockerfile
rename to ci/containers/fedora-rawhide-cross-mingw64.Dockerfile
diff --git a/ci/containers/ci-fedora-rawhide.Dockerfile b/ci/containers/fedora-rawhide.Dockerfile
similarity index 100%
rename from ci/containers/ci-fedora-rawhide.Dockerfile
rename to ci/containers/fedora-rawhide.Dockerfile
diff --git a/ci/containers/ci-opensuse-152.Dockerfile b/ci/containers/opensuse-152.Dockerfile
similarity index 100%
rename from ci/containers/ci-opensuse-152.Dockerfile
rename to ci/containers/opensuse-152.Dockerfile
diff --git a/ci/containers/ci-ubuntu-1804.Dockerfile b/ci/containers/ubuntu-1804.Dockerfile
similarity index 100%
rename from ci/containers/ci-ubuntu-1804.Dockerfile
rename to ci/containers/ubuntu-1804.Dockerfile
diff --git a/ci/containers/ci-ubuntu-2004.Dockerfile b/ci/containers/ubuntu-2004.Dockerfile
similarity index 100%
rename from ci/containers/ci-ubuntu-2004.Dockerfile
rename to ci/containers/ubuntu-2004.Dockerfile
diff --git a/ci/helper b/ci/helper
index 7032c816d5..2c3a9f8db4 100755
--- a/ci/helper
+++ b/ci/helper
@@ -197,11 +197,11 @@ class Application:
def _generate_dockerfile(self, host, cross=None):
args = ["dockerfile", host, "libvirt"]
outdir = self._basedir.joinpath("containers")
- outfile = f"ci-{host}.Dockerfile"
+ outfile = f"{host}.Dockerfile"
if cross:
args.extend(["--cross", cross])
- outfile = f"ci-{host}-cross-{cross}.Dockerfile"
+ outfile = f"{host}-cross-{cross}.Dockerfile"
outpath = outdir.joinpath(outfile)
if not self._args.quiet:
--
2.26.3
3 years, 8 months
[PATCH 0/3] qemu: Enable virDomainBackupBegin for full backups
by Peter Krempa
Peter Krempa (3):
qemu: capabilities: Introduce QEMU_CAPS_BLOCKDEV_BACKUP
qemu: backup: Enable full backup support
NEWS: Mention support for full backups via virDomainBackupBegin
NEWS.rst | 9 ++++++
src/qemu/qemu_backup.c | 28 +++++++++++++++----
src/qemu/qemu_capabilities.c | 7 ++++-
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_domain.c | 3 --
.../caps_4.2.0.aarch64.xml | 1 +
.../qemucapabilitiesdata/caps_4.2.0.s390x.xml | 1 +
.../caps_4.2.0.x86_64.xml | 1 +
.../caps_5.0.0.aarch64.xml | 1 +
.../qemucapabilitiesdata/caps_5.0.0.ppc64.xml | 1 +
.../caps_5.0.0.riscv64.xml | 1 +
.../caps_5.0.0.x86_64.xml | 1 +
.../qemucapabilitiesdata/caps_5.1.0.sparc.xml | 1 +
.../caps_5.1.0.x86_64.xml | 1 +
.../caps_5.2.0.aarch64.xml | 1 +
.../qemucapabilitiesdata/caps_5.2.0.ppc64.xml | 1 +
.../caps_5.2.0.riscv64.xml | 1 +
.../qemucapabilitiesdata/caps_5.2.0.s390x.xml | 1 +
.../caps_5.2.0.x86_64.xml | 1 +
.../caps_6.0.0.x86_64.xml | 1 +
20 files changed, 54 insertions(+), 9 deletions(-)
--
2.29.2
3 years, 8 months
[libvirt PATCH v2 00/51] Refactor XML parsing boilerplate code
by Tim Wiederhake
This series replaces some recurring boilerplate code in src/conf/ regarding
the extraction of a virTristate(Switch|Bool) XML attribute.
The boilerplate code looks roughly like this,
g_autofree char *str = NULL;
if (str = virXMLPropString(node, ...)) {
int val;
if ((val = virTristateBoolTypeFromString(str)) <= 0) {
virReportError(...)
return -1;
}
def->... = val;
}
with some variations regarding how `str` is free'd in case of later re-use,
the exact error message for invalid values, whether or not
`VIR_TRISTATE_(SWITCH|BOOL)_ABSENT` is explicitly checked for (`val < 0` vs.
`val <= 0`), whether an intermediate variable is used or the value is assigned
directly, and in some cases the conditions in the two if-blocks are merged.
As a side effect, this makes the error messages for invalid values in these
attributes much more consistent and catches some instances where e.g.
`<foo bar="default"/>` would incorrectly be accepted.
V1: https://listman.redhat.com/archives/libvir-list/2021-March/msg00853.html
Changes since V1:
* Rebased (resolved conflict)
* Added functions to libvirt_private.syms
* Patch "virStorageAdapterFCHost: Fix comment" became obsolete
* Changed some member variable types to virTristate(Bool|Switch), that
cleaned up the actual conversions significantly
* Applied the feedback regarding the new functions in virxml
Tim Wiederhake (51):
conf: Use virTristateXXX in virStorageSource
conf: Use virTristateXXX in virStorageSourceNVMeDef
conf: Use virTristateXXX in virDomainDeviceInfo
conf: Use virTristateXXX in virDomainDiskDef
conf: Use virTristateXXX in virDomainActualNetDef
conf: Use virTristateXXX in virDomainNetDef
conf: Use virTristateXXX in virDomainChrSourceDef
conf: Use virTristateXXX in virDomainGraphicsDef
conf: Use virTristateXXX in virDomainMemballoonDef
conf: Use virTristateXXX in virDomainLoaderDef
conf: Use virTristateXXX in virDomainDef
conf: Use virTristateXXX in virStorageAdapterFCHost
conf: Use virTristateXXX in virStoragePoolSourceDevice
conf: Use virTristateXXX in virPCIDeviceAddress
virxml: Add virXMLPropTristateBool
virxml: Add virXMLPropTristateSwitch
domain_conf: Use virXMLPropTristateXXX in
virDomainKeyWrapCipherDefParseXML
domain_conf: Use virXMLPropTristateXXX in
virDomainVirtioOptionsParseXML
domain_conf: Use virXMLPropTristateXXX in virDomainDeviceInfoParseXML
domain_conf: Use virXMLPropTristateXXX in
virDomainDiskSourceNetworkParse
domain_conf: Use virXMLPropTristateXXX in virDomainDiskSourceNVMeParse
domain_conf: Use virXMLPropTristateXXX in
virDomainDiskDefDriverParseXML
domain_conf: Use virXMLPropTristateXXX in
virDomainActualNetDefParseXML
domain_conf: Use virXMLPropTristateXXX in
virDomainChrSourceReconnectDefParseXML
domain_conf: Use virXMLPropTristateXXX in virDomainNetDefParseXML
domain_conf: Use virXMLPropTristateXXX in
virDomainChrSourceDefParseTCP
domain_conf: Use virXMLPropTristateXXX in
virDomainChrSourceDefParseFile
domain_conf: Use virXMLPropTristateXXX in
virDomainChrSourceDefParseLog
domain_conf: Use virXMLPropTristateXXX in
virDomainGraphicsDefParseXMLVNC
domain_conf: Use virXMLPropTristateXXX in
virDomainGraphicsDefParseXMLSDL
domain_conf: Use virXMLPropTristateXXX in
virDomainGraphicsDefParseXMLSpice
domain_conf: Use virXMLPropTristateXXX in virDomainAudioCommonParse
domain_conf: Use virXMLPropTristateXXX in virDomainAudioJackParse
domain_conf: Use virXMLPropTristateXXX in virDomainAudioOSSParse
domain_conf: Use virXMLPropTristateXXX in virDomainAudioDefParseXML
domain_conf: Use virXMLPropTristateXXX in
virDomainMemballoonDefParseXML
domain_conf: Use virXMLPropTristateXXX in virDomainShmemDefParseXML
domain_conf: Use virXMLPropTristateXXX in
virDomainPerfEventDefParseXML
domain_conf: Use virXMLPropTristateXXX in virDomainMemoryDefParseXML
domain_conf: Use virXMLPropTristateXXX in virDomainIOMMUDefParseXML
domain_conf: Use virXMLPropTristateXXX in virDomainVsockDefParseXML
domain_conf: Use virXMLPropTristateXXX in virDomainFeaturesDefParse
domain_conf: Use virXMLPropTristateXXX in virDomainLoaderDefParseXML
domain_conf: Use virXMLPropTristateXXX in virDomainVcpuParse
backup_conf: Use virXMLPropTristateXXX in
virDomainBackupDiskDefParseXML
backup_conf: Use virXMLPropTristateXXX in virDomainBackupDefParse
device_conf: Use virXMLPropTristateXXX in virPCIDeviceAddressParseXML
network_conf: Use virXMLPropTristateXXX in
virNetworkForwardNatDefParseXML
numa_conf: Use virXMLPropTristateXXX in virDomainNumaDefParseXML
storage_adapter_conf: Use virXMLPropTristateXXX in
virStorageAdapterParseXMLFCHost
storage_conf: Use virXMLPropTristateXXX in
virStoragePoolDefParseSource
src/conf/backup_conf.c | 32 +-
src/conf/device_conf.c | 8 +-
src/conf/device_conf.h | 4 +-
src/conf/domain_conf.c | 795 +++++++-------------------------
src/conf/domain_conf.h | 28 +-
src/conf/network_conf.c | 15 +-
src/conf/numa_conf.c | 14 +-
src/conf/storage_adapter_conf.c | 14 +-
src/conf/storage_adapter_conf.h | 2 +-
src/conf/storage_conf.c | 17 +-
src/conf/storage_conf.h | 2 +-
src/conf/storage_source_conf.h | 4 +-
src/libvirt_private.syms | 2 +
src/qemu/qemu_command.c | 3 +-
src/qemu/qemu_hotplug.c | 2 +-
src/util/virpci.h | 2 +-
src/util/virxml.c | 82 ++++
src/util/virxml.h | 9 +
18 files changed, 302 insertions(+), 733 deletions(-)
--
2.26.2
3 years, 8 months
[PATCH 0/3] Add event for hypervisor faults and implement it for qemu
by Peter Krempa
Peter Krempa (3):
qemuMonitorJSONGetStatus: Refactor cleanup
API: Add VIR_DOMAIN_PAUSED_HYPERVISOR_FAULT enum value
qemu: Update paused reason on unexpected 'STOP' event
examples/c/misc/event-test.c | 3 +++
include/libvirt/libvirt-domain.h | 2 ++
src/conf/domain_conf.c | 1 +
src/qemu/qemu_domain.c | 4 ++++
src/qemu/qemu_domain.h | 1 +
src/qemu/qemu_driver.c | 37 ++++++++++++++++++++++++++++++++
src/qemu/qemu_monitor.c | 4 +++-
src/qemu/qemu_monitor_json.c | 18 ++++++----------
src/qemu/qemu_process.c | 22 ++++++++++++++++---
tools/virsh-domain-monitor.c | 1 +
tools/virsh-domain.c | 3 ++-
11 files changed, 79 insertions(+), 17 deletions(-)
--
2.29.2
3 years, 8 months
[PATCH] qemu: backup: Restore security label on backup disk store image on VM termination
by Peter Krempa
When the backup job is terminated normally the security label is
restored by the blockjob finishing handler.
If the VM dies or is destroyed that wouldn't happen as the blockjob
handler wouldn't be called.
Restore the security label on disk store where we remember that the job
was running at the point when 'qemuBackupJobTerminate' was called.
Not resetting the security label means that we also leak the xattr
attributes remembering the label which prevents any further use of the
file, which is a problem for block devices.
This also requires that the call to 'qemuBackupJobTerminate' from
'qemuProcessStop' happens only after 'vm->pid' was reset as otherwise
the security subdrivers attempt to enter the process namespace which
fails if the process isn't running any more.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1939082
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_backup.c | 36 ++++++++++++++++++++++++++----------
src/qemu/qemu_process.c | 8 ++++----
2 files changed, 30 insertions(+), 14 deletions(-)
diff --git a/src/qemu/qemu_backup.c b/src/qemu/qemu_backup.c
index f91d632715..430c11762c 100644
--- a/src/qemu/qemu_backup.c
+++ b/src/qemu/qemu_backup.c
@@ -28,6 +28,7 @@
#include "qemu_monitor_json.h"
#include "qemu_checkpoint.h"
#include "qemu_command.h"
+#include "qemu_security.h"
#include "storage_source.h"
#include "storage_source_conf.h"
@@ -558,25 +559,40 @@ qemuBackupJobTerminate(virDomainObjPtr vm,
{
qemuDomainObjPrivatePtr priv = vm->privateData;
+ g_autoptr(virQEMUDriverConfig) cfg = NULL;
size_t i;
- if (!(priv->backup->apiFlags & VIR_DOMAIN_BACKUP_BEGIN_REUSE_EXTERNAL) &&
- (priv->backup->type == VIR_DOMAIN_BACKUP_TYPE_PULL ||
- (priv->backup->type == VIR_DOMAIN_BACKUP_TYPE_PUSH &&
- jobstatus != QEMU_DOMAIN_JOB_STATUS_COMPLETED))) {
+ for (i = 0; i < priv->backup->ndisks; i++) {
+ virDomainBackupDiskDefPtr backupdisk = priv->backup->disks + i;
- g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(priv->driver);
+ if (!backupdisk->store)
+ continue;
+
+ /* restore security label on the images in case the blockjob finishing
+ * handler didn't do so, such as when the VM was destroyed */
+ if (backupdisk->state == VIR_DOMAIN_BACKUP_DISK_STATE_RUNNING ||
+ backupdisk->state == VIR_DOMAIN_BACKUP_DISK_STATE_NONE) {
+ if (qemuSecurityRestoreImageLabel(priv->driver, vm, backupdisk->store,
+ false) < 0)
+ VIR_WARN("Unable to restore security label on %s",
+ NULLSTR(backupdisk->store->path));
+ }
+
+ /* delete unneeded images created by libvirt */
+ if (backupdisk->store->type == VIR_STORAGE_TYPE_FILE &&
+ !(priv->backup->apiFlags & VIR_DOMAIN_BACKUP_BEGIN_REUSE_EXTERNAL) &&
+ (priv->backup->type == VIR_DOMAIN_BACKUP_TYPE_PULL ||
+ (priv->backup->type == VIR_DOMAIN_BACKUP_TYPE_PUSH &&
+ jobstatus != QEMU_DOMAIN_JOB_STATUS_COMPLETED))) {
- for (i = 0; i < priv->backup->ndisks; i++) {
- virDomainBackupDiskDefPtr backupdisk = priv->backup->disks + i;
uid_t uid;
gid_t gid;
- if (!backupdisk->store ||
- backupdisk->store->type != VIR_STORAGE_TYPE_FILE)
- continue;
+ if (!cfg)
+ cfg = virQEMUDriverGetConfig(priv->driver);
qemuDomainGetImageIds(cfg, vm, backupdisk->store, NULL, &uid, &gid);
+
if (virFileRemove(backupdisk->store->path, uid, gid) < 0)
VIR_WARN("failed to remove scratch file '%s'",
backupdisk->store->path);
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 5f31260221..0b79dde2c3 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -7822,10 +7822,6 @@ void qemuProcessStop(virQEMUDriverPtr driver,
virResctrlAllocRemove(vm->def->resctrls[i]->alloc);
}
- /* clean up a possible backup job */
- if (priv->backup)
- qemuBackupJobTerminate(vm, QEMU_DOMAIN_JOB_STATUS_CANCELED);
-
qemuProcessRemoveDomainStatus(driver, vm);
/* Remove VNC and Spice ports from port reservation bitmap, but only if
@@ -7877,6 +7873,10 @@ void qemuProcessStop(virQEMUDriverPtr driver,
for (i = 0; i < vm->def->niothreadids; i++)
vm->def->iothreadids[i]->thread_id = 0;
+ /* clean up a possible backup job */
+ if (priv->backup)
+ qemuBackupJobTerminate(vm, QEMU_DOMAIN_JOB_STATUS_CANCELED);
+
/* Do this explicitly after vm->pid is reset so that security drivers don't
* try to enter the domain's namespace which is non-existent by now as qemu
* is no longer running. */
--
2.29.2
3 years, 8 months
Host attached usb device lost during a managedsave/start sequence
by Hans-Peter Jansen
Hi,
using libvirt 7.1.0, qemu-kvm 5.2.0 on a host with kernel 5.11.6 (otherwise
Leap 15.2), I noticed an issue within a managedsave/start sequence.
After resuming a w2k19 client, accessing a host attached usb device fails.
It is still attached, but the client doesn't recognize the device anymore.
Reattaching fails with:
$ virsh attach-device fs2k19 /work/libvirt/devices/fs2k19.xml
error: Failed to attach device from /work/libvirt/devices/fs2k19.xml
error: Angeforderte Operation ist nicht gültig: USB device 001:007 is in use
by driver QEMU, domain fs2k19
Manually detaching and reattaching it works fine:
$ virsh detach-device fs2k19 /work/libvirt/devices/fs2k19.xml
Device detached successfully
virsh attach-device fs2k19 /work/libvirt/devices/fs2k19.xml
Device attached successfully
Let me know, if you need more details on this.
Pete
3 years, 8 months