[PATCH] libvirt-guests: Fix dependency ordering in service file
by Martin Kletzander
After some debugging and discussion with systemd team it turns out we
are misusing the ordering in libvirt-guests.service. That happened
because we want to support both monolithic and modular daemon setups and
on top of that we also want to support socket activation and services
without socket activation. Unfortunately this is impossible to express
in the unit file because of how transactions are handled in systemd when
dependencies are resolved and multiple actions (jobs) are queued. For
explanation from Michal Sekletar see comment #7 in the BZ this patch is
fixing:
https://bugzilla.redhat.com/show_bug.cgi?id=1964855#c7
In order to support all the scenarios this patch also amends the
manpages so that users that are changing the default can also read how
to correct the dependency ordering in libvirt-guests unit file.
Ideally we would also keep the existing configuration during upgrade,
but due to our huge support matrix this seems hardly feasible as it
could introduce even more problems.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
docs/manpages/libvirtd.rst | 14 ++++++++++++++
docs/manpages/virtlxcd.rst | 14 ++++++++++++++
docs/manpages/virtqemud.rst | 14 ++++++++++++++
docs/manpages/virtvboxd.rst | 14 ++++++++++++++
docs/manpages/virtvzd.rst | 14 ++++++++++++++
docs/manpages/virtxend.rst | 14 ++++++++++++++
tools/libvirt-guests.service.in | 6 ------
7 files changed, 84 insertions(+), 6 deletions(-)
diff --git a/docs/manpages/libvirtd.rst b/docs/manpages/libvirtd.rst
index ee72f0838221..1347b9b21042 100644
--- a/docs/manpages/libvirtd.rst
+++ b/docs/manpages/libvirtd.rst
@@ -79,6 +79,20 @@ unit files must be masked:
$ systemctl mask libvirtd.socket libvirtd-ro.socket \
libvirtd-admin.socket libvirtd-tls.socket libvirtd-tcp.socket
+If using libvirt-guests service then the ordering for that service needs to be
+adapted so that it is ordered after the service unit instead of the socket unit.
+Since dependencies and ordering cannot be changed with drop-in overrides, the
+whole libvirt-guests unit file needs to be changed. In order to preserve such
+change copy the installed ``/usr/lib/systemd/system/libvirt-guests.service`` to
+``/etc/systemd/system/libvirt-guests.service`` and make the change there,
+specifically make sure the ``After=`` ordering mentions ``libvirtd.service`` and
+not ``libvirtd.socket``:
+
+::
+
+ [Unit]
+ After=libvirtd.service
+
OPTIONS
=======
diff --git a/docs/manpages/virtlxcd.rst b/docs/manpages/virtlxcd.rst
index 2e9d8fd14bbb..aebc8adb5822 100644
--- a/docs/manpages/virtlxcd.rst
+++ b/docs/manpages/virtlxcd.rst
@@ -60,6 +60,20 @@ unit files must be masked:
$ systemctl mask virtlxcd.socket virtlxcd-ro.socket \
virtlxcd-admin.socket
+If using libvirt-guests service then the ordering for that service needs to be
+adapted so that it is ordered after the service unit instead of the socket unit.
+Since dependencies and ordering cannot be changed with drop-in overrides, the
+whole libvirt-guests unit file needs to be changed. In order to preserve such
+change copy the installed ``/usr/lib/systemd/system/libvirt-guests.service`` to
+``/etc/systemd/system/libvirt-guests.service`` and make the change there,
+specifically make sure the ``After=`` ordering mentions ``virtlxcd.service`` and
+not ``virtlxcd.socket``:
+
+::
+
+ [Unit]
+ After=virtlxcd.service
+
OPTIONS
=======
diff --git a/docs/manpages/virtqemud.rst b/docs/manpages/virtqemud.rst
index ea8d6e3105db..fa9a6ce3755c 100644
--- a/docs/manpages/virtqemud.rst
+++ b/docs/manpages/virtqemud.rst
@@ -60,6 +60,20 @@ unit files must be masked:
$ systemctl mask virtqemud.socket virtqemud-ro.socket \
virtqemud-admin.socket
+If using libvirt-guests service then the ordering for that service needs to be
+adapted so that it is ordered after the service unit instead of the socket unit.
+Since dependencies and ordering cannot be changed with drop-in overrides, the
+whole libvirt-guests unit file needs to be changed. In order to preserve such
+change copy the installed ``/usr/lib/systemd/system/libvirt-guests.service`` to
+``/etc/systemd/system/libvirt-guests.service`` and make the change there,
+specifically make sure the ``After=`` ordering mentions ``virtqemud.service`` and
+not ``virtqemud.socket``:
+
+::
+
+ [Unit]
+ After=virtqemud.service
+
OPTIONS
=======
diff --git a/docs/manpages/virtvboxd.rst b/docs/manpages/virtvboxd.rst
index d7339d99f22b..f90de3451d8d 100644
--- a/docs/manpages/virtvboxd.rst
+++ b/docs/manpages/virtvboxd.rst
@@ -58,6 +58,20 @@ unit files must be masked:
$ systemctl mask virtvboxd.socket virtvboxd-ro.socket \
virtvboxd-admin.socket
+If using libvirt-guests service then the ordering for that service needs to be
+adapted so that it is ordered after the service unit instead of the socket unit.
+Since dependencies and ordering cannot be changed with drop-in overrides, the
+whole libvirt-guests unit file needs to be changed. In order to preserve such
+change copy the installed ``/usr/lib/systemd/system/libvirt-guests.service`` to
+``/etc/systemd/system/libvirt-guests.service`` and make the change there,
+specifically make sure the ``After=`` ordering mentions ``virtvboxd.service`` and
+not ``virtvboxd.socket``:
+
+::
+
+ [Unit]
+ After=virtvboxd.service
+
OPTIONS
=======
diff --git a/docs/manpages/virtvzd.rst b/docs/manpages/virtvzd.rst
index 42dfa263e450..970719aac1d5 100644
--- a/docs/manpages/virtvzd.rst
+++ b/docs/manpages/virtvzd.rst
@@ -60,6 +60,20 @@ unit files must be masked:
$ systemctl mask virtvzd.socket virtvzd-ro.socket \
virtvzd-admin.socket
+If using libvirt-guests service then the ordering for that service needs to be
+adapted so that it is ordered after the service unit instead of the socket unit.
+Since dependencies and ordering cannot be changed with drop-in overrides, the
+whole libvirt-guests unit file needs to be changed. In order to preserve such
+change copy the installed ``/usr/lib/systemd/system/libvirt-guests.service`` to
+``/etc/systemd/system/libvirt-guests.service`` and make the change there,
+specifically make sure the ``After=`` ordering mentions ``virtvzd.service`` and
+not ``virtvzd.socket``:
+
+::
+
+ [Unit]
+ After=virtvzd.service
+
OPTIONS
=======
diff --git a/docs/manpages/virtxend.rst b/docs/manpages/virtxend.rst
index b08346b489d2..cf7685ecc0e6 100644
--- a/docs/manpages/virtxend.rst
+++ b/docs/manpages/virtxend.rst
@@ -60,6 +60,20 @@ unit files must be masked:
$ systemctl mask virtxend.socket virtxend-ro.socket \
virtxend-admin.socket
+If using libvirt-guests service then the ordering for that service needs to be
+adapted so that it is ordered after the service unit instead of the socket unit.
+Since dependencies and ordering cannot be changed with drop-in overrides, the
+whole libvirt-guests unit file needs to be changed. In order to preserve such
+change copy the installed ``/usr/lib/systemd/system/libvirt-guests.service`` to
+``/etc/systemd/system/libvirt-guests.service`` and make the change there,
+specifically make sure the ``After=`` ordering mentions ``virtxend.service`` and
+not ``virtxend.socket``:
+
+::
+
+ [Unit]
+ After=virtxend.service
+
OPTIONS
=======
diff --git a/tools/libvirt-guests.service.in b/tools/libvirt-guests.service.in
index 3cf647619612..1c569c320dfd 100644
--- a/tools/libvirt-guests.service.in
+++ b/tools/libvirt-guests.service.in
@@ -9,12 +9,6 @@ After=virtlxcd.socket
After=virtvboxd.socket
After=virtvzd.socket
After=virtxend.socket
-After=libvirtd.service
-After=virtqemud.service
-After=virtlxcd.service
-After=virtvboxd.service
-After=virtvzd.service
-After=virtxend.service
After=virt-guest-shutdown.target
Documentation=man:libvirt-guests(8)
Documentation=https://libvirt.org
--
2.37.2
2 years, 2 months
[PATCH v2 RESEND] qemu: fix memory leak about virDomainEventTunableNew
by luzhipeng
From: lu zhipeng <luzhipeng(a)cestc.cn>
For prevent memory leak and easier to use, So change
virDomainEventTunableNew to get virTypedParameterPtr *params
and set it = NULL.
Signed-off-by: lu zhipeng <luzhipeng(a)cestc.cn>
---
v1: https://patchew.org/Libvirt/20220922130038.1616-1-luzhipeng@cestc.cn/
src/conf/domain_event.c | 12 ++++++------
src/conf/domain_event.h | 4 ++--
src/qemu/qemu_driver.c | 22 ++++++++++------------
src/remote/remote_driver.c | 2 +-
4 files changed, 19 insertions(+), 21 deletions(-)
diff --git a/src/conf/domain_event.c b/src/conf/domain_event.c
index ff8ea2c389..97d58c2521 100644
--- a/src/conf/domain_event.c
+++ b/src/conf/domain_event.c
@@ -1495,7 +1495,7 @@ static virObjectEvent *
virDomainEventTunableNew(int id,
const char *name,
unsigned char *uuid,
- virTypedParameterPtr params,
+ virTypedParameterPtr *params,
int nparams)
{
virDomainEventTunable *ev;
@@ -1508,19 +1508,19 @@ virDomainEventTunableNew(int id,
id, name, uuid)))
goto error;
- ev->params = params;
+ ev->params = *params;
ev->nparams = nparams;
-
+ *params = NULL;
return (virObjectEvent *)ev;
error:
- virTypedParamsFree(params, nparams);
+ virTypedParamsFree(*params, nparams);
return NULL;
}
virObjectEvent *
virDomainEventTunableNewFromObj(virDomainObj *obj,
- virTypedParameterPtr params,
+ virTypedParameterPtr *params,
int nparams)
{
return virDomainEventTunableNew(obj->def->id,
@@ -1532,7 +1532,7 @@ virDomainEventTunableNewFromObj(virDomainObj *obj,
virObjectEvent *
virDomainEventTunableNewFromDom(virDomainPtr dom,
- virTypedParameterPtr params,
+ virTypedParameterPtr *params,
int nparams)
{
return virDomainEventTunableNew(dom->id,
diff --git a/src/conf/domain_event.h b/src/conf/domain_event.h
index 4a9f6b988b..f4016dc1e9 100644
--- a/src/conf/domain_event.h
+++ b/src/conf/domain_event.h
@@ -195,11 +195,11 @@ virDomainEventDeviceRemovalFailedNewFromDom(virDomainPtr dom,
virObjectEvent *
virDomainEventTunableNewFromObj(virDomainObj *obj,
- virTypedParameterPtr params,
+ virTypedParameterPtr *params,
int nparams);
virObjectEvent *
virDomainEventTunableNewFromDom(virDomainPtr dom,
- virTypedParameterPtr params,
+ virTypedParameterPtr *params,
int nparams);
virObjectEvent *
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 94b70872d4..3db4592945 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -4472,12 +4472,12 @@ qemuDomainPinVcpuLive(virDomainObj *vm,
&eventMaxparams, paramField, str) < 0)
goto cleanup;
- event = virDomainEventTunableNewFromObj(vm, eventParams, eventNparams);
+ event = virDomainEventTunableNewFromObj(vm, &eventParams, eventNparams);
ret = 0;
cleanup:
virObjectEventStateQueue(driver->domainEventState, event);
+ virTypedParamsFree(eventParams, eventNparams);
return ret;
}
@@ -4681,7 +4681,7 @@ qemuDomainPinEmulator(virDomainPtr dom,
str) < 0)
goto endjob;
- event = virDomainEventTunableNewFromDom(dom, eventParams, eventNparams);
+ event = virDomainEventTunableNewFromDom(dom, &eventParams, eventNparams);
}
if (persistentDef) {
@@ -4700,6 +4700,7 @@ qemuDomainPinEmulator(virDomainPtr dom,
cleanup:
virObjectEventStateQueue(driver->domainEventState, event);
virDomainObjEndAPI(&vm);
+ virTypedParamsFree(eventParams, eventNparams);
return ret;
}
@@ -5078,7 +5079,7 @@ qemuDomainPinIOThread(virDomainPtr dom,
&eventMaxparams, paramField, str) < 0)
goto endjob;
- event = virDomainEventTunableNewFromDom(dom, eventParams, eventNparams);
+ event = virDomainEventTunableNewFromDom(dom, &eventParams, eventNparams);
}
if (persistentDef) {
@@ -5106,6 +5107,7 @@ qemuDomainPinIOThread(virDomainPtr dom,
cleanup:
virObjectEventStateQueue(driver->domainEventState, event);
virDomainObjEndAPI(&vm);
+ virTypedParamsFree(eventParams, eventNparams);
return ret;
}
@@ -9633,8 +9635,7 @@ qemuDomainSetSchedulerParametersFlags(virDomainPtr dom,
qemuDomainSaveStatus(vm);
if (eventNparams) {
- event = virDomainEventTunableNewFromDom(dom, eventParams, eventNparams);
- eventNparams = 0;
+ event = virDomainEventTunableNewFromDom(dom, &eventParams, eventNparams);
virObjectEventStateQueue(driver->domainEventState, event);
}
@@ -9654,8 +9655,7 @@ qemuDomainSetSchedulerParametersFlags(virDomainPtr dom,
cleanup:
virDomainObjEndAPI(&vm);
- if (eventNparams)
- virTypedParamsFree(eventParams, eventNparams);
+ virTypedParamsFree(eventParams, eventNparams);
return ret;
}
#undef SCHED_RANGE_CHECK
@@ -16159,8 +16159,7 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
qemuDomainSaveStatus(vm);
if (eventNparams) {
- event = virDomainEventTunableNewFromDom(dom, eventParams, eventNparams);
- eventNparams = 0;
+ event = virDomainEventTunableNewFromDom(dom, &eventParams, eventNparams);
virObjectEventStateQueue(driver->domainEventState, event);
}
}
@@ -16202,8 +16201,7 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
VIR_FREE(info.group_name);
VIR_FREE(conf_info.group_name);
virDomainObjEndAPI(&vm);
- if (eventNparams)
- virTypedParamsFree(eventParams, eventNparams);
+ virTypedParamsFree(eventParams, eventNparams);
return ret;
}
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index a4efe101a3..b0dba9057b 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -5078,7 +5078,7 @@ remoteDomainBuildEventCallbackTunable(virNetClientProgram *prog G_GNUC_UNUSED,
return;
}
- event = virDomainEventTunableNewFromDom(dom, params, nparams);
+ event = virDomainEventTunableNewFromDom(dom, ¶ms, nparams);
virObjectUnref(dom);
--
2.31.1
2 years, 2 months
[PATCH v2] Log alarms should be generated even if the QEMU process is not stopped
by 丁丽敏
If the qemu process is shutdown and flag is set to VIR_QEMU_PROCESS_KILL_NOWAIT,
a log alarm is generated even if the qemu process is not stopped.
Signed-off-by: dinglimin <dinglimin(a)cmss.chinamobile.com>
---
v1:https://www.mail-archive.com/libvir-list@redhat.com/msg232232.html
diff to v1:
- Add the patch 's description.
- Change the code format.
---
src/qemu/qemu_process.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index cbfdd3bda5..d876e345a0 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -8006,9 +8006,11 @@ qemuProcessKill(virDomainObj *vm, unsigned int flags)
}
if (flags & VIR_QEMU_PROCESS_KILL_NOWAIT) {
- virProcessKill(vm->pid,
- (flags & VIR_QEMU_PROCESS_KILL_FORCE) ?
- SIGKILL : SIGTERM);
+ if (virProcessKill(vm->pid,
+ (flags & VIR_QEMU_PROCESS_KILL_FORCE) ?
+ SIGKILL : SIGTERM);) {
+ VIR_DEBUG("Failed to terminate qemu process");
+ }
return 0;
}
--
2.18.4
2 years, 2 months
[PATCH v2] Two branches in a conditional structure should not have exactly the same implementation
by 丁丽敏
Having two branches in the same if structure with
the same implementation is at best duplicate code,
and at worst a coding error.If the same logic is truly
needed for both instances, then they should be combined.
Signed-off-by: dinglimin <dinglimin(a)cmss.chinamobile.com>
---
v1 of:
https://www.mail-archive.com/libvir-list@redhat.com/msg232231.html
diff to v1:
- Add the patch 's description.
- Change the code format.
---
scripts/apibuild.py | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/scripts/apibuild.py b/scripts/apibuild.py
index c232b4e2c8..140916ec4c 100755
--- a/scripts/apibuild.py
+++ b/scripts/apibuild.py
@@ -1248,10 +1248,8 @@ class CParser:
token[1] == "," or token[1] == "="):
self.index_add_ref(oldtok[1], self.filename,
0, "type")
- elif oldtok[0] == "name" and oldtok[1][0:4] == "XEN_":
- self.index_add_ref(oldtok[1], self.filename,
- 0, "typedef")
- elif oldtok[0] == "name" and oldtok[1][0:7] == "LIBXEN_":
+ elif oldtok[0] == "name" and (oldtok[1][0:4] == "XEN_" or
+ oldtok[1][0:7] == "LIBXEN_"):
self.index_add_ref(oldtok[1], self.filename,
0, "typedef")
--
2.18.4
丁丽敏 IaaS产品部
中国移动云能力中心
电话:188-9672-5914
邮箱:dinglimin@cmss.chinamobile.com
江苏省苏州市高新区科技城昆仑山路58号 中移软件园 215153
2 years, 2 months
[PATCH v2] Log alarms should be generated even if the QEMU process is not stopped
by 丁丽敏
If the qemu process is shutdown and flag is set to VIR_QEMU_PROCESS_KILL_NOWAIT,
a log alarm is generated even if the qemu process is not stopped.
Signed-off-by: dinglimin <dinglimin(a)cmss.chinamobile.com>
---
v1:https://www.mail-archive.com/libvir-list@redhat.com/msg232232.html
diff to v1:
- Add the patch 's description.
- Change the code format.
---
src/qemu/qemu_process.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index cbfdd3bda5..d876e345a0 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -8006,9 +8006,11 @@ qemuProcessKill(virDomainObj *vm, unsigned int flags)
}
if (flags & VIR_QEMU_PROCESS_KILL_NOWAIT) {
- virProcessKill(vm->pid,
- (flags & VIR_QEMU_PROCESS_KILL_FORCE) ?
- SIGKILL : SIGTERM);
+ if (virProcessKill(vm->pid,
+ (flags & VIR_QEMU_PROCESS_KILL_FORCE) ?
+ SIGKILL : SIGTERM);) {
+ VIR_DEBUG("Failed to terminate qemu process");
+ }
return 0;
}
--
2.18.4
2 years, 2 months
[PATCH v2] cpu_map: Introduce Neoverse N1/N2/V1
by Zhenyu Zhang
Add Neoverse N1/N2/V1 as a supported cpu model.
Signed-off-by: Zhenyu Zhang <zhenyzha(a)redhat.com>
v1: https://listman.redhat.com/archives/libvir-list/2022-September/234294.html
Changelog
=========
v2:
* Introduce Neoverse N1/N2/V1 (Martin)
* Corrected ampere vendor value (Martin)
---
src/cpu_map/arm_Neoverse-N1.xml | 6 ++++++
src/cpu_map/arm_Neoverse-N2.xml | 0
src/cpu_map/arm_Neoverse-V1.xml | 0
src/cpu_map/arm_vendors.xml | 1 +
src/cpu_map/index.xml | 3 +++
src/cpu_map/meson.build | 1 +
6 files changed, 11 insertions(+)
create mode 100644 src/cpu_map/arm_Neoverse-N1.xml
create mode 100644 src/cpu_map/arm_Neoverse-N2.xml
create mode 100644 src/cpu_map/arm_Neoverse-V1.xml
diff --git a/src/cpu_map/arm_Neoverse-N1.xml b/src/cpu_map/arm_Neoverse-N1.xml
new file mode 100644
index 0000000000..14c7f7c300
--- /dev/null
+++ b/src/cpu_map/arm_Neoverse-N1.xml
@@ -0,0 +1,6 @@
+<cpus>
+ <model name='Neoverse-N1'>
+ <vendor name='Ampere'/>
+ <pvr value='0xd0c'/>
+ </model>
+</cpus>
diff --git a/src/cpu_map/arm_Neoverse-N2.xml b/src/cpu_map/arm_Neoverse-N2.xml
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/src/cpu_map/arm_Neoverse-V1.xml b/src/cpu_map/arm_Neoverse-V1.xml
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/src/cpu_map/arm_vendors.xml b/src/cpu_map/arm_vendors.xml
index 92d10565f4..a9a945584b 100644
--- a/src/cpu_map/arm_vendors.xml
+++ b/src/cpu_map/arm_vendors.xml
@@ -13,4 +13,5 @@
<vendor name='Marvell' value='0x56'/>
<vendor name='Intel' value='0x69'/>
<vendor name='Phytium' value='0x70'/>
+ <vendor name='Ampere' value='0x71'/>
</cpus>
diff --git a/src/cpu_map/index.xml b/src/cpu_map/index.xml
index d533a28865..2419fa0a64 100644
--- a/src/cpu_map/index.xml
+++ b/src/cpu_map/index.xml
@@ -98,6 +98,9 @@
<include filename='arm_cortex-a57.xml'/>
<include filename='arm_cortex-a72.xml'/>
+ <!-- Ampere-based CPU models -->
+ <include filename='arm_neoverse-n1.xml'/>
+
<!-- Qualcomm-based CPU models -->
<include filename='arm_Falkor.xml'/>
diff --git a/src/cpu_map/meson.build b/src/cpu_map/meson.build
index 99264289e2..122bd138d2 100644
--- a/src/cpu_map/meson.build
+++ b/src/cpu_map/meson.build
@@ -7,6 +7,7 @@ cpumap_data = [
'arm_FT-2000plus.xml',
'arm_features.xml',
'arm_Kunpeng-920.xml',
+ 'arm_Neoverse-N1.xml',
'arm_Tengyun-S2500.xml',
'arm_ThunderX299xx.xml',
'arm_vendors.xml',
--
2.31.1
2 years, 2 months
[PATCH] cpu_map: Introduce Neoverse-N1
by Zhenyu Zhang
Add Neoverse-N1 as a supported cpu model.
Signed-off-by: Zhang Zhenyu <zhenyzha(a)redhat.com>
---
src/cpu_map/arm_neoverse-n1.xml | 6 ++++++
src/cpu_map/arm_vendors.xml | 1 +
src/cpu_map/index.xml | 3 +++
src/cpu_map/meson.build | 1 +
4 files changed, 11 insertions(+)
create mode 100644 src/cpu_map/arm_neoverse-n1.xml
diff --git a/src/cpu_map/arm_neoverse-n1.xml b/src/cpu_map/arm_neoverse-n1.xml
new file mode 100644
index 0000000000..14c7f7c300
--- /dev/null
+++ b/src/cpu_map/arm_neoverse-n1.xml
@@ -0,0 +1,6 @@
+<cpus>
+ <model name='Neoverse-N1'>
+ <vendor name='Ampere'/>
+ <pvr value='0xd0c'/>
+ </model>
+</cpus>
diff --git a/src/cpu_map/arm_vendors.xml b/src/cpu_map/arm_vendors.xml
index 92d10565f4..a9a945584b 100644
--- a/src/cpu_map/arm_vendors.xml
+++ b/src/cpu_map/arm_vendors.xml
@@ -13,4 +13,5 @@
<vendor name='Marvell' value='0x56'/>
<vendor name='Intel' value='0x69'/>
<vendor name='Phytium' value='0x70'/>
+ <vendor name='Ampere' value='0x71'/>
</cpus>
diff --git a/src/cpu_map/index.xml b/src/cpu_map/index.xml
index d533a28865..2419fa0a64 100644
--- a/src/cpu_map/index.xml
+++ b/src/cpu_map/index.xml
@@ -98,6 +98,9 @@
<include filename='arm_cortex-a57.xml'/>
<include filename='arm_cortex-a72.xml'/>
+ <!-- Ampere-based CPU models -->
+ <include filename='arm_neoverse-n1.xml'/>
+
<!-- Qualcomm-based CPU models -->
<include filename='arm_Falkor.xml'/>
diff --git a/src/cpu_map/meson.build b/src/cpu_map/meson.build
index 99264289e2..c8f2e36eea 100644
--- a/src/cpu_map/meson.build
+++ b/src/cpu_map/meson.build
@@ -7,6 +7,7 @@ cpumap_data = [
'arm_FT-2000plus.xml',
'arm_features.xml',
'arm_Kunpeng-920.xml',
+ 'arm_neoverse-n1.xml',
'arm_Tengyun-S2500.xml',
'arm_ThunderX299xx.xml',
'arm_vendors.xml',
--
2.31.1
2 years, 2 months
[libvirt PATCH] nodedev: switch to udev 'bind' events
by Jonathon Jongsma
Rather than listening to 'add' udev events, listen for 'bind' events
instead. When we get an 'add' event, the sysfs tree for the device is
often not ready yet. In that case we sleep in a loop until the sysfs
tree appears, or give up after a timeout.
udev added the 'bind' event to give userspace a signal that indicated
when driver-specific attributes were available to be used. In other
words, the sysfs tree *should* be ready and usable at this point.
But just to be safe, we'll leave the wait loop in the code to handle
corner cases, with the hope that it'll never be used.
The udev 'bind' event was added in kernel 4.14 and the oldest platform
we support has kernel 4.18, so it should be safe to make this change.
Previous discussion on the mailing list:
https://listman.redhat.com/archives/libvir-list/2022-August/233933.html
Signed-off-by: Jonathon Jongsma <jjongsma(a)redhat.com>
---
src/node_device/node_device_udev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index 07c10f0d88..781a8b32a6 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -1759,7 +1759,7 @@ udevHandleOneDevice(struct udev_device *device)
VIR_DEBUG("udev action: '%s': %s", action, udev_device_get_syspath(device));
- if (STREQ(action, "add") || STREQ(action, "change"))
+ if (STREQ(action, "bind") || STREQ(action, "change"))
return udevAddOneDevice(device);
if (STREQ(action, "remove"))
--
2.37.2
2 years, 2 months
[PATCH 0/4] qemu_process.c: Propagate hugetlbfs mounts on reconnect
by Michal Privoznik
See 4/4 for full explanation.
Michal Prívozník (4):
qemu_namespace: Tolerate missing ACLs when creating a path in
namespace
qemu_namespace: Fix a corner case in qemuDomainGetPreservedMounts()
qemu_namespace: Introduce qemuDomainNamespaceSetupPath()
qemu_process.c: Propagate hugetlbfs mounts on reconnect
docs/kbase/qemu-passthrough-security.rst | 6 -----
src/qemu/qemu_namespace.c | 32 +++++++++++++++++++++---
src/qemu/qemu_namespace.h | 4 +++
src/qemu/qemu_process.c | 3 +++
4 files changed, 36 insertions(+), 9 deletions(-)
--
2.35.1
2 years, 2 months
[PATCH] qemu_domain: Ignore all but SCSI hostdevs in qemuDomainDeviceHostdevDefPostParseRestoreBackendAlias()
by Michal Privoznik
When retiring QEMU_CAPS_BLOCKDEV_HOSTDEV_SCSI capability the
commit removed a bit too much. Previously, all other devices than
VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI were ignored in
qemuDomainDeviceHostdevDefPostParseRestoreBackendAlias(). But the
commit in question removed not only the capability check but also
this return early statement. Restore it back.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2129239
Fixes: dc8dbb27d40968c9d9bfad2c6181bccc20c0e44e
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_domain.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index d7ef23f493..ee024d17cd 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -5596,6 +5596,10 @@ qemuDomainDeviceHostdevDefPostParseRestoreBackendAlias(virDomainHostdevDef *host
if (!(parseFlags & VIR_DOMAIN_DEF_PARSE_STATUS))
return 0;
+ if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS ||
+ hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI)
+ return 0;
+
switch ((virDomainHostdevSCSIProtocolType) scsisrc->protocol) {
case VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_NONE:
if (!scsisrc->u.host.src)
--
2.35.1
2 years, 2 months