[PATCH 0/5] qemu: Introduce control of qcow2 metadata cache maximum size
by Peter Krempa
See patch 3/5 for explanation.
Peter Krempa (5):
virDomainDiskDefFormatDriver: Rename 'driverBuf' to 'attrBuf'
virDomainSnapshotDiskDefFormat: Use virXMLFormatElement
conf: Introduce <metadata_cache> subelement of <disk><driver>
conf: snapshot: Add support for <metadata_cache>
qemu: Implement '<metadata_cache><max_size>' control for qcow2
docs/formatdomain.rst | 43 ++++++++++
docs/formatsnapshot.html.in | 4 +
docs/schemas/domaincommon.rng | 20 ++++-
docs/schemas/domainsnapshot.rng | 10 ++-
src/conf/domain_conf.c | 81 ++++++++++++++-----
src/conf/snapshot_conf.c | 50 ++++++++----
src/qemu/qemu_block.c | 11 +++
src/qemu/qemu_domain.c | 15 ++++
src/qemu/qemu_snapshot.c | 14 ++++
src/util/virstoragefile.c | 1 +
src/util/virstoragefile.h | 2 +
.../qcow2-metadata-cache.xml | 14 ++++
.../qcow2-metadata-cache.xml | 18 +++++
tests/qemudomainsnapshotxml2xmltest.c | 3 +
.../disk-metadata-cache.x86_64-latest.args | 57 +++++++++++++
.../qemuxml2argvdata/disk-metadata-cache.xml | 46 +++++++++++
tests/qemuxml2argvtest.c | 1 +
.../disk-metadata-cache.x86_64-latest.xml | 58 +++++++++++++
tests/qemuxml2xmltest.c | 1 +
19 files changed, 411 insertions(+), 38 deletions(-)
create mode 100644 tests/qemudomainsnapshotxml2xmlin/qcow2-metadata-cache.xml
create mode 100644 tests/qemudomainsnapshotxml2xmlout/qcow2-metadata-cache.xml
create mode 100644 tests/qemuxml2argvdata/disk-metadata-cache.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/disk-metadata-cache.xml
create mode 100644 tests/qemuxml2xmloutdata/disk-metadata-cache.x86_64-latest.xml
--
2.29.2
3 years, 11 months
[PATCH 0/2] fix re-attach of bridge device for <interface type='bridge'>
by Laine Stump
For a long time I thought this worked, but during discussion in a
bugzilla report one day I realized it only worked properly for
<interface type='network'> - we're not even trying to reattach bridges
during libvirtd restart for type='bridge' (i.e. no associated libvirt
network).
These two patches together fix that problem.
Laine Stump (2):
call virDomainNetNotifyActualDevice() for all interface types
use g_autoptr for (almost) all virConnectPtrs used with
virGetConnectNetwork()
src/conf/domain_conf.c | 3 +--
src/libxl/libxl_driver.c | 24 +++++++++---------------
src/lxc/lxc_driver.c | 17 +++++------------
src/lxc/lxc_process.c | 19 +++++++------------
src/qemu/qemu_process.c | 9 ++++-----
5 files changed, 26 insertions(+), 46 deletions(-)
--
2.29.2
3 years, 11 months
[libvirt PATCH] Fix MinGW pipeline after 49cb59778a4e6c2d04bb9383a9d97fbbc83f9fce
by Erik Skultety
Signed-off-by: Erik Skultety <eskultet(a)redhat.com>
---
personal pipeline: https://gitlab.com/eskultety/libvirt/-/pipelines/239002989
Pushed under the build breaker rule.
src/util/virmdev.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/util/virmdev.c b/src/util/virmdev.c
index fc27e9e45d..46db6249de 100644
--- a/src/util/virmdev.c
+++ b/src/util/virmdev.c
@@ -354,7 +354,12 @@ virMediatedDevicePtr
virMediatedDeviceListSteal(virMediatedDeviceListPtr list,
virMediatedDevicePtr dev)
{
- int idx = virMediatedDeviceListFindIndex(list, dev->path);
+ int idx = -1;
+
+ if (!dev)
+ return NULL;
+
+ idx = virMediatedDeviceListFindIndex(list, dev->path);
return virMediatedDeviceListStealIndex(list, idx);
}
--
2.29.2
3 years, 11 months
[PATCH] storageBackendCreatePloop: Refactor cleanup
by Yi Li
get rid of the 'cleanup:' label and created variable.
Signed-off-by: Yi Li <yili(a)winhong.com>
---
src/storage/storage_util.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c
index 2478cb0a4a..2e2c7dc68a 100644
--- a/src/storage/storage_util.c
+++ b/src/storage/storage_util.c
@@ -563,7 +563,6 @@ storageBackendCreatePloop(virStoragePoolObjPtr pool G_GNUC_UNUSED,
unsigned int flags)
{
int ret = -1;
- bool created = false;
g_autoptr(virCommand) cmd = NULL;
g_autofree char *create_tool = NULL;
@@ -607,7 +606,7 @@ storageBackendCreatePloop(virStoragePoolObjPtr pool G_GNUC_UNUSED,
0)) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("error creating directory for ploop volume"));
- goto cleanup;
+ return -1;
}
cmd = virCommandNewArgList(create_tool, "init", "-s", NULL);
virCommandAddArgFormat(cmd, "%lluM", VIR_DIV_UP(vol->target.capacity,
@@ -620,10 +619,8 @@ storageBackendCreatePloop(virStoragePoolObjPtr pool G_GNUC_UNUSED,
cmd = virCommandNewArgList("cp", "-r", inputvol->target.path,
vol->target.path, NULL);
}
- created = true;
ret = virCommandRun(cmd, NULL);
- cleanup:
- if (ret < 0 && created)
+ if (ret < 0)
virFileDeleteTree(vol->target.path);
return ret;
}
--
2.25.3
3 years, 11 months
[libvirt PATCH 0/3] Small tweaks to cpu-gather.py script
by Jiri Denemark
Jiri Denemark (3):
cpu-gather: Remove redundant "processor" from CPU data file names
cpu_map: Suggest better command for updating test data files
cpu-gather: Rename the script as cpu-data.py
src/cpu_map/x86_features.xml | 5 ++---
tests/cputestdata/{cpu-gather.py => cpu-data.py} | 4 ++--
2 files changed, 4 insertions(+), 5 deletions(-)
rename tests/cputestdata/{cpu-gather.py => cpu-data.py} (99%)
--
2.30.0
3 years, 11 months
[PATCH v1] rpm: adjust xenlight requirements
by Olaf Hering
According to meson.build, and the actual code, Xen 4.6+ is required.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
---
libvirt.spec.in | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 0a8b0ebad4..bd6e7c2747 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -126,7 +126,7 @@
%endif
# RHEL doesn't ship OpenVZ, VBox, PowerHypervisor,
-# VMware, libxenlight (Xen 4.1 and newer),
+# VMware, libxenlight (Xen 4.6 and newer),
# or HyperV.
%if 0%{?rhel}
%define with_openvz 0
@@ -272,7 +272,7 @@ BuildRequires: perl
BuildRequires: python3
BuildRequires: systemd-units
%if %{with_libxl}
-BuildRequires: xen-devel
+BuildRequires: pkgconfig(xenlight) >= 4.6.0
%endif
BuildRequires: glib2-devel >= 2.48
BuildRequires: libxml2-devel
3 years, 11 months
[PATCH] network: Introduce mutex for bridge name generation
by Michal Privoznik
When defining/creating a network the bridge name may be filled in
automatically by libvirt (if none provided in the input XML or
the one provided is a pattern, e.g. "virbr%d"). During the
bridge name generation process a candidate name is generated
which is then checked with the rest of already defined/running
networks for collisions.
Problem is, that there is no mutex guarding this critical section
and thus if two threads line up so that they both generate the
same candidate they won't find any collision and the same name is
then stored.
Closes: https://gitlab.com/libvirt/libvirt/-/issues/78
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/network/bridge_driver.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index a7c5aade14..b7c604eaea 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -74,6 +74,8 @@
#define VIR_FROM_THIS VIR_FROM_NETWORK
#define MAX_BRIDGE_ID 256
+static virMutex bridgeNameValidateMutex = VIR_MUTEX_INITIALIZER;
+
/**
* VIR_NETWORK_DHCP_LEASE_FILE_SIZE_MAX:
*
@@ -3115,20 +3117,27 @@ static int
networkBridgeNameValidate(virNetworkObjListPtr nets,
virNetworkDefPtr def)
{
+ virMutexLock(&bridgeNameValidateMutex);
+
if (def->bridge && !strstr(def->bridge, "%d")) {
if (virNetworkObjBridgeInUse(nets, def->bridge, def->name)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("bridge name '%s' already in use."),
def->bridge);
- return -1;
+ goto error;
}
} else {
/* Allocate a bridge name */
if (networkFindUnusedBridgeName(nets, def) < 0)
- return -1;
+ goto error;
}
+ virMutexUnlock(&bridgeNameValidateMutex);
return 0;
+
+ error:
+ virMutexUnlock(&bridgeNameValidateMutex);
+ return -1;
}
--
2.26.2
3 years, 11 months
[libvirt PATCH 0/7] Define and enable Snowridge CPU model
by Tim Wiederhake
This series adds and enables the Snowridge CPU model.
Note that qemu currently uses the same model ID for Icelake-Server [1]
and Snowridge [2]. The correct ID for Icelake is 106 [3], a mistake
that has been fixed in libvirt already [4], but is still missing in
qemu [5].
[1] https://git.qemu.org/?p=3Dqemu.git;a=3Dblob;f=3Dtarget/i386/cpu.c;h=3D354=
59a38bb1ce7180c5c28e6e215489ef35d3bfe;hb=3DHEAD#l3409
[2] https://git.qemu.org/?p=3Dqemu.git;a=3Dblob;f=3Dtarget/i386/cpu.c;h=3D354=
59a38bb1ce7180c5c28e6e215489ef35d3bfe;hb=3DHEAD#l3661
[3] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/a=
rch/x86/include/asm/intel-family.h#n80
[4] https://gitlab.com/libvirt/libvirt/-/commit/1278ac6265589cd83cc2e661056c8=
60e98105507
[5] https://lists.nongnu.org/archive/html/qemu-devel/2020-12/msg00599.html
Tim Wiederhake (7):
cputestdata: Add test data for Snowridge
cpu_map: Add support for fsrm CPU feature
cpu_map: Add support for core-capability CPU feature
cputestdata: Snowridge: Update with core-capability CPU feature
cpu_map: Add support for split-lock-detect CPU feature
cputestdata: Snowridge: Update with split-lock-detect feature
cpu_map: Define and enable Snowridge model
src/cpu_map/index.xml | 1 +
src/cpu_map/meson.build | 1 +
src/cpu_map/x86_Snowridge.xml | 71 +
src/cpu_map/x86_features.xml | 11 +
...64-cpuid-Atom-P5362-processor-disabled.xml | 9 +
..._64-cpuid-Atom-P5362-processor-enabled.xml | 10 +
.../x86_64-cpuid-Atom-P5362-processor.json | 2415 +++++++++++++++++
.../x86_64-cpuid-Atom-P5362-processor.xml | 61 +
.../x86_64-cpuid-Ice-Lake-Server-guest.xml | 1 +
.../x86_64-cpuid-Ice-Lake-Server-host.xml | 1 +
.../domaincapsdata/qemu_4.1.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_4.1.0-tcg.x86_64.xml | 1 +
tests/domaincapsdata/qemu_4.1.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_4.2.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_4.2.0-tcg.x86_64.xml | 1 +
tests/domaincapsdata/qemu_4.2.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_5.0.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_5.0.0-tcg.x86_64.xml | 1 +
tests/domaincapsdata/qemu_5.0.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_5.1.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_5.1.0-tcg.x86_64.xml | 1 +
tests/domaincapsdata/qemu_5.1.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_5.2.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_5.2.0-tcg.x86_64.xml | 1 +
tests/domaincapsdata/qemu_5.2.0.x86_64.xml | 1 +
25 files changed, 2596 insertions(+)
create mode 100644 src/cpu_map/x86_Snowridge.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Atom-P5362-processor-disab=
led.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Atom-P5362-processor-enabl=
ed.xml
create mode 100644 tests/cputestdata/x86_64-cpuid-Atom-P5362-processor.json
create mode 100644 tests/cputestdata/x86_64-cpuid-Atom-P5362-processor.xml
--=20
2.26.2
3 years, 11 months