Re: [PATCH v1 2/9] qemu: capabilities: add static-recommended capability

2023-09-14 Thread Collin Walling
On 9/12/23 03:13, Peter Krempa wrote: > On Mon, Sep 11, 2023 at 17:07:09 -0400, Collin Walling wrote: >> Check for the QEMU capability to query for a static-recommended CPU >> model via CPU model expansion. Cache this capability for later. >> >> Signed-off-by: Collin Walling >> Reviewed-by: Boris

Re: [PATCH v1 0/9] query & cache host-recommended CPU model

2023-09-14 Thread Collin Walling
On 9/12/23 03:58, Peter Krempa wrote: > On Mon, Sep 11, 2023 at 17:07:07 -0400, Collin Walling wrote: >> Notes: >> https://lists.gnu.org/archive/html/qemu-devel/2023-09/msg02518.html >> - For information regarding the QEMU "static-recommended" (aka >> host-recommended) >>CPU model, please

Re: [sdl-qemu] [PATCH 1/1] No checks, dereferencing possible

2023-09-14 Thread Daniel P . Berrangé
On Thu, Sep 14, 2023 at 12:22:26PM +0200, Peter Krempa wrote: > On Thu, Sep 14, 2023 at 09:44:16 +, Миронов Сергей Владимирович wrote: > > No checks, dereferencing possible. > > > > > > Return value of a function 'virDomainChrSourceDefNew' > > is dereferenced at qemu_command.c without

Re: [sdl-qemu] [PATCH 0/1] There are no checks, virDomainChrSourceDefNew can return 0

2023-09-14 Thread Peter Krempa
On Thu, Sep 14, 2023 at 13:45:23 +, Миронов Сергей Владимирович wrote: This is a technical list so please avoid top-posting. > Okay, Peter > > > Should I resend the patches correctly or wait for a response for those added > to the mailing list? > > >

Re: [PATCH] qemuxml2argvtest: Fix tests failing on none x86 host CPUs

2023-09-14 Thread Michal Prívozník
On 9/14/23 15:15, Boris Fiuczynski wrote: > Since commit 54257ed51b51 on S390x qemuxml2argvtest fails with the following > errors: > > 144) QEMU XML-2-ARGV cpu-kvmclock.x86_64-latest... > libvirt: CPU Driver error : the CPU is incompatible with host CPU: Host CPU > does

Re: [PATCH 00/20] Misc cleanups (pt. 1)

2023-09-14 Thread Ján Tomko
On a Thursday in 2023, Michal Privoznik wrote: I had these sitting on a local branch for a while. My initial plan was to use virXMLPropEnum() more and while working on that I found one bug (patch 01/20), one improvement (patch 02/20) and a couple of useless typecats. Also: s/typecats/^..^

Re: [PATCH 00/20] Misc cleanups (pt. 1)

2023-09-14 Thread Ján Tomko
On a Thursday in 2023, Michal Privoznik wrote: I had these sitting on a local branch for a while. My initial plan was to use virXMLPropEnum() more and while working on that I found one bug (patch 01/20), one improvement (patch 02/20) and a couple of useless typecats. Michal Prívozník (20):

Re: [sdl-qemu] [PATCH 0/1] There are no checks, virDomainChrSourceDefNew can return 0

2023-09-14 Thread Michal Prívozník
On 9/14/23 11:44, Миронов Сергей Владимирович wrote: > There are no checks, virDomainChrSourceDefNew can return 0. > > > Return value of a function 'virDomainChrSourceDefNew' > > is dereferenced at qemu_hotplug.c without checking for NULL, > > but it is usually checked for this function. > >

[PATCH 08/20] virDomainHostdevSubsysSCSI: Convert 'protocol' field to proper enum type

2023-09-14 Thread Michal Privoznik
Convert the field and adjust the XML parser to use virXMLPropEnum(). Signed-off-by: Michal Privoznik --- src/conf/domain_conf.c | 18 ++ src/conf/domain_conf.h | 2 +- src/qemu/qemu_command.c | 4 ++-- src/qemu/qemu_domain.c | 4 ++-- 4 files changed, 11 insertions(+), 17

[PATCH 13/20] virDomainControllerDef: Convert 'type' field to proper enum type

2023-09-14 Thread Michal Privoznik
Convert the field and fill in missing cases to switch() statements. Signed-off-by: Michal Privoznik --- src/conf/domain_conf.c | 26 ++ src/conf/domain_conf.h | 9 ++--- src/qemu/qemu_command.c| 2 +- src/qemu/qemu_domain.c | 2 +-

[PATCH 10/20] virDomainHostdevDef: Convert 'mode' field to proper enum type

2023-09-14 Thread Michal Privoznik
Convert the field, adjust the XML parser to use virXMLPropEnumDefault() and fill in missing cases to switch() statements. Signed-off-by: Michal Privoznik --- src/conf/domain_audit.c | 2 +- src/conf/domain_conf.c | 23 +-- src/conf/domain_conf.h |

[PATCH 12/20] virDomainHostdevSubsys: Convert 'type' field to proper enum type

2023-09-14 Thread Michal Privoznik
Convert the field, and fill in missing cases to switch() statements. Signed-off-by: Michal Privoznik --- src/conf/domain_audit.c | 2 +- src/conf/domain_conf.c | 57 +++- src/conf/domain_conf.h | 2 +- src/conf/domain_validate.c |

[PATCH 20/20] virDomainDiskSourceNVMeParse: Use virXMLPropULongLong()

2023-09-14 Thread Michal Privoznik
Inside of virDomainDiskSourceNVMeParse() we have virXMLPropString() + virStrToLong_ull() combo. Switch to virXMLPropULongLong() which does the same thing. Signed-off-by: Michal Privoznik --- src/conf/domain_conf.c | 14 +++--- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git

[PATCH 01/20] lxc_controller: Access correct union member in virLXCControllerSetupHostdevCaps()

2023-09-14 Thread Michal Privoznik
The point of virLXCControllerSetupHostdevCaps() is to access .caps union member of given source. And it does so in the switch, but then, when reporting an error the .subsys member is accessed. Signed-off-by: Michal Privoznik --- src/lxc/lxc_controller.c | 2 +- 1 file changed, 1 insertion(+),

[PATCH 19/20] virStorageNetHostDef: Convert 'transport' field to proper enum type

2023-09-14 Thread Michal Privoznik
Convert the field and adjust the XML parsers to use virXMLPropEnumDefault(). Signed-off-by: Michal Privoznik --- src/conf/domain_conf.c | 16 ++-- src/conf/storage_source_conf.h | 2 +- src/qemu/qemu_backup.c | 2

[PATCH 18/20] virDomainDeviceInfo: Convert 'type' field to proper enum type

2023-09-14 Thread Michal Privoznik
Convert the field, adjust the XML parsers to use virXMLPropEnum() and fill in missing cases to switch() statements. Signed-off-by: Michal Privoznik --- src/conf/device_conf.c | 12 +++- src/conf/device_conf.h | 4 ++-- src/conf/domain_conf.c | 21 +++--

[PATCH 17/20] virDomainWatchdogDef: Convert 'action' field to proper enum type

2023-09-14 Thread Michal Privoznik
Convert the field and adjust the XML parser to use virXMLPropEnumDefault(). Signed-off-by: Michal Privoznik --- src/conf/domain_conf.c | 17 ++--- src/conf/domain_conf.h | 2 +- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/conf/domain_conf.c

[PATCH 16/20] virDomainWatchdogDef: Convert 'model' field to proper enum type

2023-09-14 Thread Michal Privoznik
Convert the field and adjust the XML parsers to use virXMLPropEnum(). Signed-off-by: Michal Privoznik --- src/conf/domain_conf.c | 15 --- src/conf/domain_conf.h | 2 +- src/qemu/qemu_domain_address.c | 2 +- src/qemu/qemu_validate.c | 2 +- 4 files changed,

[PATCH 02/20] src: Access hostdev->source.subsys iff VIR_DOMAIN_HOSTDEV_MODE_SUBSYS

2023-09-14 Thread Michal Privoznik
There are few places where a virDomainHostdevDef->source.subsys is accessed without ->mode being checked. Mind you, virDomainHostdevDef can be also in VIR_DOMAIN_HOSTDEV_MODE_CAPABILITIES mode. Signed-off-by: Michal Privoznik --- src/conf/domain_conf.c| 3 ++- src/conf/domain_validate.c

[PATCH 15/20] virDomainRNGDef: Convert 'backend' field to proper enum type

2023-09-14 Thread Michal Privoznik
Convert the field and adjust the XML parser to use virXMLPropEnum(). Signed-off-by: Michal Privoznik --- src/conf/domain_audit.c | 4 ++-- src/conf/domain_conf.c| 22 -- src/conf/domain_conf.h| 2 +- src/qemu/qemu_command.c | 4 ++-- src/qemu/qemu_namespace.c

[PATCH 11/20] virDomainHostdevCaps: Convert 'type' field to proper enum type

2023-09-14 Thread Michal Privoznik
Convert the field, adjust the XML parsers to use virXMLPropEnum() and fill in missing cases to switch() statements. Signed-off-by: Michal Privoznik --- src/conf/domain_audit.c | 2 ++ src/conf/domain_conf.c | 29 ++--- src/conf/domain_conf.h |

[PATCH 14/20] virDomainRNGDef: Convert 'model' field to proper enum type

2023-09-14 Thread Michal Privoznik
Convert the field and adjust the XML parser to use virXMLPropEnum(). Signed-off-by: Michal Privoznik --- src/conf/domain_conf.c | 13 - src/conf/domain_conf.h | 2 +- src/qemu/qemu_domain_address.c | 2 +- 3 files changed, 6 insertions(+), 11 deletions(-) diff

[PATCH 07/20] src: Drop needless typecast to virDomainDiskBus

2023-09-14 Thread Michal Privoznik
The 'bus' member of _virDomainDiskDef is already declared of virDomainDiskModel type. Hence, there is no need to typecast the variable when passing to switch() statements. Signed-off-by: Michal Privoznik --- src/qemu/qemu_alias.c | 2 +- src/qemu/qemu_command.c| 4 ++--

[PATCH 09/20] virDomainHostdevSubsysSCSIVHost: Convert 'protocol' field to proper enum type

2023-09-14 Thread Michal Privoznik
Convert the field and adjust the XML parser to use virXMLPropEnum(). Signed-off-by: Michal Privoznik --- src/conf/domain_conf.c | 17 + src/conf/domain_conf.h | 4 ++-- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/conf/domain_conf.c

[PATCH 06/20] qemu_domain_address: Drop needless typecast to virDomainDiskModel

2023-09-14 Thread Michal Privoznik
The 'mode' member of _virDomainDiskDef is already declared of virDomainDiskModel type. Hence, there is no need to typecast the variable when passing to switch() statements. Signed-off-by: Michal Privoznik --- src/qemu/qemu_domain_address.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH 05/20] src: Drop needless typecast to virDomainDeviceType

2023-09-14 Thread Michal Privoznik
The 'type' member of _virDomainDeviceDef is already declared of virDomainDeviceType type. Hence, there is no need to typecast the variable when passing to switch() statements. Signed-off-by: Michal Privoznik --- src/ch/ch_domain.c | 2 +- src/conf/domain_conf.c | 8

[PATCH 03/20] qemu_domain_address: Drop needless typecast in qemuDomainDeviceCalculatePCIConnectFlags()

2023-09-14 Thread Michal Privoznik
Inside of qemuDomainDeviceCalculatePCIConnectFlags() there's a switch() which typecasts a variable of virDomainHostdevSubsysSCSIVHostModelType type to the very same type. This is useless. Signed-off-by: Michal Privoznik --- src/qemu/qemu_domain_address.c | 2 +- 1 file changed, 1 insertion(+),

[PATCH 00/20] Misc cleanups (pt. 1)

2023-09-14 Thread Michal Privoznik
I had these sitting on a local branch for a while. My initial plan was to use virXMLPropEnum() more and while working on that I found one bug (patch 01/20), one improvement (patch 02/20) and a couple of useless typecats. Michal Prívozník (20): lxc_controller: Access correct union member in

[PATCH 04/20] qemu: Drop needless typecast to virDomainFSDriverType

2023-09-14 Thread Michal Privoznik
The 'fsdriver' member of _virDomainFSDef is already declared of virDomainFSDriverType type. Hence, there is no need to typecast the variable when passing to switch() statements. Signed-off-by: Michal Privoznik --- src/qemu/qemu_command.c| 4 ++-- src/qemu/qemu_domain_address.c | 2 +-

Re: [sdl-qemu] [PATCH 0/1] There are no checks, virDomainChrSourceDefNew can return 0

2023-09-14 Thread Миронов Сергей Владимирович
Okay, Peter Should I resend the patches correctly or wait for a response for those added to the mailing list? https://listman.redhat.com/archives/libvir-list/2023-September/242078.html https://listman.redhat.com/archives/libvir-list/2023-September/242077.html

[PATCH] qemuxml2argvtest: Fix tests failing on none x86 host CPUs

2023-09-14 Thread Boris Fiuczynski
Since commit 54257ed51b51 on S390x qemuxml2argvtest fails with the following errors: 144) QEMU XML-2-ARGV cpu-kvmclock.x86_64-latest... libvirt: CPU Driver error : the CPU is incompatible with host CPU: Host CPU does not provide required features: monitor FAILED

Re: [sdl-qemu] [PATCH 1/1] No checks, dereferencing possible

2023-09-14 Thread Peter Krempa
On Thu, Sep 14, 2023 at 09:44:16 +, Миронов Сергей Владимирович wrote: > No checks, dereferencing possible. > > > Return value of a function 'virDomainChrSourceDefNew' > is dereferenced at qemu_command.c without checking > for NULL, but it is usually checked for this function. This

Re: [sdl-qemu] [PATCH 0/1] There are no checks, virDomainChrSourceDefNew can return 0

2023-09-14 Thread Peter Krempa
CC-ing qemu-devel with a patch solely for libvirt doesn't make sense. Also 'libvirt-security' list is private and is is intended as a first contact list for stuff to be embargoed. It makes little sense to include it when posting to the public 'libvir-list'. On Thu, Sep 14, 2023 at 09:44:13

[sdl-qemu] [PATCH 0/1] There are no checks, virDomainChrSourceDefNew can return 0

2023-09-14 Thread Миронов Сергей Владимирович
There are no checks, virDomainChrSourceDefNew can return 0. Return value of a function 'virDomainChrSourceDefNew' is dereferenced at qemu_hotplug.c without checking for NULL, but it is usually checked for this function. Found by Linux Verification Center (linuxtesting.org) with SVACE.

[sdl-qemu] [PATCH 1/1] No checks, dereferencing possible

2023-09-14 Thread Миронов Сергей Владимирович
No checks, dereferencing possible. Return value of a function 'virDomainChrSourceDefNew' is dereferenced at qemu_command.c without checking for NULL, but it is usually checked for this function. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 1f85f0967b ("ci: