forked from rpms/libvirt
libvirt-9.1.0-1.el9
- Rebased to libvirt-9.1.0 (rhbz#2175785) - The rebase also fixes the following bugs: rhbz#2004850, rhbz#2137346, rhbz#2166235, rhbz#1961326 Resolves: rhbz#1961326, rhbz#2004850, rhbz#2137346, rhbz#2166235, rhbz#2175785
This commit is contained in:
parent
3262f40358
commit
4a735275bc
@ -1,63 +0,0 @@
|
||||
From 0c35c1c0495a953268719ad83cf2f368ab53018b Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <0c35c1c0495a953268719ad83cf2f368ab53018b@dist-git>
|
||||
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
|
||||
Date: Fri, 20 Jan 2023 12:56:48 +0100
|
||||
Subject: [PATCH] conf: clarify some external TPM error messages
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Two of the messages referred to 'backend type' when dealing
|
||||
with the source type and one mentioned the 'client' attribute
|
||||
from an earlier iteration of the patches, even though the attribute
|
||||
was later changed to 'connect'.
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=2063723
|
||||
|
||||
Signed-off-by: Ján Tomko <jtomko@redhat.com>
|
||||
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
|
||||
(cherry picked from commit 1c7476c8797b7f0d6e8d607f6a42c5bf43441677)
|
||||
Signed-off-by: Ján Tomko <jtomko@redhat.com>
|
||||
---
|
||||
src/conf/domain_conf.c | 4 ++--
|
||||
src/conf/domain_validate.c | 2 +-
|
||||
2 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
|
||||
index 45965fa0fa..733399e6da 100644
|
||||
--- a/src/conf/domain_conf.c
|
||||
+++ b/src/conf/domain_conf.c
|
||||
@@ -10545,7 +10545,7 @@ virDomainTPMDefParseXML(virDomainXMLOption *xmlopt,
|
||||
case VIR_DOMAIN_TPM_TYPE_EXTERNAL:
|
||||
if (!(type = virXPathString("string(./backend/source/@type)", ctxt))) {
|
||||
virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||
- _("missing external TPM backend type"));
|
||||
+ _("missing external TPM backend source type"));
|
||||
goto error;
|
||||
}
|
||||
|
||||
@@ -10555,7 +10555,7 @@ virDomainTPMDefParseXML(virDomainXMLOption *xmlopt,
|
||||
def->data.external.source->type = virDomainChrTypeFromString(type);
|
||||
if (def->data.external.source->type < 0) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
- _("unknown backend type '%s' for external TPM"),
|
||||
+ _("unknown backend source type '%s' for external TPM"),
|
||||
type);
|
||||
goto error;
|
||||
}
|
||||
diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c
|
||||
index 39d924d4ed..1c13929281 100644
|
||||
--- a/src/conf/domain_validate.c
|
||||
+++ b/src/conf/domain_validate.c
|
||||
@@ -2757,7 +2757,7 @@ virDomainTPMDevValidate(const virDomainTPMDef *tpm)
|
||||
}
|
||||
if (tpm->data.external.source->data.nix.listen) {
|
||||
virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||
- _("only 'client' mode is supported for external TPM device"));
|
||||
+ _("only 'connect' mode is supported for external TPM device"));
|
||||
return -1;
|
||||
}
|
||||
if (tpm->data.external.source->data.nix.path == NULL) {
|
||||
--
|
||||
2.39.1
|
||||
|
@ -1,53 +0,0 @@
|
||||
From 31f2edcd7f42cda4173eabad879bfc318c202c9e Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <31f2edcd7f42cda4173eabad879bfc318c202c9e@dist-git>
|
||||
From: Pavel Hrdina <phrdina@redhat.com>
|
||||
Date: Tue, 17 Jan 2023 10:33:22 +0100
|
||||
Subject: [PATCH] docs: document correct cpu shares limits with both cgroups v1
|
||||
and v2
|
||||
|
||||
The limits are different with cgroups v1 and v2 but our XML
|
||||
documentation and virsh manpage mentioned only cgroups v1 limits without
|
||||
explicitly saying it only applies to cgroups v1.
|
||||
|
||||
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
||||
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
|
||||
(cherry picked from commit ead6e1b00285cbd98e0f0727efb8adcb29ebc1ba)
|
||||
|
||||
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2037998
|
||||
|
||||
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
||||
---
|
||||
docs/formatdomain.rst | 2 +-
|
||||
docs/manpages/virsh.rst | 3 ++-
|
||||
2 files changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
|
||||
index 490a954745..8fc8aeb928 100644
|
||||
--- a/docs/formatdomain.rst
|
||||
+++ b/docs/formatdomain.rst
|
||||
@@ -849,7 +849,7 @@ CPU Tuning
|
||||
There is no unit for the value, it's a relative measure based on the setting
|
||||
of other VM, e.g. A VM configured with value 2048 will get twice as much CPU
|
||||
time as a VM configured with value 1024. The value should be in range
|
||||
- [2, 262144]. :since:`Since 0.9.0`
|
||||
+ [2, 262144] using cgroups v1, [1, 10000] using cgroups v2. :since:`Since 0.9.0`
|
||||
``period``
|
||||
The optional ``period`` element specifies the enforcement interval (unit:
|
||||
microseconds). Within ``period``, each vCPU of the domain will not be allowed
|
||||
diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst
|
||||
index 88b7fa1da8..d5b614dc03 100644
|
||||
--- a/docs/manpages/virsh.rst
|
||||
+++ b/docs/manpages/virsh.rst
|
||||
@@ -4054,7 +4054,8 @@ If *--config* is specified, affect the next start of a persistent guest.
|
||||
If *--current* is specified, it is equivalent to either *--live* or
|
||||
*--config*, depending on the current state of the guest.
|
||||
|
||||
-``Note``: The cpu_shares parameter has a valid value range of 2-262144.
|
||||
+``Note``: The cpu_shares parameter has a valid value range of 2-262144
|
||||
+with cgroups v1, 1-10000 with cgroups v2.
|
||||
|
||||
``Note``: The weight and cap parameters are defined only for the
|
||||
XEN_CREDIT scheduler.
|
||||
--
|
||||
2.39.1
|
||||
|
@ -1,50 +0,0 @@
|
||||
From fbf5f9bce43e19f8827e5cdef0e456b74ccc2f7d Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <fbf5f9bce43e19f8827e5cdef0e456b74ccc2f7d@dist-git>
|
||||
From: Pavel Hrdina <phrdina@redhat.com>
|
||||
Date: Tue, 17 Jan 2023 10:08:08 +0100
|
||||
Subject: [PATCH] domain_validate: drop cpu.shares cgroup check
|
||||
|
||||
This check is done when VM is defined but doesn't take into account what
|
||||
cgroups version is currently used on the host system so it doesn't work
|
||||
correctly.
|
||||
|
||||
To make proper check at this point we would have to figure out cgroups
|
||||
version while defining a VM but that will still not guarantee that the
|
||||
VM will start correctly in the future as the host may be rebooted with
|
||||
different cgroups version.
|
||||
|
||||
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
||||
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
|
||||
(cherry picked from commit 38af6497610075e5fe386734b87186731d4c17ac)
|
||||
|
||||
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2037998
|
||||
|
||||
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
||||
---
|
||||
src/conf/domain_validate.c | 10 ----------
|
||||
1 file changed, 10 deletions(-)
|
||||
|
||||
diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c
|
||||
index 5a9bf20d3f..39d924d4ed 100644
|
||||
--- a/src/conf/domain_validate.c
|
||||
+++ b/src/conf/domain_validate.c
|
||||
@@ -1725,16 +1725,6 @@ virDomainDefOSValidate(const virDomainDef *def,
|
||||
static int
|
||||
virDomainDefCputuneValidate(const virDomainDef *def)
|
||||
{
|
||||
- if (def->cputune.shares > 0 &&
|
||||
- (def->cputune.shares < VIR_CGROUP_CPU_SHARES_MIN ||
|
||||
- def->cputune.shares > VIR_CGROUP_CPU_SHARES_MAX)) {
|
||||
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
- _("Value of cputune 'shares' must be in range [%llu, %llu]"),
|
||||
- VIR_CGROUP_CPU_SHARES_MIN,
|
||||
- VIR_CGROUP_CPU_SHARES_MAX);
|
||||
- return -1;
|
||||
- }
|
||||
-
|
||||
CPUTUNE_VALIDATE_PERIOD(period);
|
||||
CPUTUNE_VALIDATE_PERIOD(global_period);
|
||||
CPUTUNE_VALIDATE_PERIOD(emulator_period);
|
||||
--
|
||||
2.39.1
|
||||
|
@ -1,105 +0,0 @@
|
||||
From ec03aa23ac417797f9b53d51b6f999f5e966f9d7 Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <ec03aa23ac417797f9b53d51b6f999f5e966f9d7@dist-git>
|
||||
From: Michal Privoznik <mprivozn@redhat.com>
|
||||
Date: Mon, 16 Jan 2023 12:46:09 +0100
|
||||
Subject: [PATCH] qemu: Provide virDomainGetCPUStats() implementation for
|
||||
session connection
|
||||
|
||||
We have virDomainGetCPUStats() API which offers querying
|
||||
statistics on host CPU usage by given guest. And it works in two
|
||||
modes: getting overall stats (@start_cpu == -1, @ncpus == 1) or
|
||||
getting per host CPU usage.
|
||||
|
||||
For the QEMU driver it is implemented by looking into values
|
||||
stored in corresponding cpuacct CGroup controller. Well, this
|
||||
works for system instances, where libvirt has permissions to
|
||||
create CGroups and place QEMU process into them. But it does not
|
||||
fly for session connection, where no CGroups are set up.
|
||||
|
||||
Fortunately, we can do something similar to v8.8.0-rc1~95 and use
|
||||
virProcessGetStatInfo() to fill the overall stats. Unfortunately,
|
||||
I haven't found any source of per host CPU usage, so we just
|
||||
continue throwing an error in that case.
|
||||
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
|
||||
(cherry picked from commit 8865c42771600a40eddf40663f73b458423059a4)
|
||||
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2148266
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
---
|
||||
src/qemu/qemu_driver.c | 52 ++++++++++++++++++++++++++++++++++++++++--
|
||||
1 file changed, 50 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
|
||||
index c576c601ad..0603af6a35 100644
|
||||
--- a/src/qemu/qemu_driver.c
|
||||
+++ b/src/qemu/qemu_driver.c
|
||||
@@ -16009,6 +16009,50 @@ qemuDomainGetMetadata(virDomainPtr dom,
|
||||
return ret;
|
||||
}
|
||||
|
||||
+#define QEMU_CPU_STATS_PROC_TOTAL 3
|
||||
+
|
||||
+static int
|
||||
+qemuDomainGetCPUStatsProc(virDomainObj *vm,
|
||||
+ virTypedParameterPtr params,
|
||||
+ unsigned int nparams)
|
||||
+{
|
||||
+ unsigned long long cpuTime = 0;
|
||||
+ unsigned long long userTime = 0;
|
||||
+ unsigned long long sysTime = 0;
|
||||
+
|
||||
+ if (nparams == 0) {
|
||||
+ /* return supported number of params */
|
||||
+ return QEMU_CPU_STATS_PROC_TOTAL;
|
||||
+ }
|
||||
+
|
||||
+ if (virProcessGetStatInfo(&cpuTime, &userTime, &sysTime,
|
||||
+ NULL, NULL, vm->pid, 0) < 0) {
|
||||
+ virReportError(VIR_ERR_OPERATION_FAILED, "%s",
|
||||
+ _("cannot read cputime for domain"));
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ if (virTypedParameterAssign(¶ms[0], VIR_DOMAIN_CPU_STATS_CPUTIME,
|
||||
+ VIR_TYPED_PARAM_ULLONG, cpuTime) < 0)
|
||||
+ return -1;
|
||||
+
|
||||
+ if (nparams > 1 &&
|
||||
+ virTypedParameterAssign(¶ms[1], VIR_DOMAIN_CPU_STATS_USERTIME,
|
||||
+ VIR_TYPED_PARAM_ULLONG, userTime) < 0)
|
||||
+ return -1;
|
||||
+
|
||||
+ if (nparams > 2 &&
|
||||
+ virTypedParameterAssign(¶ms[2], VIR_DOMAIN_CPU_STATS_SYSTEMTIME,
|
||||
+ VIR_TYPED_PARAM_ULLONG, sysTime) < 0)
|
||||
+ return -1;
|
||||
+
|
||||
+ if (nparams > 3)
|
||||
+ nparams = 3;
|
||||
+
|
||||
+ return nparams;
|
||||
+}
|
||||
+
|
||||
+#undef QEMU_CPU_STATS_PROC_TOTAL
|
||||
|
||||
static int
|
||||
qemuDomainGetCPUStats(virDomainPtr domain,
|
||||
@@ -16037,8 +16081,12 @@ qemuDomainGetCPUStats(virDomainPtr domain,
|
||||
goto cleanup;
|
||||
|
||||
if (!virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPUACCT)) {
|
||||
- virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
- "%s", _("cgroup CPUACCT controller is not mounted"));
|
||||
+ if (start_cpu == -1) {
|
||||
+ ret = qemuDomainGetCPUStatsProc(vm, params, nparams);
|
||||
+ } else {
|
||||
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
|
||||
+ _("cgroup CPUACCT controller is not mounted"));
|
||||
+ }
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
--
|
||||
2.39.1
|
||||
|
@ -1,77 +0,0 @@
|
||||
From e0e6c7375855e09c45591d0b5ab23cddaa230ad8 Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <e0e6c7375855e09c45591d0b5ab23cddaa230ad8@dist-git>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Thu, 19 Jan 2023 15:18:45 +0100
|
||||
Subject: [PATCH] qemu: Remove 'memAliasOrderMismatch' field from VM private
|
||||
data
|
||||
|
||||
The field is no longer used so we can remove it and the code filling it.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
|
||||
(cherry picked from commit 5764930463eb8f450e45fa982651ef6b7a7afd7c)
|
||||
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2158701
|
||||
---
|
||||
src/qemu/qemu_domain.h | 3 ---
|
||||
src/qemu/qemu_process.c | 24 ------------------------
|
||||
2 files changed, 27 deletions(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
|
||||
index 08430b67b9..eca5404cdc 100644
|
||||
--- a/src/qemu/qemu_domain.h
|
||||
+++ b/src/qemu/qemu_domain.h
|
||||
@@ -177,9 +177,6 @@ struct _qemuDomainObjPrivate {
|
||||
uint8_t *masterKey;
|
||||
size_t masterKeyLen;
|
||||
|
||||
- /* note whether memory device alias does not correspond to slot number */
|
||||
- bool memAliasOrderMismatch;
|
||||
-
|
||||
/* for migrations using TLS with a secret (not to be saved in our */
|
||||
/* private XML). */
|
||||
qemuDomainSecretInfo *migSecinfo;
|
||||
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
|
||||
index ee9f0784d3..29716ecb19 100644
|
||||
--- a/src/qemu/qemu_process.c
|
||||
+++ b/src/qemu/qemu_process.c
|
||||
@@ -3896,28 +3896,6 @@ qemuDomainPerfRestart(virDomainObj *vm)
|
||||
}
|
||||
|
||||
|
||||
-static void
|
||||
-qemuProcessReconnectCheckMemAliasOrderMismatch(virDomainObj *vm)
|
||||
-{
|
||||
- size_t i;
|
||||
- int aliasidx;
|
||||
- virDomainDef *def = vm->def;
|
||||
- qemuDomainObjPrivate *priv = vm->privateData;
|
||||
-
|
||||
- if (!virDomainDefHasMemoryHotplug(def) || def->nmems == 0)
|
||||
- return;
|
||||
-
|
||||
- for (i = 0; i < def->nmems; i++) {
|
||||
- aliasidx = qemuDomainDeviceAliasIndex(&def->mems[i]->info, "dimm");
|
||||
-
|
||||
- if (def->mems[i]->info.addr.dimm.slot != aliasidx) {
|
||||
- priv->memAliasOrderMismatch = true;
|
||||
- break;
|
||||
- }
|
||||
- }
|
||||
-}
|
||||
-
|
||||
-
|
||||
static bool
|
||||
qemuProcessDomainMemoryDefNeedHugepagesPath(const virDomainMemoryDef *mem,
|
||||
const long system_pagesize)
|
||||
@@ -9091,8 +9069,6 @@ qemuProcessReconnect(void *opaque)
|
||||
if (qemuProcessRefreshFdsetIndex(obj) < 0)
|
||||
goto error;
|
||||
|
||||
- qemuProcessReconnectCheckMemAliasOrderMismatch(obj);
|
||||
-
|
||||
if (qemuConnectAgent(driver, obj) < 0)
|
||||
goto error;
|
||||
|
||||
--
|
||||
2.39.1
|
||||
|
@ -1,108 +0,0 @@
|
||||
From 9271efe525e9cfaf1aad931ffccf61d6d17e5273 Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <9271efe525e9cfaf1aad931ffccf61d6d17e5273@dist-git>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Thu, 19 Jan 2023 15:16:58 +0100
|
||||
Subject: [PATCH] qemu: alias: Remove 'oldAlias' argument of
|
||||
qemuAssignDeviceMemoryAlias
|
||||
|
||||
All callers pass 'false' so we no longer need it.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
|
||||
(cherry picked from commit 6d3f0b11b2b056313b123510c96f2924689341f9)
|
||||
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2158701
|
||||
---
|
||||
src/qemu/qemu_alias.c | 13 ++++---------
|
||||
src/qemu/qemu_alias.h | 3 +--
|
||||
src/qemu/qemu_hotplug.c | 2 +-
|
||||
3 files changed, 6 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_alias.c b/src/qemu/qemu_alias.c
|
||||
index ef8e87ab58..0f1310a0e5 100644
|
||||
--- a/src/qemu/qemu_alias.c
|
||||
+++ b/src/qemu/qemu_alias.c
|
||||
@@ -454,7 +454,6 @@ qemuAssignDeviceRNGAlias(virDomainDef *def,
|
||||
static int
|
||||
qemuDeviceMemoryGetAliasID(virDomainDef *def,
|
||||
virDomainMemoryDef *mem,
|
||||
- bool oldAlias,
|
||||
const char *prefix)
|
||||
{
|
||||
size_t i;
|
||||
@@ -462,8 +461,7 @@ qemuDeviceMemoryGetAliasID(virDomainDef *def,
|
||||
|
||||
/* virtio-pmem and virtio-mem go onto PCI bus and thus DIMM address is not
|
||||
* valid */
|
||||
- if (!oldAlias &&
|
||||
- mem->model != VIR_DOMAIN_MEMORY_MODEL_VIRTIO_PMEM &&
|
||||
+ if (mem->model != VIR_DOMAIN_MEMORY_MODEL_VIRTIO_PMEM &&
|
||||
mem->model != VIR_DOMAIN_MEMORY_MODEL_VIRTIO_MEM &&
|
||||
mem->model != VIR_DOMAIN_MEMORY_MODEL_SGX_EPC)
|
||||
return mem->info.addr.dimm.slot;
|
||||
@@ -482,8 +480,6 @@ qemuDeviceMemoryGetAliasID(virDomainDef *def,
|
||||
* qemuAssignDeviceMemoryAlias:
|
||||
* @def: domain definition. Necessary only if @oldAlias is true.
|
||||
* @mem: memory device definition
|
||||
- * @oldAlias: Generate the alias according to the order of the device in @def
|
||||
- * rather than according to the slot number for legacy reasons.
|
||||
*
|
||||
* Generates alias for a memory device according to slot number if @oldAlias is
|
||||
* false or according to order in @def->mems otherwise.
|
||||
@@ -492,8 +488,7 @@ qemuDeviceMemoryGetAliasID(virDomainDef *def,
|
||||
*/
|
||||
int
|
||||
qemuAssignDeviceMemoryAlias(virDomainDef *def,
|
||||
- virDomainMemoryDef *mem,
|
||||
- bool oldAlias)
|
||||
+ virDomainMemoryDef *mem)
|
||||
{
|
||||
const char *prefix = NULL;
|
||||
int idx = 0;
|
||||
@@ -525,7 +520,7 @@ qemuAssignDeviceMemoryAlias(virDomainDef *def,
|
||||
break;
|
||||
}
|
||||
|
||||
- idx = qemuDeviceMemoryGetAliasID(def, mem, oldAlias, prefix);
|
||||
+ idx = qemuDeviceMemoryGetAliasID(def, mem, prefix);
|
||||
mem->info.alias = g_strdup_printf("%s%d", prefix, idx);
|
||||
|
||||
return 0;
|
||||
@@ -685,7 +680,7 @@ qemuAssignDeviceAliases(virDomainDef *def)
|
||||
qemuAssignDeviceTPMAlias(def->tpms[i], i);
|
||||
}
|
||||
for (i = 0; i < def->nmems; i++) {
|
||||
- if (qemuAssignDeviceMemoryAlias(def, def->mems[i], false) < 0)
|
||||
+ if (qemuAssignDeviceMemoryAlias(def, def->mems[i]) < 0)
|
||||
return -1;
|
||||
}
|
||||
if (def->vsock) {
|
||||
diff --git a/src/qemu/qemu_alias.h b/src/qemu/qemu_alias.h
|
||||
index 6433ae4cec..af9c3f62d3 100644
|
||||
--- a/src/qemu/qemu_alias.h
|
||||
+++ b/src/qemu/qemu_alias.h
|
||||
@@ -55,8 +55,7 @@ void qemuAssignDeviceRNGAlias(virDomainDef *def,
|
||||
virDomainRNGDef *rng);
|
||||
|
||||
int qemuAssignDeviceMemoryAlias(virDomainDef *def,
|
||||
- virDomainMemoryDef *mems,
|
||||
- bool oldAlias);
|
||||
+ virDomainMemoryDef *mems);
|
||||
|
||||
void qemuAssignDeviceShmemAlias(virDomainDef *def,
|
||||
virDomainShmemDef *shmem,
|
||||
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
|
||||
index 5840504d13..2df59873db 100644
|
||||
--- a/src/qemu/qemu_hotplug.c
|
||||
+++ b/src/qemu/qemu_hotplug.c
|
||||
@@ -2275,7 +2275,7 @@ qemuDomainAttachMemory(virQEMUDriver *driver,
|
||||
goto cleanup;
|
||||
releaseaddr = true;
|
||||
|
||||
- if (qemuAssignDeviceMemoryAlias(vm->def, mem, false) < 0)
|
||||
+ if (qemuAssignDeviceMemoryAlias(vm->def, mem) < 0)
|
||||
goto cleanup;
|
||||
|
||||
objalias = g_strdup_printf("mem%s", mem->info.alias);
|
||||
--
|
||||
2.39.1
|
||||
|
@ -1,53 +0,0 @@
|
||||
From bf15c630b7c54637220af65ac84cfd007c1c798a Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <bf15c630b7c54637220af65ac84cfd007c1c798a@dist-git>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Tue, 31 Jan 2023 15:35:05 +0100
|
||||
Subject: [PATCH] qemu: block: Properly handle FD-passed disk hot-(un-)plug
|
||||
|
||||
The hotplug code paths need to be able to pass the FDs to the monitor to
|
||||
ensure that hotplug works.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
|
||||
(cherry picked from commit 3b8d669d557bd2ce8874f61e83b6d6074d365ec2)
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=2040272
|
||||
---
|
||||
src/qemu/qemu_block.c | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
|
||||
index e865aa17f9..c218262691 100644
|
||||
--- a/src/qemu/qemu_block.c
|
||||
+++ b/src/qemu/qemu_block.c
|
||||
@@ -1410,6 +1410,9 @@ qemuBlockStorageSourceAttachApplyStorageDeps(qemuMonitor *mon,
|
||||
qemuMonitorAddObject(mon, &data->tlsProps, &data->tlsAlias) < 0)
|
||||
return -1;
|
||||
|
||||
+ if (qemuFDPassTransferMonitor(data->fdpass, mon) < 0)
|
||||
+ return -1;
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1559,6 +1562,8 @@ qemuBlockStorageSourceAttachRollback(qemuMonitor *mon,
|
||||
if (data->tlsKeySecretAlias)
|
||||
ignore_value(qemuMonitorDelObject(mon, data->tlsKeySecretAlias, false));
|
||||
|
||||
+ qemuFDPassTransferMonitorRollback(data->fdpass, mon);
|
||||
+
|
||||
virErrorRestore(&orig_err);
|
||||
}
|
||||
|
||||
@@ -1609,6 +1614,8 @@ qemuBlockStorageSourceDetachPrepare(virStorageSource *src)
|
||||
|
||||
if (srcpriv->tlsKeySecret)
|
||||
data->tlsKeySecretAlias = g_strdup(srcpriv->tlsKeySecret->alias);
|
||||
+
|
||||
+ data->fdpass = srcpriv->fdpass;
|
||||
}
|
||||
|
||||
return g_steal_pointer(&data);
|
||||
--
|
||||
2.39.1
|
||||
|
@ -1,117 +0,0 @@
|
||||
From 11dd7c99fa96364962f81d4efae0ed220c7a7190 Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <11dd7c99fa96364962f81d4efae0ed220c7a7190@dist-git>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Fri, 10 Feb 2023 17:16:43 +0100
|
||||
Subject: [PATCH] qemu: blockjob: Handle 'pending' blockjob state only when we
|
||||
need it
|
||||
|
||||
The 'pending' state needs to be handled by the blockjob code only when
|
||||
the snapshot code requests a block-commit without auto-finalization.
|
||||
|
||||
If we always handle it we fail to properly remove the blockjob data for
|
||||
the 'blockdev-create' job as that also transitions trhough 'pending' but
|
||||
we'd never update it once it reaches 'concluded' as the code already
|
||||
thinks that the job has finished and is no longer watching it.
|
||||
|
||||
Introduce a 'processPending' property into block job data and set it
|
||||
only when we know that we need to process 'pending'.
|
||||
|
||||
Fixes: 90d9bc9d74a5157167548b26c00b1a016655e295
|
||||
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2168769
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
|
||||
(cherry picked from commit c433c2434c0459df98ed3355ef615e341acd9009)
|
||||
---
|
||||
src/qemu/qemu_block.c | 1 +
|
||||
src/qemu/qemu_blockjob.c | 19 ++++++++++---------
|
||||
src/qemu/qemu_blockjob.h | 4 ++++
|
||||
3 files changed, 15 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
|
||||
index c218262691..d8ca50d618 100644
|
||||
--- a/src/qemu/qemu_block.c
|
||||
+++ b/src/qemu/qemu_block.c
|
||||
@@ -3374,6 +3374,7 @@ qemuBlockCommit(virDomainObj *vm,
|
||||
if (!(job = qemuBlockJobDiskNewCommit(vm, disk, top_parent, topSource,
|
||||
baseSource,
|
||||
flags & VIR_DOMAIN_BLOCK_COMMIT_DELETE,
|
||||
+ autofinalize,
|
||||
flags)))
|
||||
goto cleanup;
|
||||
|
||||
diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c
|
||||
index cb2d05d71d..a20cf1db62 100644
|
||||
--- a/src/qemu/qemu_blockjob.c
|
||||
+++ b/src/qemu/qemu_blockjob.c
|
||||
@@ -274,6 +274,7 @@ qemuBlockJobDiskNewCommit(virDomainObj *vm,
|
||||
virStorageSource *top,
|
||||
virStorageSource *base,
|
||||
bool delete_imgs,
|
||||
+ virTristateBool autofinalize,
|
||||
unsigned int jobflags)
|
||||
{
|
||||
g_autoptr(qemuBlockJobData) job = NULL;
|
||||
@@ -290,6 +291,7 @@ qemuBlockJobDiskNewCommit(virDomainObj *vm,
|
||||
job->data.commit.top = top;
|
||||
job->data.commit.base = base;
|
||||
job->data.commit.deleteCommittedImages = delete_imgs;
|
||||
+ job->processPending = autofinalize == VIR_TRISTATE_BOOL_NO;
|
||||
job->jobflags = jobflags;
|
||||
|
||||
if (qemuBlockJobRegister(job, vm, disk, true) < 0)
|
||||
@@ -532,8 +534,6 @@ qemuBlockJobRefreshJobs(virDomainObj *vm)
|
||||
if (job->state == QEMU_BLOCKJOB_STATE_NEW ||
|
||||
job->state == QEMU_BLOCKJOB_STATE_RUNNING)
|
||||
job->newstate = newstate;
|
||||
- } else if (newstate == QEMU_BLOCKJOB_STATE_PENDING) {
|
||||
- job->newstate = newstate;
|
||||
}
|
||||
/* don't update the job otherwise */
|
||||
}
|
||||
@@ -1568,13 +1568,14 @@ qemuBlockJobEventProcess(virQEMUDriver *driver,
|
||||
|
||||
case QEMU_BLOCKJOB_STATE_PENDING:
|
||||
/* Similarly as for 'ready' state we should handle it only when
|
||||
- * previous state was 'new' or 'running' as there are other cases
|
||||
- * when it can be emitted by QEMU. Currently we need this only when
|
||||
- * deleting non-active external snapshots. */
|
||||
- if (job->state == QEMU_BLOCKJOB_STATE_NEW ||
|
||||
- job->state == QEMU_BLOCKJOB_STATE_RUNNING) {
|
||||
- job->state = job->newstate;
|
||||
- qemuDomainSaveStatus(vm);
|
||||
+ * previous state was 'new' or 'running' and only if the blockjob code
|
||||
+ * is handling finalization of the job explicitly. */
|
||||
+ if (job->processPending) {
|
||||
+ if (job->state == QEMU_BLOCKJOB_STATE_NEW ||
|
||||
+ job->state == QEMU_BLOCKJOB_STATE_RUNNING) {
|
||||
+ job->state = job->newstate;
|
||||
+ qemuDomainSaveStatus(vm);
|
||||
+ }
|
||||
}
|
||||
job->newstate = -1;
|
||||
break;
|
||||
diff --git a/src/qemu/qemu_blockjob.h b/src/qemu/qemu_blockjob.h
|
||||
index e9b283da20..f1ac43b4c7 100644
|
||||
--- a/src/qemu/qemu_blockjob.h
|
||||
+++ b/src/qemu/qemu_blockjob.h
|
||||
@@ -138,6 +138,9 @@ struct _qemuBlockJobData {
|
||||
|
||||
int brokentype; /* the previous type of a broken blockjob qemuBlockJobType */
|
||||
|
||||
+ bool processPending; /* process the 'pending' state of the job, if the job
|
||||
+ should not be auto-finalized */
|
||||
+
|
||||
bool invalidData; /* the job data (except name) is not valid */
|
||||
bool reconnected; /* internal field for tracking whether job is live after reconnect to qemu */
|
||||
};
|
||||
@@ -175,6 +178,7 @@ qemuBlockJobDiskNewCommit(virDomainObj *vm,
|
||||
virStorageSource *top,
|
||||
virStorageSource *base,
|
||||
bool delete_imgs,
|
||||
+ virTristateBool autofinalize,
|
||||
unsigned int jobflags);
|
||||
|
||||
qemuBlockJobData *
|
||||
--
|
||||
2.39.1
|
||||
|
@ -1,117 +0,0 @@
|
||||
From 659a0e3cda2f5561abe45ccc10afc41014d1a331 Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <659a0e3cda2f5561abe45ccc10afc41014d1a331@dist-git>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Tue, 31 Jan 2023 14:37:40 +0100
|
||||
Subject: [PATCH] qemu: command: Handle FD passing commandline via
|
||||
qemuBuildBlockStorageSourceAttachDataCommandline
|
||||
|
||||
Copy the pointer to qemuFDPass into struct qemuBlockStorageSourceAttachData
|
||||
so that it can be used from qemuBuildBlockStorageSourceAttachDataCommandline
|
||||
rather than looping again in qemuBuildDiskSourceCommandLineFDs.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
|
||||
(cherry picked from commit 65f14232fb031b57fad085a2e8792da87c97173f)
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=2040272
|
||||
---
|
||||
src/qemu/qemu_block.h | 2 ++
|
||||
src/qemu/qemu_command.c | 26 +++----------------
|
||||
.../disk-source-fd.x86_64-latest.args | 6 ++---
|
||||
3 files changed, 9 insertions(+), 25 deletions(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_block.h b/src/qemu/qemu_block.h
|
||||
index eac986e0f0..5a61a19da2 100644
|
||||
--- a/src/qemu/qemu_block.h
|
||||
+++ b/src/qemu/qemu_block.h
|
||||
@@ -99,6 +99,8 @@ struct qemuBlockStorageSourceAttachData {
|
||||
char *tlsAlias;
|
||||
virJSONValue *tlsKeySecretProps;
|
||||
char *tlsKeySecretAlias;
|
||||
+
|
||||
+ qemuFDPass *fdpass;
|
||||
};
|
||||
|
||||
|
||||
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
|
||||
index b96f2d33c1..5edad046d5 100644
|
||||
--- a/src/qemu/qemu_command.c
|
||||
+++ b/src/qemu/qemu_command.c
|
||||
@@ -2119,6 +2119,8 @@ qemuBuildBlockStorageSourceAttachDataCommandline(virCommand *cmd,
|
||||
return -1;
|
||||
}
|
||||
|
||||
+ qemuFDPassTransferCommand(data->fdpass, cmd);
|
||||
+
|
||||
if (data->storageProps) {
|
||||
if (!(tmp = virJSONValueToString(data->storageProps, false)))
|
||||
return -1;
|
||||
@@ -2147,25 +2149,6 @@ qemuBuildBlockStorageSourceAttachDataCommandline(virCommand *cmd,
|
||||
}
|
||||
|
||||
|
||||
-static int
|
||||
-qemuBuildDiskSourceCommandLineFDs(virCommand *cmd,
|
||||
- virDomainDiskDef *disk)
|
||||
-{
|
||||
- virStorageSource *n;
|
||||
-
|
||||
- for (n = disk->src; virStorageSourceIsBacking(n); n = n->backingStore) {
|
||||
- qemuDomainStorageSourcePrivate *srcpriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(n);
|
||||
-
|
||||
- if (!srcpriv || !srcpriv->fdpass)
|
||||
- continue;
|
||||
-
|
||||
- qemuFDPassTransferCommand(srcpriv->fdpass, cmd);
|
||||
- }
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
-
|
||||
static int
|
||||
qemuBuildDiskSourceCommandLine(virCommand *cmd,
|
||||
virDomainDiskDef *disk,
|
||||
@@ -2183,9 +2166,6 @@ qemuBuildDiskSourceCommandLine(virCommand *cmd,
|
||||
if (virStorageSourceIsEmpty(disk->src))
|
||||
return 0;
|
||||
|
||||
- if (qemuBuildDiskSourceCommandLineFDs(cmd, disk) < 0)
|
||||
- return -1;
|
||||
-
|
||||
if (!(data = qemuBuildStorageSourceChainAttachPrepareBlockdev(disk->src)))
|
||||
return -1;
|
||||
|
||||
@@ -10537,6 +10517,8 @@ qemuBuildStorageSourceAttachPrepareCommon(virStorageSource *src,
|
||||
|
||||
tlsKeySecretAlias = srcpriv->tlsKeySecret->alias;
|
||||
}
|
||||
+
|
||||
+ data->fdpass = srcpriv->fdpass;
|
||||
}
|
||||
|
||||
if (src->haveTLS == VIR_TRISTATE_BOOL_YES &&
|
||||
diff --git a/tests/qemuxml2argvdata/disk-source-fd.x86_64-latest.args b/tests/qemuxml2argvdata/disk-source-fd.x86_64-latest.args
|
||||
index b4a81acfc7..a7ddd65000 100644
|
||||
--- a/tests/qemuxml2argvdata/disk-source-fd.x86_64-latest.args
|
||||
+++ b/tests/qemuxml2argvdata/disk-source-fd.x86_64-latest.args
|
||||
@@ -33,13 +33,13 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
|
||||
-blockdev '{"driver":"file","filename":"/dev/fdset/2","node-name":"libvirt-4-storage","auto-read-only":true,"discard":"unmap"}' \
|
||||
-blockdev '{"node-name":"libvirt-4-format","read-only":false,"driver":"qcow2","file":"libvirt-4-storage"}' \
|
||||
-device '{"driver":"virtio-blk-pci","bus":"pci.0","addr":"0x2","drive":"libvirt-4-format","id":"virtio-disk4","bootindex":1}' \
|
||||
--add-fd set=0,fd=704,opaque=libvirt-1-storage0 \
|
||||
--add-fd set=1,fd=777,opaque=libvirt-2-storage0 \
|
||||
--add-fd set=1,fd=778,opaque=libvirt-2-storage1 \
|
||||
-blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/rhel7.1484071876","node-name":"libvirt-3-storage","auto-read-only":true,"discard":"unmap"}' \
|
||||
-blockdev '{"node-name":"libvirt-3-format","read-only":true,"driver":"qcow2","file":"libvirt-3-storage","backing":null}' \
|
||||
+-add-fd set=1,fd=777,opaque=libvirt-2-storage0 \
|
||||
+-add-fd set=1,fd=778,opaque=libvirt-2-storage1 \
|
||||
-blockdev '{"driver":"file","filename":"/dev/fdset/1","node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap"}' \
|
||||
-blockdev '{"node-name":"libvirt-2-format","read-only":true,"driver":"qcow2","file":"libvirt-2-storage","backing":"libvirt-3-format"}' \
|
||||
+-add-fd set=0,fd=704,opaque=libvirt-1-storage0 \
|
||||
-blockdev '{"driver":"file","filename":"/dev/fdset/0","node-name":"libvirt-1-storage","read-only":false,"discard":"unmap"}' \
|
||||
-blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"qcow2","file":"libvirt-1-storage","backing":"libvirt-2-format"}' \
|
||||
-device '{"driver":"virtio-blk-pci","bus":"pci.0","addr":"0x3","drive":"libvirt-1-format","id":"virtio-disk5"}' \
|
||||
--
|
||||
2.39.1
|
||||
|
@ -1,103 +0,0 @@
|
||||
From 0fe11b92a8278ffab202033a61340649b0296368 Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <0fe11b92a8278ffab202033a61340649b0296368@dist-git>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Tue, 31 Jan 2023 15:30:51 +0100
|
||||
Subject: [PATCH] qemu: domain: Store fdset ID for disks passed to qemu via FD
|
||||
|
||||
To ensure that we can hot-unplug the disk including the associated fdset
|
||||
we need to store the fdset ID in the status XML.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
|
||||
(cherry picked from commit f730b1e4f203cbabe363aab246d8a1679063f756)
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=2040272
|
||||
---
|
||||
src/qemu/qemu_domain.c | 17 ++++++++++++++++-
|
||||
tests/qemustatusxml2xmldata/modern-in.xml | 3 +++
|
||||
2 files changed, 19 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
|
||||
index 226d4d6dc1..247134672b 100644
|
||||
--- a/src/qemu/qemu_domain.c
|
||||
+++ b/src/qemu/qemu_domain.c
|
||||
@@ -1941,6 +1941,8 @@ qemuStorageSourcePrivateDataParse(xmlXPathContextPtr ctxt,
|
||||
g_autofree char *httpcookiealias = NULL;
|
||||
g_autofree char *tlskeyalias = NULL;
|
||||
g_autofree char *thresholdEventWithIndex = NULL;
|
||||
+ bool fdsetPresent = false;
|
||||
+ unsigned int fdSetID;
|
||||
|
||||
src->nodestorage = virXPathString("string(./nodenames/nodename[@type='storage']/@name)", ctxt);
|
||||
src->nodeformat = virXPathString("string(./nodenames/nodename[@type='format']/@name)", ctxt);
|
||||
@@ -1957,7 +1959,9 @@ qemuStorageSourcePrivateDataParse(xmlXPathContextPtr ctxt,
|
||||
httpcookiealias = virXPathString("string(./objects/secret[@type='httpcookie']/@alias)", ctxt);
|
||||
tlskeyalias = virXPathString("string(./objects/secret[@type='tlskey']/@alias)", ctxt);
|
||||
|
||||
- if (authalias || encalias || httpcookiealias || tlskeyalias) {
|
||||
+ fdsetPresent = virXPathUInt("string(./fdsets/fdset[@type='storage']/@id)", ctxt, &fdSetID) == 0;
|
||||
+
|
||||
+ if (authalias || encalias || httpcookiealias || tlskeyalias || fdsetPresent) {
|
||||
if (!src->privateData &&
|
||||
!(src->privateData = qemuDomainStorageSourcePrivateNew()))
|
||||
return -1;
|
||||
@@ -1975,6 +1979,9 @@ qemuStorageSourcePrivateDataParse(xmlXPathContextPtr ctxt,
|
||||
|
||||
if (qemuStorageSourcePrivateDataAssignSecinfo(&priv->tlsKeySecret, &tlskeyalias) < 0)
|
||||
return -1;
|
||||
+
|
||||
+ if (fdsetPresent)
|
||||
+ priv->fdpass = qemuFDPassNewPassed(fdSetID);
|
||||
}
|
||||
|
||||
if (virStorageSourcePrivateDataParseRelPath(ctxt, src) < 0)
|
||||
@@ -2008,6 +2015,7 @@ qemuStorageSourcePrivateDataFormat(virStorageSource *src,
|
||||
qemuDomainStorageSourcePrivate *srcPriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(src);
|
||||
g_auto(virBuffer) nodenamesChildBuf = VIR_BUFFER_INIT_CHILD(buf);
|
||||
g_auto(virBuffer) objectsChildBuf = VIR_BUFFER_INIT_CHILD(buf);
|
||||
+ g_auto(virBuffer) fdsetsChildBuf = VIR_BUFFER_INIT_CHILD(buf);
|
||||
|
||||
virBufferEscapeString(&nodenamesChildBuf, "<nodename type='storage' name='%s'/>\n", src->nodestorage);
|
||||
virBufferEscapeString(&nodenamesChildBuf, "<nodename type='format' name='%s'/>\n", src->nodeformat);
|
||||
@@ -2025,10 +2033,15 @@ qemuStorageSourcePrivateDataFormat(virStorageSource *src,
|
||||
return -1;
|
||||
|
||||
if (srcPriv) {
|
||||
+ unsigned int fdSetID;
|
||||
+
|
||||
qemuStorageSourcePrivateDataFormatSecinfo(&objectsChildBuf, srcPriv->secinfo, "auth");
|
||||
qemuStorageSourcePrivateDataFormatSecinfo(&objectsChildBuf, srcPriv->encinfo, "encryption");
|
||||
qemuStorageSourcePrivateDataFormatSecinfo(&objectsChildBuf, srcPriv->httpcookie, "httpcookie");
|
||||
qemuStorageSourcePrivateDataFormatSecinfo(&objectsChildBuf, srcPriv->tlsKeySecret, "tlskey");
|
||||
+
|
||||
+ if (qemuFDPassIsPassed(srcPriv->fdpass, &fdSetID))
|
||||
+ virBufferAsprintf(&fdsetsChildBuf, "<fdset type='storage' id='%u'/>\n", fdSetID);
|
||||
}
|
||||
|
||||
if (src->tlsAlias)
|
||||
@@ -2036,6 +2049,8 @@ qemuStorageSourcePrivateDataFormat(virStorageSource *src,
|
||||
|
||||
virXMLFormatElement(buf, "objects", NULL, &objectsChildBuf);
|
||||
|
||||
+ virXMLFormatElement(buf, "fdsets", NULL, &fdsetsChildBuf);
|
||||
+
|
||||
if (src->thresholdEventWithIndex)
|
||||
virBufferAddLit(buf, "<thresholdEvent indexUsed='yes'/>\n");
|
||||
|
||||
diff --git a/tests/qemustatusxml2xmldata/modern-in.xml b/tests/qemustatusxml2xmldata/modern-in.xml
|
||||
index 7759034f7a..f5beab722b 100644
|
||||
--- a/tests/qemustatusxml2xmldata/modern-in.xml
|
||||
+++ b/tests/qemustatusxml2xmldata/modern-in.xml
|
||||
@@ -341,6 +341,9 @@
|
||||
<secret type='tlskey' alias='tls-certificate-key-alias'/>
|
||||
<TLSx509 alias='transport-alias'/>
|
||||
</objects>
|
||||
+ <fdsets>
|
||||
+ <fdset type='storage' id='1337'/>
|
||||
+ </fdsets>
|
||||
<thresholdEvent indexUsed='yes'/>
|
||||
</privateData>
|
||||
</source>
|
||||
--
|
||||
2.39.1
|
||||
|
@ -1,97 +0,0 @@
|
||||
From f7d193539a8a7194ee3506642b68e0e52619cdf9 Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <f7d193539a8a7194ee3506642b68e0e52619cdf9@dist-git>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Tue, 31 Jan 2023 15:25:57 +0100
|
||||
Subject: [PATCH] qemu: fd: Add helpers allowing storing FD set data in status
|
||||
XML
|
||||
|
||||
Rollback of FD sets passed to qemu is also needed after possible restart
|
||||
of libvirtd when we need to serialize the data into status XML. For this
|
||||
purpose we need to access the fdset ID once it was passed to qemu and
|
||||
potentially re-create a 'qemuFDPass' struct in passed state.
|
||||
|
||||
Introduce 'qemuFDPassNewPassed' and 'qemuFDPassIsPassed'.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
|
||||
(cherry picked from commit 5598c10c6464887a99928de48fb2fc3e4f1696dc)
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=2040272
|
||||
---
|
||||
src/qemu/qemu_fd.c | 41 +++++++++++++++++++++++++++++++++++++++++
|
||||
src/qemu/qemu_fd.h | 7 +++++++
|
||||
2 files changed, 48 insertions(+)
|
||||
|
||||
diff --git a/src/qemu/qemu_fd.c b/src/qemu/qemu_fd.c
|
||||
index ebeeb65505..f5eedb88ec 100644
|
||||
--- a/src/qemu/qemu_fd.c
|
||||
+++ b/src/qemu/qemu_fd.c
|
||||
@@ -96,6 +96,47 @@ qemuFDPassNew(const char *prefix,
|
||||
}
|
||||
|
||||
|
||||
+/**
|
||||
+ * qemuFDPassNewPassed:
|
||||
+ * @fdSetID: ID of an FDset which was allready passed to qemu
|
||||
+ *
|
||||
+ * Create qemuFDPass pointing to an already passed FD. Useful to usw with
|
||||
+ * qemuFDPassTransferMonitorRollback, when restoring after restart.
|
||||
+ */
|
||||
+qemuFDPass *
|
||||
+qemuFDPassNewPassed(unsigned int fdSetID)
|
||||
+{
|
||||
+ qemuFDPass *fdpass = g_new0(qemuFDPass, 1);
|
||||
+
|
||||
+ fdpass->fdSetID = fdSetID;
|
||||
+ fdpass->passed = true;
|
||||
+
|
||||
+ return fdpass;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/**
|
||||
+ * qemuFDPassIsPassed:
|
||||
+ * @fdpass: The fd passing helper struct
|
||||
+ * @id: when non-NULL filled with the fdset ID
|
||||
+ *
|
||||
+ * Returns true if @fdpass was passed to qemu. In such case @id is also filled
|
||||
+ * with the ID of the fdset if non-NULL.
|
||||
+ */
|
||||
+bool
|
||||
+qemuFDPassIsPassed(qemuFDPass *fdpass,
|
||||
+ unsigned *id)
|
||||
+{
|
||||
+ if (!fdpass || !fdpass->passed)
|
||||
+ return false;
|
||||
+
|
||||
+ if (id)
|
||||
+ *id = fdpass->fdSetID;
|
||||
+
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
+
|
||||
/**
|
||||
* qemuFDPassAddFD:
|
||||
* @fdpass: The fd passing helper struct
|
||||
diff --git a/src/qemu/qemu_fd.h b/src/qemu/qemu_fd.h
|
||||
index 032b9442ee..cd0ff2c690 100644
|
||||
--- a/src/qemu/qemu_fd.h
|
||||
+++ b/src/qemu/qemu_fd.h
|
||||
@@ -31,6 +31,13 @@ qemuFDPass *
|
||||
qemuFDPassNew(const char *prefix,
|
||||
void *dompriv);
|
||||
|
||||
+qemuFDPass *
|
||||
+qemuFDPassNewPassed(unsigned int fdSetID);
|
||||
+
|
||||
+bool
|
||||
+qemuFDPassIsPassed(qemuFDPass *fdpass,
|
||||
+ unsigned *id);
|
||||
+
|
||||
void
|
||||
qemuFDPassAddFD(qemuFDPass *fdpass,
|
||||
int *fd,
|
||||
--
|
||||
2.39.1
|
||||
|
@ -1,51 +0,0 @@
|
||||
From b6eb914119af7e724cbee27951cfba0a6afb3b97 Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <b6eb914119af7e724cbee27951cfba0a6afb3b97@dist-git>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Thu, 19 Jan 2023 15:06:11 +0100
|
||||
Subject: [PATCH] qemu: hotplug: Remove legacy quirk for 'dimm' address
|
||||
generation
|
||||
|
||||
Commit b7798a07f93 (in fall of 2016) changed the way we generate aliases
|
||||
for 'dimm' memory devices as the alias itself is part of the migration
|
||||
stream section naming and thus must be treated as ABI.
|
||||
|
||||
The code added compatibility layer for VMs with memory hotplug started
|
||||
with the old scheme to prevent from generating wrong aliases. The
|
||||
compatibility layer broke though later when 'nvdimm' and 'pmem' devices
|
||||
were introduced as it wrongly detected them as old configuration.
|
||||
|
||||
Now rather than attempting to fix the legacy compat layer to treat other
|
||||
devices properly we'll be better off simply removing it as it's
|
||||
extremely unlikely that somebody has a VM started in 2016 running with
|
||||
today's libvirt and attempts to hotplug more memory.
|
||||
|
||||
This fixes a corner case when a user hot-adds a 'dimm' into a VM with a
|
||||
'dimm' and a 'nvdimm' after restart of libvirtd and then attempts to
|
||||
migrate the VM.
|
||||
|
||||
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2158701
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
|
||||
(cherry picked from commit 50ce3463d514950350143f03e8421c8c31889c5d)
|
||||
---
|
||||
src/qemu/qemu_hotplug.c | 4 +---
|
||||
1 file changed, 1 insertion(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
|
||||
index 026e1ee5ad..5840504d13 100644
|
||||
--- a/src/qemu/qemu_hotplug.c
|
||||
+++ b/src/qemu/qemu_hotplug.c
|
||||
@@ -2275,9 +2275,7 @@ qemuDomainAttachMemory(virQEMUDriver *driver,
|
||||
goto cleanup;
|
||||
releaseaddr = true;
|
||||
|
||||
- /* in cases where we are using a VM with aliases generated according to the
|
||||
- * index of the memory device we need to keep continue using that scheme */
|
||||
- if (qemuAssignDeviceMemoryAlias(vm->def, mem, priv->memAliasOrderMismatch) < 0)
|
||||
+ if (qemuAssignDeviceMemoryAlias(vm->def, mem, false) < 0)
|
||||
goto cleanup;
|
||||
|
||||
objalias = g_strdup_printf("mem%s", mem->info.alias);
|
||||
--
|
||||
2.39.1
|
||||
|
@ -1,51 +0,0 @@
|
||||
From 01d7e15c8c4a33a379e8297182dc474bb2046d2a Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <01d7e15c8c4a33a379e8297182dc474bb2046d2a@dist-git>
|
||||
From: Michal Privoznik <mprivozn@redhat.com>
|
||||
Date: Fri, 27 Jan 2023 10:46:55 +0100
|
||||
Subject: [PATCH] qemuExtTPMStop: Restore TPM state label more often
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
When stopping swtpm we can restore the label either on just the
|
||||
swtpm's domain specific logfile (/var/log/swtpm/libvirt/qemu/...),
|
||||
or on the logfile and the state too (/var/lib/libvirt/swtpm/...).
|
||||
|
||||
The deciding factor is whether the guest is stopped because of
|
||||
outgoing migration OR the state is on a shared filesystem.
|
||||
|
||||
But this is not correct condition, because for instance saving the
|
||||
guest into a file (virsh save) is also an outgoing migration.
|
||||
Alternatively, when the swtpm state is stored on a shared
|
||||
filesystem, but the guest is destroyed (virsh destroy), i.e.
|
||||
stopped because of different reason than migration, we want to
|
||||
restore the seclabels.
|
||||
|
||||
The correct condition is: skip restoring the state on outgoing
|
||||
migration AND shared filesystem.
|
||||
|
||||
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2161557
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||
(cherry picked from commit 794fddf866676ef4119b3acf43b5547a9e868bb9)
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
---
|
||||
src/qemu/qemu_tpm.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_tpm.c b/src/qemu/qemu_tpm.c
|
||||
index b2748eb6a4..5831ffc32e 100644
|
||||
--- a/src/qemu/qemu_tpm.c
|
||||
+++ b/src/qemu/qemu_tpm.c
|
||||
@@ -1142,7 +1142,7 @@ qemuExtTPMStop(virQEMUDriver *driver,
|
||||
return;
|
||||
|
||||
qemuTPMEmulatorStop(cfg->swtpmStateDir, shortName);
|
||||
- if (outgoingMigration || qemuTPMHasSharedStorage(vm->def))
|
||||
+ if (outgoingMigration && qemuTPMHasSharedStorage(vm->def))
|
||||
restoreTPMStateLabel = false;
|
||||
|
||||
if (qemuSecurityRestoreTPMLabels(driver, vm, restoreTPMStateLabel) < 0)
|
||||
--
|
||||
2.39.1
|
||||
|
@ -1,38 +0,0 @@
|
||||
From d96dc2b87c220298d4de031cff72fd9a458dad74 Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <d96dc2b87c220298d4de031cff72fd9a458dad74@dist-git>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Tue, 31 Jan 2023 17:26:43 +0100
|
||||
Subject: [PATCH] qemuFDPassTransferCommand: Mark that FD was passed
|
||||
|
||||
Until now the code didn't expect that we'd want to rollback/detach a FD
|
||||
passed on the commandline, but whith disk backend FD passing this can
|
||||
happen.
|
||||
|
||||
Properly mark the 'qemuFDPass' object as passed to qemu even when it was
|
||||
done on the commandline.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
|
||||
(cherry picked from commit 3b7b201b95f2facc01bd9f8a42aed0fad96789fa)
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=2040272
|
||||
---
|
||||
src/qemu/qemu_fd.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/src/qemu/qemu_fd.c b/src/qemu/qemu_fd.c
|
||||
index 51a8133fde..ebeeb65505 100644
|
||||
--- a/src/qemu/qemu_fd.c
|
||||
+++ b/src/qemu/qemu_fd.c
|
||||
@@ -151,6 +151,8 @@ qemuFDPassTransferCommand(qemuFDPass *fdpass,
|
||||
fdpass->fds[i].fd = -1;
|
||||
virCommandAddArgList(cmd, "-add-fd", arg, NULL);
|
||||
}
|
||||
+
|
||||
+ fdpass->passed = true;
|
||||
}
|
||||
|
||||
|
||||
--
|
||||
2.39.1
|
||||
|
@ -1,69 +0,0 @@
|
||||
From dd64ec40a29739464cfe886818588bb9946b8d8d Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <dd64ec40a29739464cfe886818588bb9946b8d8d@dist-git>
|
||||
From: Michal Privoznik <mprivozn@redhat.com>
|
||||
Date: Fri, 27 Jan 2023 13:59:08 +0100
|
||||
Subject: [PATCH] qemuProcessLaunch: Tighten rules for external devices wrt
|
||||
incoming migration
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
When starting a guest, helper processes are started first. But
|
||||
they need a bit of special handling. Just consider a regular cold
|
||||
boot and an incoming migration. For instance, in case of swtpm
|
||||
with its state on a shared volume, we want to set label on the
|
||||
state for the cold boot case, but don't want to touch the label
|
||||
in case of incoming migration (because the source very
|
||||
specifically did not restore it either).
|
||||
|
||||
Until now, these two cases were differentiated by testing
|
||||
@incoming against NULL. And while that makes sense for other
|
||||
aspects of domain startup, for external devices we need a bit
|
||||
more, because a restore from a save file is also 'incoming
|
||||
migration'.
|
||||
|
||||
Now, there is a difference between regular migration and restore
|
||||
from a save file. In the former case we do not want to set
|
||||
seclabels in the save state. BUT, in the latter case we do need
|
||||
to set them, because the code that saves the machine restored
|
||||
seclabels.
|
||||
|
||||
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2161557
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||
(cherry picked from commit 5c4007ddc6c29632b5cc96ab4ef81ebb7797d1bb)
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
---
|
||||
src/qemu/qemu_process.c | 9 ++++++++-
|
||||
1 file changed, 8 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
|
||||
index 2de87211fb..1217fb1856 100644
|
||||
--- a/src/qemu/qemu_process.c
|
||||
+++ b/src/qemu/qemu_process.c
|
||||
@@ -7620,6 +7620,7 @@ qemuProcessLaunch(virConnectPtr conn,
|
||||
size_t nnicindexes = 0;
|
||||
g_autofree int *nicindexes = NULL;
|
||||
unsigned long long maxMemLock = 0;
|
||||
+ bool incomingMigrationExtDevices = false;
|
||||
|
||||
VIR_DEBUG("conn=%p driver=%p vm=%p name=%s id=%d asyncJob=%d "
|
||||
"incoming.uri=%s "
|
||||
@@ -7674,7 +7675,13 @@ qemuProcessLaunch(virConnectPtr conn,
|
||||
if (qemuDomainSchedCoreStart(cfg, vm) < 0)
|
||||
goto cleanup;
|
||||
|
||||
- if (qemuExtDevicesStart(driver, vm, incoming != NULL) < 0)
|
||||
+ /* For external devices the rules of incoming migration are a bit stricter,
|
||||
+ * than plain @incoming != NULL. They need to differentiate between
|
||||
+ * incoming migration and restore from a save file. */
|
||||
+ incomingMigrationExtDevices = incoming &&
|
||||
+ vmop == VIR_NETDEV_VPORT_PROFILE_OP_MIGRATE_IN_START;
|
||||
+
|
||||
+ if (qemuExtDevicesStart(driver, vm, incomingMigrationExtDevices) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (!(cmd = qemuBuildCommandLine(vm,
|
||||
--
|
||||
2.39.1
|
||||
|
@ -1,62 +0,0 @@
|
||||
From b53d7b7150f81ee6f014815fa7ee3f1106c491d5 Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <b53d7b7150f81ee6f014815fa7ee3f1106c491d5@dist-git>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Thu, 9 Feb 2023 09:40:32 +0100
|
||||
Subject: [PATCH] qemuProcessRefreshDisks: Don't skip filling of disk
|
||||
information if tray state didn't change
|
||||
|
||||
Commit 5ef2582646eb98 added emitting of even when refreshign disk state,
|
||||
where it wanted to avoid sending the event if disk state didn't change.
|
||||
This was achieved by using 'continue' in the loop filling the
|
||||
information. Unfortunately this skips extraction of whether the device
|
||||
has a tray which is propagated into internal structures, which in turn
|
||||
broke cdrom media change as the code thought there's no tray for the
|
||||
device.
|
||||
|
||||
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2166411
|
||||
Fixes: 5ef2582646eb98af208ce37355f82bdef39931fa
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
|
||||
(cherry picked from commit 86cfe93ef7fdc2d665a2fc88b79af89e7978ba78)
|
||||
---
|
||||
src/qemu/qemu_process.c | 11 +++++------
|
||||
1 file changed, 5 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
|
||||
index 32083de563..7ae859d68f 100644
|
||||
--- a/src/qemu/qemu_process.c
|
||||
+++ b/src/qemu/qemu_process.c
|
||||
@@ -8713,16 +8713,13 @@ qemuProcessRefreshDisks(virDomainObj *vm,
|
||||
continue;
|
||||
|
||||
if (info->removable) {
|
||||
- virObjectEvent *event = NULL;
|
||||
+ bool emitEvent = info->tray_open != disk->tray_status;
|
||||
int reason;
|
||||
|
||||
if (info->empty)
|
||||
virDomainDiskEmptySource(disk);
|
||||
|
||||
if (info->tray) {
|
||||
- if (info->tray_open == disk->tray_status)
|
||||
- continue;
|
||||
-
|
||||
if (info->tray_open) {
|
||||
reason = VIR_DOMAIN_EVENT_TRAY_CHANGE_OPEN;
|
||||
disk->tray_status = VIR_DOMAIN_DISK_TRAY_OPEN;
|
||||
@@ -8731,8 +8728,10 @@ qemuProcessRefreshDisks(virDomainObj *vm,
|
||||
disk->tray_status = VIR_DOMAIN_DISK_TRAY_CLOSED;
|
||||
}
|
||||
|
||||
- event = virDomainEventTrayChangeNewFromObj(vm, disk->info.alias, reason);
|
||||
- virObjectEventStateQueue(driver->domainEventState, event);
|
||||
+ if (emitEvent) {
|
||||
+ virObjectEvent *event = virDomainEventTrayChangeNewFromObj(vm, disk->info.alias, reason);
|
||||
+ virObjectEventStateQueue(driver->domainEventState, event);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.39.1
|
||||
|
@ -1,46 +0,0 @@
|
||||
From 102efebe3cd2bfebace026744a7835309cf124fa Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <102efebe3cd2bfebace026744a7835309cf124fa@dist-git>
|
||||
From: Michal Privoznik <mprivozn@redhat.com>
|
||||
Date: Fri, 27 Jan 2023 10:45:50 +0100
|
||||
Subject: [PATCH] qemuProcessStop: Fix detection of outgoing migration for
|
||||
external devices
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
When cleaning up host in qemuProcessStop(), our external helper
|
||||
processes (e.g. swtpm) want to know whether the domain is being
|
||||
migrated out or not (so that they restore seclabels on a device
|
||||
state that's on a shared storage).
|
||||
|
||||
This fact is reflected in the @outgoingMigration variable which
|
||||
is set to true if asyncJob is anything but
|
||||
VIR_ASYNC_JOB_MIGRATION_IN. Well, we have a specific job for
|
||||
outgoing migration (VIR_ASYNC_JOB_MIGRATION_OUT) and thus we
|
||||
should check for that.
|
||||
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||
(cherry picked from commit 88f0fbf63851c6ae80ad03b2a05a966d8a2f296c)
|
||||
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2161557
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
---
|
||||
src/qemu/qemu_process.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
|
||||
index 29716ecb19..2de87211fb 100644
|
||||
--- a/src/qemu/qemu_process.c
|
||||
+++ b/src/qemu/qemu_process.c
|
||||
@@ -8397,7 +8397,7 @@ void qemuProcessStop(virQEMUDriver *driver,
|
||||
qemuDomainCleanupRun(driver, vm);
|
||||
|
||||
outgoingMigration = (flags & VIR_QEMU_PROCESS_STOP_MIGRATED) &&
|
||||
- (asyncJob != VIR_ASYNC_JOB_MIGRATION_IN);
|
||||
+ (asyncJob == VIR_ASYNC_JOB_MIGRATION_OUT);
|
||||
qemuExtDevicesStop(driver, vm, outgoingMigration);
|
||||
|
||||
qemuDBusStop(driver, vm);
|
||||
--
|
||||
2.39.1
|
||||
|
@ -1,59 +0,0 @@
|
||||
From deb6aad4f6bcfd95235d3149e9d69b95fe011294 Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <deb6aad4f6bcfd95235d3149e9d69b95fe011294@dist-git>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Tue, 31 Jan 2023 15:19:58 +0100
|
||||
Subject: [PATCH] qemuStorageSourcePrivateDataFormat: Rename 'tmp' to
|
||||
'objectsChildBuf'
|
||||
|
||||
Be consistent with other children buffer variable naming scheme.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
|
||||
(cherry picked from commit 531adf32743b6045f44964ec5e1f8bdb9c913797)
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=2040272
|
||||
---
|
||||
src/qemu/qemu_domain.c | 14 +++++++-------
|
||||
1 file changed, 7 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
|
||||
index 2eb5653254..226d4d6dc1 100644
|
||||
--- a/src/qemu/qemu_domain.c
|
||||
+++ b/src/qemu/qemu_domain.c
|
||||
@@ -2005,9 +2005,9 @@ static int
|
||||
qemuStorageSourcePrivateDataFormat(virStorageSource *src,
|
||||
virBuffer *buf)
|
||||
{
|
||||
- g_auto(virBuffer) tmp = VIR_BUFFER_INIT_CHILD(buf);
|
||||
qemuDomainStorageSourcePrivate *srcPriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(src);
|
||||
g_auto(virBuffer) nodenamesChildBuf = VIR_BUFFER_INIT_CHILD(buf);
|
||||
+ g_auto(virBuffer) objectsChildBuf = VIR_BUFFER_INIT_CHILD(buf);
|
||||
|
||||
virBufferEscapeString(&nodenamesChildBuf, "<nodename type='storage' name='%s'/>\n", src->nodestorage);
|
||||
virBufferEscapeString(&nodenamesChildBuf, "<nodename type='format' name='%s'/>\n", src->nodeformat);
|
||||
@@ -2025,16 +2025,16 @@ qemuStorageSourcePrivateDataFormat(virStorageSource *src,
|
||||
return -1;
|
||||
|
||||
if (srcPriv) {
|
||||
- qemuStorageSourcePrivateDataFormatSecinfo(&tmp, srcPriv->secinfo, "auth");
|
||||
- qemuStorageSourcePrivateDataFormatSecinfo(&tmp, srcPriv->encinfo, "encryption");
|
||||
- qemuStorageSourcePrivateDataFormatSecinfo(&tmp, srcPriv->httpcookie, "httpcookie");
|
||||
- qemuStorageSourcePrivateDataFormatSecinfo(&tmp, srcPriv->tlsKeySecret, "tlskey");
|
||||
+ qemuStorageSourcePrivateDataFormatSecinfo(&objectsChildBuf, srcPriv->secinfo, "auth");
|
||||
+ qemuStorageSourcePrivateDataFormatSecinfo(&objectsChildBuf, srcPriv->encinfo, "encryption");
|
||||
+ qemuStorageSourcePrivateDataFormatSecinfo(&objectsChildBuf, srcPriv->httpcookie, "httpcookie");
|
||||
+ qemuStorageSourcePrivateDataFormatSecinfo(&objectsChildBuf, srcPriv->tlsKeySecret, "tlskey");
|
||||
}
|
||||
|
||||
if (src->tlsAlias)
|
||||
- virBufferAsprintf(&tmp, "<TLSx509 alias='%s'/>\n", src->tlsAlias);
|
||||
+ virBufferAsprintf(&objectsChildBuf, "<TLSx509 alias='%s'/>\n", src->tlsAlias);
|
||||
|
||||
- virXMLFormatElement(buf, "objects", NULL, &tmp);
|
||||
+ virXMLFormatElement(buf, "objects", NULL, &objectsChildBuf);
|
||||
|
||||
if (src->thresholdEventWithIndex)
|
||||
virBufferAddLit(buf, "<thresholdEvent indexUsed='yes'/>\n");
|
||||
--
|
||||
2.39.1
|
||||
|
@ -1,44 +0,0 @@
|
||||
From d78fc22fb96e0050a419623bf27639c63624c998 Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <d78fc22fb96e0050a419623bf27639c63624c998@dist-git>
|
||||
From: Michal Privoznik <mprivozn@redhat.com>
|
||||
Date: Fri, 10 Feb 2023 09:47:05 +0100
|
||||
Subject: [PATCH] qemu_extdevice: Do cleanup host only for
|
||||
VIR_DOMAIN_TPM_TYPE_EMULATOR
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
We only set up host for VIR_DOMAIN_TPM_TYPE_EMULATOR and thus
|
||||
similarly, we should do cleanup for the same type. This also
|
||||
fixes a crasher, in which qemuTPMEmulatorCleanupHost() accesses
|
||||
tpm->data.emulator.storagepath which is NULL for
|
||||
VIR_DOMAIN_TPM_TYPE_EXTERNAL.
|
||||
|
||||
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2168762
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||
(cherry picked from commit 03f76e577d66f8eea6aa7cc513e75026527b4cda)
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
---
|
||||
src/qemu/qemu_extdevice.c | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_extdevice.c b/src/qemu/qemu_extdevice.c
|
||||
index f7b2e2e653..fdefe59215 100644
|
||||
--- a/src/qemu/qemu_extdevice.c
|
||||
+++ b/src/qemu/qemu_extdevice.c
|
||||
@@ -162,7 +162,10 @@ qemuExtDevicesCleanupHost(virQEMUDriver *driver,
|
||||
return;
|
||||
|
||||
for (i = 0; i < def->ntpms; i++) {
|
||||
- qemuExtTPMCleanupHost(def->tpms[i], flags, outgoingMigration);
|
||||
+ virDomainTPMDef *tpm = def->tpms[i];
|
||||
+
|
||||
+ if (tpm->type == VIR_DOMAIN_TPM_TYPE_EMULATOR)
|
||||
+ qemuExtTPMCleanupHost(tpm, flags, outgoingMigration);
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.39.1
|
||||
|
@ -1,34 +0,0 @@
|
||||
From bf949f570a232423c7cf01831dfbe7034a4f49d8 Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <bf949f570a232423c7cf01831dfbe7034a4f49d8@dist-git>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Tue, 31 Jan 2023 15:23:54 +0100
|
||||
Subject: [PATCH] qemu_fd: Remove declaration for 'qemuFDPassNewDirect'
|
||||
|
||||
The function doesn't exist any more.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
|
||||
(cherry picked from commit 51dc38fe31beb252cc0fa2780210cdedc698f57f)
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=2040272
|
||||
---
|
||||
src/qemu/qemu_fd.h | 3 ---
|
||||
1 file changed, 3 deletions(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_fd.h b/src/qemu/qemu_fd.h
|
||||
index 6f165b6be9..032b9442ee 100644
|
||||
--- a/src/qemu/qemu_fd.h
|
||||
+++ b/src/qemu/qemu_fd.h
|
||||
@@ -30,9 +30,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuFDPass, qemuFDPassFree);
|
||||
qemuFDPass *
|
||||
qemuFDPassNew(const char *prefix,
|
||||
void *dompriv);
|
||||
-qemuFDPass *
|
||||
-qemuFDPassNewDirect(const char *prefix,
|
||||
- void *dompriv);
|
||||
|
||||
void
|
||||
qemuFDPassAddFD(qemuFDPass *fdpass,
|
||||
--
|
||||
2.39.1
|
||||
|
@ -1,56 +0,0 @@
|
||||
From 25de0ead0194159a6d9a769f34ec5b092e9b718c Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <25de0ead0194159a6d9a769f34ec5b092e9b718c@dist-git>
|
||||
From: Michal Privoznik <mprivozn@redhat.com>
|
||||
Date: Mon, 23 Jan 2023 11:42:18 +0100
|
||||
Subject: [PATCH] qemu_interface: Fix managed='no' case when creating an
|
||||
ethernet interface
|
||||
|
||||
In a recent commit of v9.0.0-rc1~192 I've tried to forbid case
|
||||
where a TAP device already exists, but at the same time it's
|
||||
managed by Libvirt (<interface type='ethernet'> <target
|
||||
dev='tap0' managed='yes'/> </interface>). NB, if @managed
|
||||
attribute is missing then it's assumed to be managed by Libvirt.
|
||||
|
||||
Anyway, I've mistakenly put setting of
|
||||
VIR_NETDEV_TAP_CREATE_ALLOW_EXISTING flag into managed='yes'
|
||||
branch instead of managed='no' branch in
|
||||
qemuInterfaceEthernetConnect().
|
||||
|
||||
Move the setting of the flag into the correct branch.
|
||||
|
||||
Fixes: a2ae3d299cf9c5ada8aa42ec4271748eb479dc27
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
|
||||
(cherry picked from commit d6a8b9eef70887e01fa5fd292580e14ca5eab08c)
|
||||
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2144738
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
---
|
||||
src/qemu/qemu_interface.c | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_interface.c b/src/qemu/qemu_interface.c
|
||||
index b6895cedde..ed2c209167 100644
|
||||
--- a/src/qemu/qemu_interface.c
|
||||
+++ b/src/qemu/qemu_interface.c
|
||||
@@ -443,6 +443,9 @@ qemuInterfaceEthernetConnect(virDomainDef *def,
|
||||
_("target managed='no' but specified dev doesn't exist"));
|
||||
goto cleanup;
|
||||
}
|
||||
+
|
||||
+ tap_create_flags |= VIR_NETDEV_TAP_CREATE_ALLOW_EXISTING;
|
||||
+
|
||||
if (virNetDevMacVLanIsMacvtap(net->ifname)) {
|
||||
auditdev = net->ifname;
|
||||
if (virNetDevMacVLanTapOpen(net->ifname, tapfd, tapfdSize) < 0)
|
||||
@@ -461,8 +464,6 @@ qemuInterfaceEthernetConnect(virDomainDef *def,
|
||||
if (!net->ifname)
|
||||
template_ifname = true;
|
||||
|
||||
- tap_create_flags |= VIR_NETDEV_TAP_CREATE_ALLOW_EXISTING;
|
||||
-
|
||||
if (virNetDevTapCreate(&net->ifname, tunpath, tapfd, tapfdSize,
|
||||
tap_create_flags) < 0) {
|
||||
goto cleanup;
|
||||
--
|
||||
2.39.1
|
||||
|
@ -1,59 +0,0 @@
|
||||
From fd06fc3affcda0d7af1721c26915b8d87e0b2614 Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <fd06fc3affcda0d7af1721c26915b8d87e0b2614@dist-git>
|
||||
From: Michal Privoznik <mprivozn@redhat.com>
|
||||
Date: Tue, 7 Feb 2023 15:06:32 +0100
|
||||
Subject: [PATCH] qemu_namespace: Deal with nested mounts when umount()-ing
|
||||
/dev
|
||||
|
||||
In one of recent commits (v9.0.0-rc1~106) I've made our QEMU
|
||||
namespace code umount the original /dev. One of the reasons was
|
||||
enhanced security, because previously we just mounted a tmpfs
|
||||
over the original /dev. Thus a malicious QEMU could just
|
||||
umount("/dev") and it would get to the original /dev with all
|
||||
nodes.
|
||||
|
||||
Now, on some systems this introduced a regression:
|
||||
|
||||
failed to umount devfs on /dev: Device or resource busy
|
||||
|
||||
But how this could be? We've moved all file systems mounted under
|
||||
/dev to a temporary location. Or have we? As it turns out, not
|
||||
quite. If there are two file systems mounted on the same target,
|
||||
e.g. like this:
|
||||
|
||||
mount -t tmpfs tmpfs /dev/shm/ && mount -t tmpfs tmpfs /dev/shm/
|
||||
|
||||
then only the top most (i.e. the last one) is moved. See
|
||||
qemuDomainUnshareNamespace() for more info.
|
||||
|
||||
Now, we could enhance our code to deal with these "doubled" mount
|
||||
points. Or, since it is the top most file system that is
|
||||
accessible anyways (and this one is preserved), we can
|
||||
umount("/dev") in a recursive fashion.
|
||||
|
||||
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2167302
|
||||
Fixes: 379c0ce4bfed8733dfbde557c359eecc5474ce38
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
|
||||
(cherry picked from commit 5155ab4b2a704285505dfea6ffee8b980fdaa29e)
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
---
|
||||
src/qemu/qemu_namespace.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_namespace.c b/src/qemu/qemu_namespace.c
|
||||
index 5769a4dfe0..5fc043bd62 100644
|
||||
--- a/src/qemu/qemu_namespace.c
|
||||
+++ b/src/qemu/qemu_namespace.c
|
||||
@@ -777,7 +777,7 @@ qemuDomainUnshareNamespace(virQEMUDriverConfig *cfg,
|
||||
}
|
||||
|
||||
#if defined(__linux__)
|
||||
- if (umount("/dev") < 0) {
|
||||
+ if (umount2("/dev", MNT_DETACH) < 0) {
|
||||
virReportSystemError(errno, "%s", _("failed to umount devfs on /dev"));
|
||||
return -1;
|
||||
}
|
||||
--
|
||||
2.39.1
|
||||
|
@ -1,64 +0,0 @@
|
||||
From 99f69000a1ecacc2f064043993ece8ddba366976 Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <99f69000a1ecacc2f064043993ece8ddba366976@dist-git>
|
||||
From: Michal Privoznik <mprivozn@redhat.com>
|
||||
Date: Tue, 7 Feb 2023 10:34:40 +0100
|
||||
Subject: [PATCH] qemu_process: Produce better debug message wrt domain
|
||||
namespaces
|
||||
|
||||
When going through debug log of a domain startup process, one can
|
||||
meet the following line:
|
||||
|
||||
debug : qemuProcessLaunch:7668 : Building mount namespace
|
||||
|
||||
But this is in fact wrong. Firstly, domain namespaces are just
|
||||
enabled in domain's privateData. Secondly, the debug message says
|
||||
nothing about actual state of namespace - whether it was enabled
|
||||
or not.
|
||||
|
||||
Therefore, move the debug printing into
|
||||
qemuProcessEnableDomainNamespaces() and tweak it so that the
|
||||
actual value is reflected.
|
||||
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
|
||||
(cherry picked from commit 697c16e39ae9a9e18ce7cad0729bf2293b12a307)
|
||||
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2167302
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
---
|
||||
src/qemu/qemu_process.c | 8 ++++++--
|
||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
|
||||
index 1217fb1856..32083de563 100644
|
||||
--- a/src/qemu/qemu_process.c
|
||||
+++ b/src/qemu/qemu_process.c
|
||||
@@ -7377,11 +7377,17 @@ qemuProcessEnableDomainNamespaces(virQEMUDriver *driver,
|
||||
virDomainObj *vm)
|
||||
{
|
||||
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
|
||||
+ const char *state = "disabled";
|
||||
|
||||
if (virBitmapIsBitSet(cfg->namespaces, QEMU_DOMAIN_NS_MOUNT) &&
|
||||
qemuDomainEnableNamespace(vm, QEMU_DOMAIN_NS_MOUNT) < 0)
|
||||
return -1;
|
||||
|
||||
+ if (qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT))
|
||||
+ state = "enabled";
|
||||
+
|
||||
+ VIR_DEBUG("Mount namespace for domain name=%s is %s",
|
||||
+ vm->def->name, state);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -7705,8 +7711,6 @@ qemuProcessLaunch(virConnectPtr conn,
|
||||
|
||||
qemuDomainLogContextMarkPosition(logCtxt);
|
||||
|
||||
- VIR_DEBUG("Building mount namespace");
|
||||
-
|
||||
if (qemuProcessEnableDomainNamespaces(driver, vm) < 0)
|
||||
goto cleanup;
|
||||
|
||||
--
|
||||
2.39.1
|
||||
|
@ -1,141 +0,0 @@
|
||||
From 7289999ecc435bcc65881c64b49efba9746a9571 Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <7289999ecc435bcc65881c64b49efba9746a9571@dist-git>
|
||||
From: Pavel Hrdina <phrdina@redhat.com>
|
||||
Date: Tue, 21 Feb 2023 16:52:28 +0100
|
||||
Subject: [PATCH] qemu_snapshot: refactor qemuSnapshotDeleteExternalPrepare
|
||||
|
||||
When user creates external snapshot with making only memory snapshot
|
||||
without any disks deleting that snapshot failed without reporting any
|
||||
meaningful error.
|
||||
|
||||
The issue is that the qemuSnapshotDeleteExternalPrepare function
|
||||
returns NULL because the returned list is empty. This will not change
|
||||
so to make it clear if the function fails or not return int instead and
|
||||
have another parameter where we can pass the list.
|
||||
|
||||
With the fixed memory snapshot deletion it will now correctly delete
|
||||
memory only snapshot as well.
|
||||
|
||||
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2170826
|
||||
|
||||
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
||||
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
|
||||
(cherry picked from commit e3957c22462bc52c37c94ca4d6fe3d26f8202119)
|
||||
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
||||
---
|
||||
src/qemu/qemu_snapshot.c | 28 +++++++++++++++-------------
|
||||
1 file changed, 15 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c
|
||||
index 5cdcbc6290..cfa531edef 100644
|
||||
--- a/src/qemu/qemu_snapshot.c
|
||||
+++ b/src/qemu/qemu_snapshot.c
|
||||
@@ -2301,9 +2301,10 @@ qemuSnapshotFindParentSnapForDisk(virDomainMomentObj *snap,
|
||||
}
|
||||
|
||||
|
||||
-static GSList*
|
||||
+static int
|
||||
qemuSnapshotDeleteExternalPrepare(virDomainObj *vm,
|
||||
- virDomainMomentObj *snap)
|
||||
+ virDomainMomentObj *snap,
|
||||
+ GSList **externalData)
|
||||
{
|
||||
ssize_t i;
|
||||
virDomainSnapshotDef *snapdef = virDomainSnapshotObjGetDef(snap);
|
||||
@@ -2320,7 +2321,7 @@ qemuSnapshotDeleteExternalPrepare(virDomainObj *vm,
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
_("snapshot disk '%s' was target of not completed snapshot delete"),
|
||||
snapDisk->name);
|
||||
- return NULL;
|
||||
+ return -1;
|
||||
}
|
||||
|
||||
data = g_new0(qemuSnapshotDeleteExternalData, 1);
|
||||
@@ -2328,18 +2329,18 @@ qemuSnapshotDeleteExternalPrepare(virDomainObj *vm,
|
||||
|
||||
data->domDisk = qemuDomainDiskByName(vm->def, snapDisk->name);
|
||||
if (!data->domDisk)
|
||||
- return NULL;
|
||||
+ return -1;
|
||||
|
||||
data->diskSrc = virStorageSourceChainLookupBySource(data->domDisk->src,
|
||||
data->snapDisk->src,
|
||||
&data->prevDiskSrc);
|
||||
if (!data->diskSrc)
|
||||
- return NULL;
|
||||
+ return -1;
|
||||
|
||||
if (!virStorageSourceIsSameLocation(data->diskSrc, data->snapDisk->src)) {
|
||||
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
|
||||
_("VM disk source and snapshot disk source are not the same"));
|
||||
- return NULL;
|
||||
+ return -1;
|
||||
}
|
||||
|
||||
data->parentDomDisk = virDomainDiskByTarget(snapdef->parent.dom,
|
||||
@@ -2348,7 +2349,7 @@ qemuSnapshotDeleteExternalPrepare(virDomainObj *vm,
|
||||
virReportError(VIR_ERR_OPERATION_FAILED,
|
||||
_("failed to find disk '%s' in snapshot VM XML"),
|
||||
snapDisk->name);
|
||||
- return NULL;
|
||||
+ return -1;
|
||||
}
|
||||
|
||||
if (virDomainObjIsActive(vm)) {
|
||||
@@ -2356,13 +2357,13 @@ qemuSnapshotDeleteExternalPrepare(virDomainObj *vm,
|
||||
if (!virStorageSourceIsBacking(data->parentDiskSrc)) {
|
||||
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
|
||||
_("failed to find parent disk source in backing chain"));
|
||||
- return NULL;
|
||||
+ return -1;
|
||||
}
|
||||
|
||||
if (!virStorageSourceIsSameLocation(data->parentDiskSrc, data->parentDomDisk->src)) {
|
||||
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
|
||||
_("snapshot VM disk source and parent disk source are not the same"));
|
||||
- return NULL;
|
||||
+ return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2371,15 +2372,16 @@ qemuSnapshotDeleteExternalPrepare(virDomainObj *vm,
|
||||
if (data->parentSnap && !virDomainSnapshotIsExternal(data->parentSnap)) {
|
||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||
_("deleting external snapshot that has internal snapshot as parent not supported"));
|
||||
- return NULL;
|
||||
+ return -1;
|
||||
}
|
||||
|
||||
ret = g_slist_prepend(ret, g_steal_pointer(&data));
|
||||
}
|
||||
|
||||
ret = g_slist_reverse(ret);
|
||||
+ *externalData = g_steal_pointer(&ret);
|
||||
|
||||
- return g_steal_pointer(&ret);
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -3159,7 +3161,7 @@ qemuSnapshotDelete(virDomainObj *vm,
|
||||
g_autoslist(qemuSnapshotDeleteExternalData) tmpData = NULL;
|
||||
|
||||
/* this also serves as validation whether the snapshot can be deleted */
|
||||
- if (!(tmpData = qemuSnapshotDeleteExternalPrepare(vm, snap)))
|
||||
+ if (qemuSnapshotDeleteExternalPrepare(vm, snap, &tmpData) < 0)
|
||||
goto endjob;
|
||||
|
||||
if (!virDomainObjIsActive(vm)) {
|
||||
@@ -3174,7 +3176,7 @@ qemuSnapshotDelete(virDomainObj *vm,
|
||||
|
||||
/* Call the prepare again as some data require that the VM is
|
||||
* running to get everything we need. */
|
||||
- if (!(externalData = qemuSnapshotDeleteExternalPrepare(vm, snap)))
|
||||
+ if (qemuSnapshotDeleteExternalPrepare(vm, snap, &externalData) < 0)
|
||||
goto endjob;
|
||||
} else {
|
||||
qemuDomainJobPrivate *jobPriv = vm->job->privateData;
|
||||
--
|
||||
2.39.1
|
||||
|
@ -1,73 +0,0 @@
|
||||
From 3ef43d47b0a5a49b0896b1725476b4b6ec0629b0 Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <3ef43d47b0a5a49b0896b1725476b4b6ec0629b0@dist-git>
|
||||
From: Pavel Hrdina <phrdina@redhat.com>
|
||||
Date: Tue, 21 Feb 2023 16:10:56 +0100
|
||||
Subject: [PATCH] qemu_snapshot: remove memory snapshot when deleting external
|
||||
snapshot
|
||||
|
||||
When deleting external snapshot we should remove the memory snapshot
|
||||
file as well.
|
||||
|
||||
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
||||
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
|
||||
(cherry picked from commit 356e227208ec66fff178b91ed4b1197c7e6cf974)
|
||||
|
||||
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2170826
|
||||
|
||||
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
||||
---
|
||||
src/qemu/qemu_snapshot.c | 14 ++++++++++++--
|
||||
1 file changed, 12 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c
|
||||
index b8416808b3..5cdcbc6290 100644
|
||||
--- a/src/qemu/qemu_snapshot.c
|
||||
+++ b/src/qemu/qemu_snapshot.c
|
||||
@@ -2684,9 +2684,11 @@ qemuSnapshotSetInvalid(virDomainObj *vm,
|
||||
|
||||
static int
|
||||
qemuSnapshotDiscardExternal(virDomainObj *vm,
|
||||
+ virDomainMomentObj *snap,
|
||||
GSList *externalData)
|
||||
{
|
||||
GSList *cur = NULL;
|
||||
+ virDomainSnapshotDef *snapdef = virDomainSnapshotObjGetDef(snap);
|
||||
|
||||
for (cur = externalData; cur; cur = g_slist_next(cur)) {
|
||||
qemuSnapshotDeleteExternalData *data = cur->data;
|
||||
@@ -2756,6 +2758,14 @@ qemuSnapshotDiscardExternal(virDomainObj *vm,
|
||||
goto error;
|
||||
}
|
||||
|
||||
+ if (snapdef->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL &&
|
||||
+ snapdef->memorysnapshotfile) {
|
||||
+ if (unlink(snapdef->memorysnapshotfile) < 0) {
|
||||
+ VIR_WARN("failed to remove memory snapshot '%s'",
|
||||
+ snapdef->memorysnapshotfile);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
return 0;
|
||||
|
||||
error:
|
||||
@@ -2886,7 +2896,7 @@ qemuSnapshotDiscardImpl(virQEMUDriver *driver,
|
||||
}
|
||||
|
||||
if (virDomainSnapshotIsExternal(snap)) {
|
||||
- if (qemuSnapshotDiscardExternal(vm, externalData) < 0)
|
||||
+ if (qemuSnapshotDiscardExternal(vm, snap, externalData) < 0)
|
||||
return -1;
|
||||
} else {
|
||||
if (qemuDomainSnapshotForEachQcow2(driver, def, snap, "-d", true) < 0)
|
||||
@@ -2894,7 +2904,7 @@ qemuSnapshotDiscardImpl(virQEMUDriver *driver,
|
||||
}
|
||||
} else {
|
||||
if (virDomainSnapshotIsExternal(snap)) {
|
||||
- if (qemuSnapshotDiscardExternal(vm, externalData) < 0)
|
||||
+ if (qemuSnapshotDiscardExternal(vm, snap, externalData) < 0)
|
||||
return -1;
|
||||
} else {
|
||||
/* Similarly as internal snapshot creation we would use a regular job
|
||||
--
|
||||
2.39.1
|
||||
|
@ -1,55 +0,0 @@
|
||||
From 64dbfdfe3ed2fc8f252ce138f6213b529edb2407 Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <64dbfdfe3ed2fc8f252ce138f6213b529edb2407@dist-git>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Wed, 15 Feb 2023 10:48:31 +0100
|
||||
Subject: [PATCH] rpc: Don't warn about "max_client_requests" in
|
||||
single-threaded daemons
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
The warning about max_client_requests is hit inside virtlogd every time
|
||||
a VM starts which spams the logs.
|
||||
|
||||
Emit the warning only when the client request limit is not 1 and add a
|
||||
warning into the daemon config to not configure it too low instead.
|
||||
|
||||
Fixes: 031878c2364
|
||||
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2145188
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
|
||||
(cherry picked from commit b3f8e072fe08a6beaf3ec3d27e02efee4358b2ca)
|
||||
---
|
||||
src/remote/libvirtd.conf.in | 1 +
|
||||
src/rpc/virnetserverclient.c | 3 ++-
|
||||
2 files changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/remote/libvirtd.conf.in b/src/remote/libvirtd.conf.in
|
||||
index 80a98b1529..32a680317a 100644
|
||||
--- a/src/remote/libvirtd.conf.in
|
||||
+++ b/src/remote/libvirtd.conf.in
|
||||
@@ -374,6 +374,7 @@
|
||||
# connection. To avoid one client monopolizing the server
|
||||
# this should be a small fraction of the global max_workers
|
||||
# parameter.
|
||||
+# Setting this too low may cause keepalive timeouts.
|
||||
#max_client_requests = 5
|
||||
|
||||
# Same processing controls, but this time for the admin interface.
|
||||
diff --git a/src/rpc/virnetserverclient.c b/src/rpc/virnetserverclient.c
|
||||
index b5c764b1b0..bdb3552c5d 100644
|
||||
--- a/src/rpc/virnetserverclient.c
|
||||
+++ b/src/rpc/virnetserverclient.c
|
||||
@@ -1261,7 +1261,8 @@ static virNetMessage *virNetServerClientDispatchRead(virNetServerClient *client)
|
||||
client->rx->bufferLength = VIR_NET_MESSAGE_LEN_MAX;
|
||||
client->rx->buffer = g_new0(char, client->rx->bufferLength);
|
||||
client->nrequests++;
|
||||
- } else if (!client->nrequests_warning) {
|
||||
+ } else if (!client->nrequests_warning &&
|
||||
+ client->nrequests_max > 1) {
|
||||
client->nrequests_warning = true;
|
||||
VIR_WARN("Client hit max requests limit %zd. This may result "
|
||||
"in keep-alive timeouts. Consider tuning the "
|
||||
--
|
||||
2.39.1
|
||||
|
@ -1,43 +0,0 @@
|
||||
From f26e30ecb3d0e25d5cf648755e2b4e1db0476b52 Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <f26e30ecb3d0e25d5cf648755e2b4e1db0476b52@dist-git>
|
||||
From: Martin Kletzander <mkletzan@redhat.com>
|
||||
Date: Tue, 24 Jan 2023 13:45:09 +0100
|
||||
Subject: [PATCH] rpc: Fix error message in virNetServerSetClientLimits
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Commit f007940cb25a tried to change the error message so that it is unified
|
||||
later in 35afa1d2d6c1, but various rewrites missed this particular error message
|
||||
which does not make sense. Fix it so that it is the same as the other two
|
||||
messages checking the same thing in this file.
|
||||
|
||||
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2033879
|
||||
|
||||
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||
(cherry picked from commit 1e2605c934b80c3e9c30e929834d38fee86f184e)
|
||||
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
|
||||
---
|
||||
src/rpc/virnetserver.c | 5 ++---
|
||||
1 file changed, 2 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/rpc/virnetserver.c b/src/rpc/virnetserver.c
|
||||
index bf0fda04ee..e97dfe8136 100644
|
||||
--- a/src/rpc/virnetserver.c
|
||||
+++ b/src/rpc/virnetserver.c
|
||||
@@ -1127,9 +1127,8 @@ virNetServerSetClientLimits(virNetServer *srv,
|
||||
|
||||
if (max < max_unauth) {
|
||||
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||
- _("The overall maximum number of clients waiting "
|
||||
- "for authentication must not be less than the overall "
|
||||
- "maximum number of clients"));
|
||||
+ _("The overall maximum number of clients must not be less "
|
||||
+ "than the number of clients waiting for authentication"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
--
|
||||
2.39.1
|
||||
|
@ -1,45 +0,0 @@
|
||||
From c07df2b480134357e6ecb53f61eb1d8295b2b406 Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <c07df2b480134357e6ecb53f61eb1d8295b2b406@dist-git>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Wed, 15 Feb 2023 10:43:53 +0100
|
||||
Subject: [PATCH] rpc: client: Don't check return value of virNetMessageNew
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
virNetServerClientDispatchRead checked the return value but it's not
|
||||
necessary any more as it can't return NULL nowadays.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
|
||||
(cherry picked from commit 761cb8a0876d32445951791030c77afa147c0de1)
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=2145188
|
||||
---
|
||||
src/rpc/virnetserverclient.c | 11 ++++-------
|
||||
1 file changed, 4 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/src/rpc/virnetserverclient.c b/src/rpc/virnetserverclient.c
|
||||
index c9a4eb521e..b5c764b1b0 100644
|
||||
--- a/src/rpc/virnetserverclient.c
|
||||
+++ b/src/rpc/virnetserverclient.c
|
||||
@@ -1257,13 +1257,10 @@ static virNetMessage *virNetServerClientDispatchRead(virNetServerClient *client)
|
||||
|
||||
/* Possibly need to create another receive buffer */
|
||||
if (client->nrequests < client->nrequests_max) {
|
||||
- if (!(client->rx = virNetMessageNew(true))) {
|
||||
- client->wantClose = true;
|
||||
- } else {
|
||||
- client->rx->bufferLength = VIR_NET_MESSAGE_LEN_MAX;
|
||||
- client->rx->buffer = g_new0(char, client->rx->bufferLength);
|
||||
- client->nrequests++;
|
||||
- }
|
||||
+ client->rx = virNetMessageNew(true);
|
||||
+ client->rx->bufferLength = VIR_NET_MESSAGE_LEN_MAX;
|
||||
+ client->rx->buffer = g_new0(char, client->rx->bufferLength);
|
||||
+ client->nrequests++;
|
||||
} else if (!client->nrequests_warning) {
|
||||
client->nrequests_warning = true;
|
||||
VIR_WARN("Client hit max requests limit %zd. This may result "
|
||||
--
|
||||
2.39.1
|
||||
|
@ -1,61 +0,0 @@
|
||||
From a967747fcdf7d78425d218625ddb42606451c2ab Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <a967747fcdf7d78425d218625ddb42606451c2ab@dist-git>
|
||||
From: Michal Privoznik <mprivozn@redhat.com>
|
||||
Date: Wed, 18 Jan 2023 09:03:29 +0100
|
||||
Subject: [PATCH] src: Don't use virReportSystemError() on
|
||||
virProcessGetStatInfo() failure
|
||||
|
||||
Firstly, the virProcessGetStatInfo() does not fail really. But
|
||||
even if it did, it sets correct errno only sometimes (and even
|
||||
that is done in a helper it's calling - virProcessGetStat() and
|
||||
even there it's the case only in very few error paths).
|
||||
|
||||
Therefore, using virReportSystemError() to report errors is very
|
||||
misleading. Use plain virReportError() instead. Luckily, there
|
||||
are only two places where the former was used:
|
||||
chDomainHelperGetVcpus() and qemuDomainHelperGetVcpus() (not a
|
||||
big surprise since CH driver is heavily inspired by QEMU driver).
|
||||
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
|
||||
(cherry picked from commit 818c9717c53446ca7abbaa7b3fd7925e1c5ab663)
|
||||
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2148266
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
---
|
||||
src/ch/ch_driver.c | 4 ++--
|
||||
src/qemu/qemu_driver.c | 4 ++--
|
||||
2 files changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/ch/ch_driver.c b/src/ch/ch_driver.c
|
||||
index db2a66d131..12fbe31c24 100644
|
||||
--- a/src/ch/ch_driver.c
|
||||
+++ b/src/ch/ch_driver.c
|
||||
@@ -1079,8 +1079,8 @@ chDomainHelperGetVcpus(virDomainObj *vm,
|
||||
NULL, NULL,
|
||||
&vcpuinfo->cpu, NULL,
|
||||
vm->pid, vcpupid) < 0) {
|
||||
- virReportSystemError(errno, "%s",
|
||||
- _("cannot get vCPU placement & pCPU time"));
|
||||
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
+ _("cannot get vCPU placement & pCPU time"));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
|
||||
index d6879175fe..c576c601ad 100644
|
||||
--- a/src/qemu/qemu_driver.c
|
||||
+++ b/src/qemu/qemu_driver.c
|
||||
@@ -1355,8 +1355,8 @@ qemuDomainHelperGetVcpus(virDomainObj *vm,
|
||||
NULL, NULL,
|
||||
&vcpuinfo->cpu, NULL,
|
||||
vm->pid, vcpupid) < 0) {
|
||||
- virReportSystemError(errno, "%s",
|
||||
- _("cannot get vCPU placement & pCPU time"));
|
||||
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
+ _("cannot get vCPU placement & pCPU time"));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
--
|
||||
2.39.1
|
||||
|
@ -1,59 +0,0 @@
|
||||
From 28bd414db666463dca0a26bbb969fd6bc784ec8e Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <28bd414db666463dca0a26bbb969fd6bc784ec8e@dist-git>
|
||||
From: Pavel Hrdina <phrdina@redhat.com>
|
||||
Date: Tue, 17 Jan 2023 10:02:07 +0100
|
||||
Subject: [PATCH] vircgroupv2: fix cpu.weight limits check
|
||||
|
||||
The cgroup v2 cpu.weight limits are different than cgroup v1 cpu.shares
|
||||
limits.
|
||||
|
||||
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
||||
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
|
||||
(cherry picked from commit cf3414a85b8383d71d6ae2a53daf63c331cc2230)
|
||||
|
||||
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2037998
|
||||
|
||||
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
||||
---
|
||||
src/util/vircgroup.h | 2 ++
|
||||
src/util/vircgroupv2.c | 8 ++++----
|
||||
2 files changed, 6 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/util/vircgroup.h b/src/util/vircgroup.h
|
||||
index 690f09465c..adf3850b22 100644
|
||||
--- a/src/util/vircgroup.h
|
||||
+++ b/src/util/vircgroup.h
|
||||
@@ -235,6 +235,8 @@ int virCgroupGetCpuShares(virCgroup *group, unsigned long long *shares);
|
||||
/* Based on kernel code ((1ULL << MAX_BW_BITS) - 1) where MAX_BW_BITS is
|
||||
* (64 - BW_SHIFT) and BW_SHIFT is 20 */
|
||||
#define VIR_CGROUP_CPU_QUOTA_MAX 17592186044415LL
|
||||
+#define VIR_CGROUPV2_WEIGHT_MIN 1LL
|
||||
+#define VIR_CGROUPV2_WEIGHT_MAX 10000LL
|
||||
|
||||
int virCgroupSetCpuCfsPeriod(virCgroup *group, unsigned long long cfs_period);
|
||||
int virCgroupGetCpuCfsPeriod(virCgroup *group, unsigned long long *cfs_period);
|
||||
diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c
|
||||
index b1f562aa52..219b9c7f21 100644
|
||||
--- a/src/util/vircgroupv2.c
|
||||
+++ b/src/util/vircgroupv2.c
|
||||
@@ -1499,13 +1499,13 @@ static int
|
||||
virCgroupV2SetCpuShares(virCgroup *group,
|
||||
unsigned long long shares)
|
||||
{
|
||||
- if (shares < VIR_CGROUP_CPU_SHARES_MIN ||
|
||||
- shares > VIR_CGROUP_CPU_SHARES_MAX) {
|
||||
+ if (shares < VIR_CGROUPV2_WEIGHT_MIN ||
|
||||
+ shares > VIR_CGROUPV2_WEIGHT_MAX) {
|
||||
virReportError(VIR_ERR_INVALID_ARG,
|
||||
_("shares '%llu' must be in range [%llu, %llu]"),
|
||||
shares,
|
||||
- VIR_CGROUP_CPU_SHARES_MIN,
|
||||
- VIR_CGROUP_CPU_SHARES_MAX);
|
||||
+ VIR_CGROUPV2_WEIGHT_MIN,
|
||||
+ VIR_CGROUPV2_WEIGHT_MAX);
|
||||
return -1;
|
||||
}
|
||||
|
||||
--
|
||||
2.39.1
|
||||
|
@ -1,47 +0,0 @@
|
||||
From f895d23743a65141a2db7f816e56d18c9c4de6df Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <f895d23743a65141a2db7f816e56d18c9c4de6df@dist-git>
|
||||
From: Michal Privoznik <mprivozn@redhat.com>
|
||||
Date: Mon, 30 Jan 2023 10:55:22 +0100
|
||||
Subject: [PATCH] virsh: Make domif-setlink work more than once
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
In virsh, we have this convenient domif-setlink command, which is
|
||||
just a wrapper over virDomainUpdateDeviceFlags() and which allows
|
||||
setting link state of given guest NIC. It does so by fetching
|
||||
corresponding <interface/> XML snippet and either putting <link
|
||||
state=''/> into it, OR if the element already exists setting the
|
||||
attribute to desired value. The XML is then fed into the update
|
||||
API.
|
||||
|
||||
There's, however, a small bug in detecting the pre-existence of
|
||||
the element and its attribute. The code looks at "link"
|
||||
attribute, while in fact, the attribute is called "state".
|
||||
|
||||
Resolves: https://gitlab.com/libvirt/libvirt/-/issues/426
|
||||
Fixes: e575bf082ed4889280be07c986375f1ca15bb7ee
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||
(cherry picked from commit 6f3f6c0f763b9ffd8ef93eb124c88dd0b79138fc)
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=2165466
|
||||
---
|
||||
tools/virsh-domain.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
|
||||
index 6b431bd1e5..59b2b3ce60 100644
|
||||
--- a/tools/virsh-domain.c
|
||||
+++ b/tools/virsh-domain.c
|
||||
@@ -3209,7 +3209,7 @@ cmdDomIfSetLink(vshControl *ctl, const vshCmd *cmd)
|
||||
}
|
||||
}
|
||||
|
||||
- if (xmlHasProp(linkNode, BAD_CAST "link"))
|
||||
+ if (xmlHasProp(linkNode, BAD_CAST "state"))
|
||||
stateAttr = xmlSetProp(linkNode, BAD_CAST "state", BAD_CAST state);
|
||||
else
|
||||
stateAttr = xmlNewProp(linkNode, BAD_CAST "state", BAD_CAST state);
|
||||
--
|
||||
2.39.1
|
||||
|
377
libvirt.spec
377
libvirt.spec
@ -228,9 +228,9 @@
|
||||
|
||||
Summary: Library providing a simple virtualization API
|
||||
Name: libvirt
|
||||
Version: 9.0.0
|
||||
Release: 7%{?dist}%{?extra_release}
|
||||
License: LGPLv2+
|
||||
Version: 9.1.0
|
||||
Release: 1%{?dist}%{?extra_release}
|
||||
License: GPL-2.0-or-later AND LGPL-2.1-only AND LGPL-2.1-or-later AND OFL-1.1
|
||||
URL: https://libvirt.org/
|
||||
|
||||
%if %(echo %{version} | grep -q "\.0$"; echo $?) == 1
|
||||
@ -238,38 +238,6 @@ URL: https://libvirt.org/
|
||||
%endif
|
||||
Source: https://libvirt.org/sources/%{?mainturl}libvirt-%{version}.tar.xz
|
||||
Source1: symlinks
|
||||
Patch1: libvirt-vircgroupv2-fix-cpu.weight-limits-check.patch
|
||||
Patch2: libvirt-domain_validate-drop-cpu.shares-cgroup-check.patch
|
||||
Patch3: libvirt-docs-document-correct-cpu-shares-limits-with-both-cgroups-v1-and-v2.patch
|
||||
Patch4: libvirt-qemu_interface-Fix-managed-no-case-when-creating-an-ethernet-interface.patch
|
||||
Patch5: libvirt-conf-clarify-some-external-TPM-error-messages.patch
|
||||
Patch6: libvirt-qemu-hotplug-Remove-legacy-quirk-for-dimm-address-generation.patch
|
||||
Patch7: libvirt-qemu-alias-Remove-oldAlias-argument-of-qemuAssignDeviceMemoryAlias.patch
|
||||
Patch8: libvirt-qemu-Remove-memAliasOrderMismatch-field-from-VM-private-data.patch
|
||||
Patch9: libvirt-rpc-Fix-error-message-in-virNetServerSetClientLimits.patch
|
||||
Patch10: libvirt-src-Don-t-use-virReportSystemError-on-virProcessGetStatInfo-failure.patch
|
||||
Patch11: libvirt-qemu-Provide-virDomainGetCPUStats-implementation-for-session-connection.patch
|
||||
Patch12: libvirt-virsh-Make-domif-setlink-work-more-than-once.patch
|
||||
Patch13: libvirt-qemu_fd-Remove-declaration-for-qemuFDPassNewDirect.patch
|
||||
Patch14: libvirt-qemuStorageSourcePrivateDataFormat-Rename-tmp-to-objectsChildBuf.patch
|
||||
Patch15: libvirt-qemu-command-Handle-FD-passing-commandline-via-qemuBuildBlockStorageSourceAttachDataCommandline.patch
|
||||
Patch16: libvirt-qemuFDPassTransferCommand-Mark-that-FD-was-passed.patch
|
||||
Patch17: libvirt-qemu-fd-Add-helpers-allowing-storing-FD-set-data-in-status-XML.patch
|
||||
Patch18: libvirt-qemu-domain-Store-fdset-ID-for-disks-passed-to-qemu-via-FD.patch
|
||||
Patch19: libvirt-qemu-block-Properly-handle-FD-passed-disk-hot-un-plug.patch
|
||||
Patch20: libvirt-qemuProcessStop-Fix-detection-of-outgoing-migration-for-external-devices.patch
|
||||
Patch21: libvirt-qemuExtTPMStop-Restore-TPM-state-label-more-often.patch
|
||||
Patch22: libvirt-qemuProcessLaunch-Tighten-rules-for-external-devices-wrt-incoming-migration.patch
|
||||
Patch23: libvirt-qemu_process-Produce-better-debug-message-wrt-domain-namespaces.patch
|
||||
Patch24: libvirt-qemu_namespace-Deal-with-nested-mounts-when-umount-ing-dev.patch
|
||||
Patch25: libvirt-qemuProcessRefreshDisks-Don-t-skip-filling-of-disk-information-if-tray-state-didn-t-change.patch
|
||||
Patch26: libvirt-qemu_extdevice-Do-cleanup-host-only-for-VIR_DOMAIN_TPM_TYPE_EMULATOR.patch
|
||||
Patch27: libvirt-qemu-blockjob-Handle-pending-blockjob-state-only-when-we-need-it.patch
|
||||
Patch28: libvirt-rpc-client-Don-t-check-return-value-of-virNetMessageNew.patch
|
||||
Patch29: libvirt-rpc-Don-t-warn-about-max_client_requests-in-single-threaded-daemons.patch
|
||||
Patch30: libvirt-qemu_snapshot-remove-memory-snapshot-when-deleting-external-snapshot.patch
|
||||
Patch31: libvirt-qemu_snapshot-refactor-qemuSnapshotDeleteExternalPrepare.patch
|
||||
|
||||
|
||||
Requires: libvirt-daemon = %{version}-%{release}
|
||||
Requires: libvirt-daemon-config-network = %{version}-%{release}
|
||||
@ -465,19 +433,25 @@ Summary: Server side daemon and supporting files for libvirt library
|
||||
|
||||
# The client side, i.e. shared libs are in a subpackage
|
||||
Requires: libvirt-libs = %{version}-%{release}
|
||||
Requires: libvirt-daemon-common = %{version}-%{release}
|
||||
Requires: libvirt-daemon-lock = %{version}-%{release}
|
||||
Requires: libvirt-daemon-plugin-lockd = %{version}-%{release}
|
||||
Requires: libvirt-daemon-log = %{version}-%{release}
|
||||
Requires: libvirt-daemon-proxy = %{version}-%{release}
|
||||
|
||||
%description daemon
|
||||
Server side daemon required to manage the virtualization capabilities
|
||||
of recent versions of Linux. Requires a hypervisor specific sub-RPM
|
||||
for specific drivers.
|
||||
|
||||
%package daemon-common
|
||||
Summary: Files and utilities used by daemons
|
||||
Requires: libvirt-libs = %{version}-%{release}
|
||||
# The libvirt-guests.sh script requires virsh from libvirt-client subpackage,
|
||||
# but not every deployment wants to use libvirt-guests service. Using
|
||||
# Recommends here will install libvirt-client by default (if available), but
|
||||
# RPM won't complain if the package is unavailable, masked, or removed later.
|
||||
Recommends: libvirt-client = %{version}-%{release}
|
||||
# netcat is needed on the server side so that clients that have
|
||||
# libvirt < 6.9.0 can connect, but newer versions will prefer
|
||||
# virt-ssh-helper. Making this a Recommends means that it gets
|
||||
# installed by default, but can still be removed if compatibility
|
||||
# with old clients is not required
|
||||
Recommends: /usr/bin/nc
|
||||
# for modprobe of pci devices
|
||||
Requires: module-init-tools
|
||||
# for /sbin/ip
|
||||
Requires: iproute
|
||||
# for /sbin/tc
|
||||
@ -489,9 +463,6 @@ Requires: dmidecode
|
||||
%endif
|
||||
# For service management
|
||||
Requires(post): /usr/bin/systemctl
|
||||
%if %{with_numad}
|
||||
Requires: numad
|
||||
%endif
|
||||
# libvirtd depends on 'messagebus' service
|
||||
Requires: dbus
|
||||
# For uid creation during pre
|
||||
@ -508,15 +479,50 @@ Obsoletes: libvirt-admin < 7.3.0
|
||||
Provides: libvirt-admin = %{version}-%{release}
|
||||
Obsoletes: libvirt-bash-completion < 7.3.0
|
||||
|
||||
%description daemon
|
||||
Server side daemon required to manage the virtualization capabilities
|
||||
of recent versions of Linux. Requires a hypervisor specific sub-RPM
|
||||
for specific drivers.
|
||||
%description daemon-common
|
||||
Miscellaneous files and utilities used by other libvirt daemons
|
||||
|
||||
%package daemon-lock
|
||||
Summary: Server side daemon for managing locks
|
||||
Requires: libvirt-libs = %{version}-%{release}
|
||||
|
||||
%description daemon-lock
|
||||
Server side daemon used to manage locks held against virtual machine
|
||||
resources
|
||||
|
||||
%package daemon-plugin-lockd
|
||||
Summary: lockd client plugin for virtlockd
|
||||
Requires: libvirt-libs = %{version}-%{release}
|
||||
Requires: libvirt-daemon-lock = %{version}-%{release}
|
||||
|
||||
%description daemon-plugin-lockd
|
||||
A client-side plugin that implements disk locking using POSIX fcntl advisory
|
||||
locks via communication with the virtlockd daemon
|
||||
|
||||
%package daemon-log
|
||||
Summary: Server side daemon for managing logs
|
||||
Requires: libvirt-libs = %{version}-%{release}
|
||||
|
||||
%description daemon-log
|
||||
Server side daemon used to manage logs from virtual machine consoles
|
||||
|
||||
%package daemon-proxy
|
||||
Summary: Server side daemon providing libvirtd proxy
|
||||
Requires: libvirt-libs = %{version}-%{release}
|
||||
# netcat is needed on the server side so that clients that have
|
||||
# libvirt < 6.9.0 can connect, but newer versions will prefer
|
||||
# virt-ssh-helper. Making this a Recommends means that it gets
|
||||
# installed by default, but can still be removed if compatibility
|
||||
# with old clients is not required
|
||||
Recommends: /usr/bin/nc
|
||||
|
||||
%description daemon-proxy
|
||||
Server side daemon providing functionality previously provided by
|
||||
the monolithic libvirtd
|
||||
|
||||
%package daemon-config-network
|
||||
Summary: Default configuration files for the libvirtd daemon
|
||||
|
||||
Requires: libvirt-daemon = %{version}-%{release}
|
||||
Requires: libvirt-daemon-driver-network = %{version}-%{release}
|
||||
|
||||
%description daemon-config-network
|
||||
@ -525,7 +531,6 @@ Default configuration files for setting up NAT based networking
|
||||
%package daemon-config-nwfilter
|
||||
Summary: Network filter configuration files for the libvirtd daemon
|
||||
|
||||
Requires: libvirt-daemon = %{version}-%{release}
|
||||
Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
|
||||
|
||||
%description daemon-config-nwfilter
|
||||
@ -533,7 +538,7 @@ Network filter configuration files for cleaning guest traffic
|
||||
|
||||
%package daemon-driver-network
|
||||
Summary: Network driver plugin for the libvirtd daemon
|
||||
Requires: libvirt-daemon = %{version}-%{release}
|
||||
Requires: libvirt-daemon-common = %{version}-%{release}
|
||||
Requires: libvirt-libs = %{version}-%{release}
|
||||
Requires: dnsmasq >= 2.41
|
||||
Requires: iptables
|
||||
@ -545,7 +550,7 @@ bridge capabilities.
|
||||
|
||||
%package daemon-driver-nwfilter
|
||||
Summary: Nwfilter driver plugin for the libvirtd daemon
|
||||
Requires: libvirt-daemon = %{version}-%{release}
|
||||
Requires: libvirt-daemon-common = %{version}-%{release}
|
||||
Requires: libvirt-libs = %{version}-%{release}
|
||||
Requires: iptables
|
||||
Requires: ebtables
|
||||
@ -557,12 +562,14 @@ iptables and ip6tables capabilities
|
||||
|
||||
%package daemon-driver-nodedev
|
||||
Summary: Nodedev driver plugin for the libvirtd daemon
|
||||
Requires: libvirt-daemon = %{version}-%{release}
|
||||
Requires: libvirt-daemon-common = %{version}-%{release}
|
||||
Requires: libvirt-libs = %{version}-%{release}
|
||||
# needed for device enumeration
|
||||
Requires: systemd >= 185
|
||||
# For managing persistent mediated devices
|
||||
Requires: mdevctl
|
||||
# for modprobe of pci devices
|
||||
Requires: module-init-tools
|
||||
|
||||
%description daemon-driver-nodedev
|
||||
The nodedev driver plugin for the libvirtd daemon, providing
|
||||
@ -571,7 +578,7 @@ capabilities.
|
||||
|
||||
%package daemon-driver-interface
|
||||
Summary: Interface driver plugin for the libvirtd daemon
|
||||
Requires: libvirt-daemon = %{version}-%{release}
|
||||
Requires: libvirt-daemon-common = %{version}-%{release}
|
||||
Requires: libvirt-libs = %{version}-%{release}
|
||||
%if %{with_netcf}
|
||||
Requires: netcf-libs >= 0.2.2
|
||||
@ -583,7 +590,7 @@ an implementation of the host network interface APIs.
|
||||
|
||||
%package daemon-driver-secret
|
||||
Summary: Secret driver plugin for the libvirtd daemon
|
||||
Requires: libvirt-daemon = %{version}-%{release}
|
||||
Requires: libvirt-daemon-common = %{version}-%{release}
|
||||
Requires: libvirt-libs = %{version}-%{release}
|
||||
|
||||
%description daemon-driver-secret
|
||||
@ -592,7 +599,7 @@ an implementation of the secret key APIs.
|
||||
|
||||
%package daemon-driver-storage-core
|
||||
Summary: Storage driver plugin including base backends for the libvirtd daemon
|
||||
Requires: libvirt-daemon = %{version}-%{release}
|
||||
Requires: libvirt-daemon-common = %{version}-%{release}
|
||||
Requires: libvirt-libs = %{version}-%{release}
|
||||
Requires: nfs-utils
|
||||
# For mkfs
|
||||
@ -743,7 +750,8 @@ parted and more.
|
||||
%if %{with_qemu}
|
||||
%package daemon-driver-qemu
|
||||
Summary: QEMU driver plugin for the libvirtd daemon
|
||||
Requires: libvirt-daemon = %{version}-%{release}
|
||||
Requires: libvirt-daemon-common = %{version}-%{release}
|
||||
Requires: libvirt-daemon-log = %{version}-%{release}
|
||||
Requires: libvirt-libs = %{version}-%{release}
|
||||
Requires: /usr/bin/qemu-img
|
||||
# For image compression
|
||||
@ -753,6 +761,9 @@ Requires: lzop
|
||||
Requires: xz
|
||||
Requires: systemd-container
|
||||
Requires: swtpm-tools
|
||||
%if %{with_numad}
|
||||
Requires: numad
|
||||
%endif
|
||||
%if (0%{?fedora} >= 36) || (0%{?rhel} >= 9)
|
||||
Recommends: passt
|
||||
%endif
|
||||
@ -766,11 +777,16 @@ QEMU
|
||||
%if %{with_lxc}
|
||||
%package daemon-driver-lxc
|
||||
Summary: LXC driver plugin for the libvirtd daemon
|
||||
Requires: libvirt-daemon = %{version}-%{release}
|
||||
Requires: libvirt-daemon-common = %{version}-%{release}
|
||||
Requires: libvirt-libs = %{version}-%{release}
|
||||
# There really is a hard cross-driver dependency here
|
||||
Requires: libvirt-daemon-driver-network = %{version}-%{release}
|
||||
Requires: systemd-container
|
||||
# for modprobe of nbd driver
|
||||
Requires: module-init-tools
|
||||
%if %{with_numad}
|
||||
Requires: numad
|
||||
%endif
|
||||
|
||||
%description daemon-driver-lxc
|
||||
The LXC driver plugin for the libvirtd daemon, providing
|
||||
@ -781,7 +797,7 @@ the Linux kernel
|
||||
%if %{with_vbox}
|
||||
%package daemon-driver-vbox
|
||||
Summary: VirtualBox driver plugin for the libvirtd daemon
|
||||
Requires: libvirt-daemon = %{version}-%{release}
|
||||
Requires: libvirt-daemon-common = %{version}-%{release}
|
||||
Requires: libvirt-libs = %{version}-%{release}
|
||||
|
||||
%description daemon-driver-vbox
|
||||
@ -793,7 +809,7 @@ VirtualBox
|
||||
%if %{with_libxl}
|
||||
%package daemon-driver-libxl
|
||||
Summary: Libxl driver plugin for the libvirtd daemon
|
||||
Requires: libvirt-daemon = %{version}-%{release}
|
||||
Requires: libvirt-daemon-common = %{version}-%{release}
|
||||
Requires: libvirt-libs = %{version}-%{release}
|
||||
Obsoletes: libvirt-daemon-driver-xen < 4.3.0
|
||||
|
||||
@ -807,7 +823,15 @@ Libxl
|
||||
%package daemon-qemu
|
||||
Summary: Server side daemon & driver required to run QEMU guests
|
||||
|
||||
%if %{with_modular_daemons}
|
||||
Requires: libvirt-daemon-common = %{version}-%{release}
|
||||
Requires: libvirt-daemon-log = %{version}-%{release}
|
||||
Requires: libvirt-daemon-lock = %{version}-%{release}
|
||||
Requires: libvirt-daemon-plugin-lockd = %{version}-%{release}
|
||||
Requires: libvirt-daemon-proxy = %{version}-%{release}
|
||||
%else
|
||||
Requires: libvirt-daemon = %{version}-%{release}
|
||||
%endif
|
||||
Requires: libvirt-daemon-driver-qemu = %{version}-%{release}
|
||||
Requires: libvirt-daemon-driver-interface = %{version}-%{release}
|
||||
Requires: libvirt-daemon-driver-network = %{version}-%{release}
|
||||
@ -826,7 +850,15 @@ capabilities of the QEMU TCG emulators
|
||||
%package daemon-kvm
|
||||
Summary: Server side daemon & driver required to run KVM guests
|
||||
|
||||
%if %{with_modular_daemons}
|
||||
Requires: libvirt-daemon-common = %{version}-%{release}
|
||||
Requires: libvirt-daemon-log = %{version}-%{release}
|
||||
Requires: libvirt-daemon-lock = %{version}-%{release}
|
||||
Requires: libvirt-daemon-plugin-lockd = %{version}-%{release}
|
||||
Requires: libvirt-daemon-proxy = %{version}-%{release}
|
||||
%else
|
||||
Requires: libvirt-daemon = %{version}-%{release}
|
||||
%endif
|
||||
Requires: libvirt-daemon-driver-qemu = %{version}-%{release}
|
||||
Requires: libvirt-daemon-driver-interface = %{version}-%{release}
|
||||
Requires: libvirt-daemon-driver-network = %{version}-%{release}
|
||||
@ -845,7 +877,12 @@ capabilities of the KVM hypervisor
|
||||
%package daemon-lxc
|
||||
Summary: Server side daemon & driver required to run LXC guests
|
||||
|
||||
%if %{with_modular_daemons}
|
||||
Requires: libvirt-daemon-common = %{version}-%{release}
|
||||
Requires: libvirt-daemon-proxy = %{version}-%{release}
|
||||
%else
|
||||
Requires: libvirt-daemon = %{version}-%{release}
|
||||
%endif
|
||||
Requires: libvirt-daemon-driver-lxc = %{version}-%{release}
|
||||
Requires: libvirt-daemon-driver-interface = %{version}-%{release}
|
||||
Requires: libvirt-daemon-driver-network = %{version}-%{release}
|
||||
@ -863,7 +900,14 @@ capabilities of LXC
|
||||
%package daemon-xen
|
||||
Summary: Server side daemon & driver required to run XEN guests
|
||||
|
||||
%if %{with_modular_daemons}
|
||||
Requires: libvirt-daemon-common = %{version}-%{release}
|
||||
Requires: libvirt-daemon-lock = %{version}-%{release}
|
||||
Requires: libvirt-daemon-plugin-lockd = %{version}-%{release}
|
||||
Requires: libvirt-daemon-proxy = %{version}-%{release}
|
||||
%else
|
||||
Requires: libvirt-daemon = %{version}-%{release}
|
||||
%endif
|
||||
Requires: libvirt-daemon-driver-libxl = %{version}-%{release}
|
||||
Requires: libvirt-daemon-driver-interface = %{version}-%{release}
|
||||
Requires: libvirt-daemon-driver-network = %{version}-%{release}
|
||||
@ -882,7 +926,12 @@ capabilities of XEN
|
||||
%package daemon-vbox
|
||||
Summary: Server side daemon & driver required to run VirtualBox guests
|
||||
|
||||
%if %{with_modular_daemons}
|
||||
Requires: libvirt-daemon-common = %{version}-%{release}
|
||||
Requires: libvirt-daemon-proxy = %{version}-%{release}
|
||||
%else
|
||||
Requires: libvirt-daemon = %{version}-%{release}
|
||||
%endif
|
||||
Requires: libvirt-daemon-driver-vbox = %{version}-%{release}
|
||||
Requires: libvirt-daemon-driver-interface = %{version}-%{release}
|
||||
Requires: libvirt-daemon-driver-network = %{version}-%{release}
|
||||
@ -913,6 +962,8 @@ capabilities of recent versions of Linux (and other OSes).
|
||||
Summary: Additional client side utilities for QEMU
|
||||
Requires: libvirt-libs = %{version}-%{release}
|
||||
Requires: python3-libvirt >= 3.7.0
|
||||
Requires: python3-cryptography
|
||||
Requires: python3-lxml
|
||||
|
||||
%description client-qemu
|
||||
The additional client binaries are used to interact
|
||||
@ -959,15 +1010,16 @@ Requires: pkgconfig
|
||||
Include header files & development libraries for the libvirt C library.
|
||||
|
||||
%if %{with_sanlock}
|
||||
%package lock-sanlock
|
||||
%package daemon-plugin-sanlock
|
||||
Summary: Sanlock lock manager plugin for QEMU driver
|
||||
Requires: sanlock >= 2.4
|
||||
#for virt-sanlock-cleanup require augeas
|
||||
Requires: augeas
|
||||
Requires: libvirt-daemon = %{version}-%{release}
|
||||
Requires: libvirt-libs = %{version}-%{release}
|
||||
Obsoletes: libvirt-lock-sanlock < 9.1.0
|
||||
Provides: libvirt-lock-sanlock = %{version}-%{release}
|
||||
|
||||
%description lock-sanlock
|
||||
%description daemon-plugin-sanlock
|
||||
Includes the Sanlock lock manager plugin for the QEMU
|
||||
driver
|
||||
%endif
|
||||
@ -1448,40 +1500,19 @@ fi \
|
||||
%define libvirt_daemon_systemd_preun_priv() %systemd_preun %1.service %1-admin.socket %1.socket
|
||||
|
||||
%pre daemon
|
||||
%libvirt_sysconfig_pre libvirtd virtproxyd virtlogd virtlockd libvirt-guests
|
||||
# 'libvirt' group is just to allow password-less polkit access to
|
||||
# libvirtd. The uid number is irrelevant, so we use dynamic allocation
|
||||
# described at the above link.
|
||||
getent group libvirt >/dev/null || groupadd -r libvirt
|
||||
exit 0
|
||||
%libvirt_sysconfig_pre libvirtd
|
||||
|
||||
%post daemon
|
||||
%libvirt_daemon_systemd_post_priv virtlogd
|
||||
%libvirt_daemon_systemd_post_priv virtlockd
|
||||
%if %{with_modular_daemons}
|
||||
%libvirt_daemon_systemd_post_inet virtproxyd
|
||||
%else
|
||||
%if ! %{with_modular_daemons}
|
||||
%libvirt_daemon_systemd_post_inet libvirtd
|
||||
%endif
|
||||
%systemd_post libvirt-guests.service
|
||||
%libvirt_daemon_schedule_restart libvirtd
|
||||
|
||||
%preun daemon
|
||||
%systemd_preun libvirt-guests.service
|
||||
%libvirt_daemon_systemd_preun_inet libvirtd
|
||||
%libvirt_daemon_systemd_preun_inet virtproxyd
|
||||
%libvirt_daemon_systemd_preun_priv virtlogd
|
||||
%libvirt_daemon_systemd_preun_priv virtlockd
|
||||
|
||||
%postun daemon
|
||||
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
|
||||
if [ $1 -ge 1 ] ; then
|
||||
/bin/systemctl reload-or-try-restart virtlockd.service virtlogd.service >/dev/null 2>&1 || :
|
||||
fi
|
||||
%systemd_postun libvirt-guests.service
|
||||
|
||||
%posttrans daemon
|
||||
%libvirt_sysconfig_posttrans libvirtd virtproxyd virtlogd virtlockd libvirt-guests
|
||||
%libvirt_sysconfig_posttrans libvirtd
|
||||
if test %libvirt_daemon_needs_restart libvirtd
|
||||
then
|
||||
# See if user has previously modified their install to
|
||||
@ -1516,6 +1547,76 @@ then
|
||||
fi
|
||||
%libvirt_daemon_finish_restart libvirtd
|
||||
|
||||
%pre daemon-common
|
||||
%libvirt_sysconfig_pre libvirt-guests
|
||||
# 'libvirt' group is just to allow password-less polkit access to libvirt
|
||||
# daemons. The uid number is irrelevant, so we use dynamic allocation.
|
||||
getent group libvirt >/dev/null || groupadd -r libvirt
|
||||
exit 0
|
||||
|
||||
%post daemon-common
|
||||
%systemd_post libvirt-guests.service
|
||||
|
||||
%preun daemon-common
|
||||
%systemd_preun libvirt-guests.service
|
||||
|
||||
%postun daemon-common
|
||||
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
|
||||
%systemd_postun libvirt-guests.service
|
||||
|
||||
%posttrans daemon-common
|
||||
%libvirt_sysconfig_posttrans libvirt-guests
|
||||
|
||||
%pre daemon-lock
|
||||
%libvirt_sysconfig_pre virtlockd
|
||||
|
||||
%post daemon-lock
|
||||
%libvirt_daemon_systemd_post_priv virtlockd
|
||||
|
||||
%preun daemon-lock
|
||||
%libvirt_daemon_systemd_preun_priv virtlockd
|
||||
|
||||
%postun daemon-lock
|
||||
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
|
||||
if [ $1 -ge 1 ] ; then
|
||||
/bin/systemctl reload-or-try-restart virtlockd.service >/dev/null 2>&1 || :
|
||||
fi
|
||||
|
||||
%posttrans daemon-lock
|
||||
%libvirt_sysconfig_posttrans virtlockd
|
||||
|
||||
%pre daemon-log
|
||||
%libvirt_sysconfig_pre virtlogd
|
||||
|
||||
%post daemon-log
|
||||
%libvirt_daemon_systemd_post_priv virtlogd
|
||||
|
||||
%preun daemon-log
|
||||
%libvirt_daemon_systemd_preun_priv virtlogd
|
||||
|
||||
%postun daemon-log
|
||||
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
|
||||
if [ $1 -ge 1 ] ; then
|
||||
/bin/systemctl reload-or-try-restart virtlogd.service >/dev/null 2>&1 || :
|
||||
fi
|
||||
|
||||
%posttrans daemon-log
|
||||
%libvirt_sysconfig_posttrans virtlogd
|
||||
|
||||
%pre daemon-proxy
|
||||
%libvirt_sysconfig_pre virtproxyd
|
||||
|
||||
%post daemon-proxy
|
||||
%if %{with_modular_daemons}
|
||||
%libvirt_daemon_systemd_post_inet virtproxyd
|
||||
%endif
|
||||
|
||||
%preun daemon-proxy
|
||||
%libvirt_daemon_systemd_preun_inet virtproxyd
|
||||
|
||||
%posttrans daemon-proxy
|
||||
%libvirt_sysconfig_posttrans virtproxyd
|
||||
|
||||
%pre daemon-driver-network
|
||||
%libvirt_sysconfig_pre virtnetworkd
|
||||
|
||||
@ -1787,27 +1888,18 @@ exit 0
|
||||
%{_unitdir}/libvirtd-admin.socket
|
||||
%{_unitdir}/libvirtd-tcp.socket
|
||||
%{_unitdir}/libvirtd-tls.socket
|
||||
%{_unitdir}/virtproxyd.service
|
||||
%{_unitdir}/virtproxyd.socket
|
||||
%{_unitdir}/virtproxyd-ro.socket
|
||||
%{_unitdir}/virtproxyd-admin.socket
|
||||
%{_unitdir}/virtproxyd-tcp.socket
|
||||
%{_unitdir}/virtproxyd-tls.socket
|
||||
%{_unitdir}/virt-guest-shutdown.target
|
||||
%{_unitdir}/virtlogd.service
|
||||
%{_unitdir}/virtlogd.socket
|
||||
%{_unitdir}/virtlogd-admin.socket
|
||||
%{_unitdir}/virtlockd.service
|
||||
%{_unitdir}/virtlockd.socket
|
||||
%{_unitdir}/virtlockd-admin.socket
|
||||
%{_unitdir}/libvirt-guests.service
|
||||
%config(noreplace) %{_sysconfdir}/libvirt/libvirtd.conf
|
||||
%config(noreplace) %{_sysconfdir}/libvirt/virtproxyd.conf
|
||||
%config(noreplace) %{_sysconfdir}/libvirt/virtlogd.conf
|
||||
%config(noreplace) %{_sysconfdir}/libvirt/virtlockd.conf
|
||||
%config(noreplace) %{_sysconfdir}/sasl2/libvirt.conf
|
||||
%config(noreplace) %{_prefix}/lib/sysctl.d/60-libvirtd.conf
|
||||
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd
|
||||
%{_datadir}/augeas/lenses/libvirtd.aug
|
||||
%{_datadir}/augeas/lenses/tests/test_libvirtd.aug
|
||||
%attr(0755, root, root) %{_sbindir}/libvirtd
|
||||
%{_mandir}/man8/libvirtd.8*
|
||||
|
||||
%files daemon-common
|
||||
%{_unitdir}/virt-guest-shutdown.target
|
||||
%{_unitdir}/libvirt-guests.service
|
||||
%config(noreplace) %{_sysconfdir}/sasl2/libvirt.conf
|
||||
%dir %{_datadir}/libvirt/
|
||||
%ghost %dir %{_rundir}/libvirt/
|
||||
%ghost %dir %{_rundir}/libvirt/common/
|
||||
@ -1818,45 +1910,64 @@ exit 0
|
||||
%dir %attr(0711, root, root) %{_localstatedir}/cache/libvirt/
|
||||
%dir %attr(0755, root, root) %{_libdir}/libvirt/
|
||||
%dir %attr(0755, root, root) %{_libdir}/libvirt/connection-driver/
|
||||
%dir %attr(0755, root, root) %{_libdir}/libvirt/lock-driver/
|
||||
%dir %attr(0755, root, root) %{_libdir}/libvirt/storage-backend/
|
||||
%dir %attr(0755, root, root) %{_libdir}/libvirt/storage-file/
|
||||
%attr(0755, root, root) %{_libdir}/libvirt/lock-driver/lockd.so
|
||||
%{_datadir}/augeas/lenses/libvirtd.aug
|
||||
%{_datadir}/augeas/lenses/tests/test_libvirtd.aug
|
||||
%{_datadir}/augeas/lenses/virtlogd.aug
|
||||
%{_datadir}/augeas/lenses/tests/test_virtlogd.aug
|
||||
%{_datadir}/augeas/lenses/virtlockd.aug
|
||||
%{_datadir}/augeas/lenses/tests/test_virtlockd.aug
|
||||
%{_datadir}/augeas/lenses/virtproxyd.aug
|
||||
%{_datadir}/augeas/lenses/tests/test_virtproxyd.aug
|
||||
%{_datadir}/augeas/lenses/libvirt_lockd.aug
|
||||
%if %{with_qemu}
|
||||
%{_datadir}/augeas/lenses/tests/test_libvirt_lockd.aug
|
||||
%endif
|
||||
%{_datadir}/polkit-1/actions/org.libvirt.unix.policy
|
||||
%{_datadir}/polkit-1/actions/org.libvirt.api.policy
|
||||
%{_datadir}/polkit-1/rules.d/50-libvirt.rules
|
||||
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/
|
||||
%attr(0755, root, root) %{_libexecdir}/libvirt_iohelper
|
||||
%attr(0755, root, root) %{_bindir}/virt-ssh-helper
|
||||
%attr(0755, root, root) %{_sbindir}/libvirtd
|
||||
%attr(0755, root, root) %{_sbindir}/virtproxyd
|
||||
%attr(0755, root, root) %{_sbindir}/virtlogd
|
||||
%attr(0755, root, root) %{_sbindir}/virtlockd
|
||||
%attr(0755, root, root) %{_libexecdir}/libvirt-guests.sh
|
||||
%{_mandir}/man1/virt-admin.1*
|
||||
%{_mandir}/man1/virt-host-validate.1*
|
||||
%{_mandir}/man8/virt-ssh-helper.8*
|
||||
%{_mandir}/man8/libvirt-guests.8*
|
||||
%{_mandir}/man8/libvirtd.8*
|
||||
%{_mandir}/man8/virtlogd.8*
|
||||
%{_mandir}/man8/virtlockd.8*
|
||||
%{_mandir}/man8/virtproxyd.8*
|
||||
%{_bindir}/virt-host-validate
|
||||
%{_bindir}/virt-admin
|
||||
%{_datadir}/bash-completion/completions/virt-admin
|
||||
|
||||
%files daemon-lock
|
||||
%{_unitdir}/virtlockd.service
|
||||
%{_unitdir}/virtlockd.socket
|
||||
%{_unitdir}/virtlockd-admin.socket
|
||||
%config(noreplace) %{_sysconfdir}/libvirt/virtlockd.conf
|
||||
%{_datadir}/augeas/lenses/virtlockd.aug
|
||||
%{_datadir}/augeas/lenses/tests/test_virtlockd.aug
|
||||
%{_datadir}/augeas/lenses/libvirt_lockd.aug
|
||||
%if %{with_qemu}
|
||||
%{_datadir}/augeas/lenses/tests/test_libvirt_lockd.aug
|
||||
%endif
|
||||
%attr(0755, root, root) %{_sbindir}/virtlockd
|
||||
%{_mandir}/man8/virtlockd.8*
|
||||
|
||||
%files daemon-plugin-lockd
|
||||
%dir %attr(0755, root, root) %{_libdir}/libvirt/lock-driver/
|
||||
%attr(0755, root, root) %{_libdir}/libvirt/lock-driver/lockd.so
|
||||
|
||||
%files daemon-log
|
||||
%{_unitdir}/virtlogd.service
|
||||
%{_unitdir}/virtlogd.socket
|
||||
%{_unitdir}/virtlogd-admin.socket
|
||||
%config(noreplace) %{_sysconfdir}/libvirt/virtlogd.conf
|
||||
%{_datadir}/augeas/lenses/virtlogd.aug
|
||||
%{_datadir}/augeas/lenses/tests/test_virtlogd.aug
|
||||
%attr(0755, root, root) %{_sbindir}/virtlogd
|
||||
%{_mandir}/man8/virtlogd.8*
|
||||
|
||||
%files daemon-proxy
|
||||
%{_unitdir}/virtproxyd.service
|
||||
%{_unitdir}/virtproxyd.socket
|
||||
%{_unitdir}/virtproxyd-ro.socket
|
||||
%{_unitdir}/virtproxyd-admin.socket
|
||||
%{_unitdir}/virtproxyd-tcp.socket
|
||||
%{_unitdir}/virtproxyd-tls.socket
|
||||
%config(noreplace) %{_sysconfdir}/libvirt/virtproxyd.conf
|
||||
%{_datadir}/augeas/lenses/virtproxyd.aug
|
||||
%{_datadir}/augeas/lenses/tests/test_virtproxyd.aug
|
||||
%attr(0755, root, root) %{_sbindir}/virtproxyd
|
||||
%{_mandir}/man8/virtproxyd.8*
|
||||
|
||||
%files daemon-config-network
|
||||
%dir %{_datadir}/libvirt/networks/
|
||||
%{_datadir}/libvirt/networks/default.xml
|
||||
@ -2135,13 +2246,14 @@ exit 0
|
||||
%endif
|
||||
|
||||
%if %{with_sanlock}
|
||||
%files lock-sanlock
|
||||
%files daemon-plugin-sanlock
|
||||
%if %{with_qemu}
|
||||
%config(noreplace) %{_sysconfdir}/libvirt/qemu-sanlock.conf
|
||||
%endif
|
||||
%if %{with_libxl}
|
||||
%config(noreplace) %{_sysconfdir}/libvirt/libxl-sanlock.conf
|
||||
%endif
|
||||
%dir %attr(0755, root, root) %{_libdir}/libvirt/lock-driver/
|
||||
%attr(0755, root, root) %{_libdir}/libvirt/lock-driver/sanlock.so
|
||||
%{_datadir}/augeas/lenses/libvirt_sanlock.aug
|
||||
%{_datadir}/augeas/lenses/tests/test_libvirt_sanlock.aug
|
||||
@ -2359,6 +2471,11 @@ exit 0
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Mon Mar 13 2023 Jiri Denemark <jdenemar@redhat.com> - 9.1.0-1
|
||||
- Rebased to libvirt-9.1.0 (rhbz#2175785)
|
||||
- The rebase also fixes the following bugs:
|
||||
rhbz#2004850, rhbz#2137346, rhbz#2166235, rhbz#1961326
|
||||
|
||||
* Wed Feb 22 2023 Jiri Denemark <jdenemar@redhat.com> - 9.0.0-7
|
||||
- qemu_snapshot: remove memory snapshot when deleting external snapshot (rhbz#2170826)
|
||||
- qemu_snapshot: refactor qemuSnapshotDeleteExternalPrepare (rhbz#2170826)
|
||||
|
2
sources
2
sources
@ -1 +1 @@
|
||||
SHA512 (libvirt-9.0.0.tar.xz) = 135f690f9fe722161c22579166f10a54d52941a371439165fd0e3d391ca7835049a3bcbff33fc81c50153046230db8a5a318d707383bad3141d489d2faa09ecb
|
||||
SHA512 (libvirt-9.1.0.tar.xz) = f4c11ef4e5d29ffde9b91aed1f4fa466f827471d8cbdf6208b54e58b9f1f5cd8dd4fe8ca128aeea1d984f42f47b1ed7d99bbf2a5bb7264ab3943641310f36cd6
|
||||
|
3
symlinks
3
symlinks
@ -1,5 +1,6 @@
|
||||
.ctags.d/libvirt.ctags ../.ctags
|
||||
tests/virt-admin-self-test ./virsh-self-test
|
||||
tests/chxml2xmlout/basic.xml ../chxml2xmlin/basic.xml
|
||||
tests/genericxml2xmloutdata/device-backenddomain.xml ../genericxml2xmlindata/device-backenddomain.xml
|
||||
tests/networkxml2xmlin/leasetime-hours.xml ../networkxml2confdata/leasetime-hours.xml
|
||||
tests/networkxml2xmlin/leasetime-infinite.xml ../networkxml2confdata/leasetime-infinite.xml
|
||||
@ -147,6 +148,7 @@ tests/qemuxml2xmloutdata/blkdeviotune-max.x86_64-latest.xml ../qemuxml2argvdata/
|
||||
tests/qemuxml2xmloutdata/boot-floppy-q35.xml ../qemuxml2argvdata/boot-floppy-q35.xml
|
||||
tests/qemuxml2xmloutdata/clock-realtime.xml ../qemuxml2argvdata/clock-realtime.xml
|
||||
tests/qemuxml2xmloutdata/clock-timer-armvtimer.aarch64-latest.xml ../qemuxml2argvdata/clock-timer-armvtimer.xml
|
||||
tests/qemuxml2xmloutdata/crypto-builtin.x86_64-latest.xml ../qemuxml2argvdata/crypto-builtin.xml
|
||||
tests/qemuxml2xmloutdata/disk-detect-zeroes.x86_64-latest.xml ../qemuxml2argvdata/disk-detect-zeroes.xml
|
||||
tests/qemuxml2xmloutdata/disk-nvme.x86_64-latest.xml ../qemuxml2argvdata/disk-nvme.xml
|
||||
tests/qemuxml2xmloutdata/disk-virtio-queues.x86_64-latest.xml ../qemuxml2argvdata/disk-virtio-queues.xml
|
||||
@ -200,6 +202,7 @@ tests/qemuxml2xmloutdata/memory-hotplug-nvdimm.xml ../qemuxml2argvdata/memory-ho
|
||||
tests/qemuxml2xmloutdata/memory-hotplug-ppc64-nonuma.xml ../qemuxml2argvdata/memory-hotplug-ppc64-nonuma.xml
|
||||
tests/qemuxml2xmloutdata/memory-hotplug-virtio-mem.x86_64-latest.xml ../qemuxml2argvdata/memory-hotplug-virtio-mem.xml
|
||||
tests/qemuxml2xmloutdata/memory-hotplug-virtio-pmem.x86_64-latest.xml ../qemuxml2argvdata/memory-hotplug-virtio-pmem.xml
|
||||
tests/qemuxml2xmloutdata/net-mtu.xml ../qemuxml2argvdata/net-mtu.xml
|
||||
tests/qemuxml2xmloutdata/net-user-addr.xml ../qemuxml2argvdata/net-user-addr.xml
|
||||
tests/qemuxml2xmloutdata/net-user-passt.xml ../qemuxml2argvdata/net-user-passt.xml
|
||||
tests/qemuxml2xmloutdata/net-virtio-rss.x86_64-latest.xml ../qemuxml2argvdata/net-virtio-rss.xml
|
||||
|
Loading…
Reference in New Issue
Block a user