[PATCH 1/3] [bhyve] list pci devices on host

2025-01-29 Thread Alexander Shursha
Linux gets the list via sysfs. FreeBSD can get the list through ioctl Sponsored by: Future Crew, LLC Signed-off-by: Alexander Shursha --- src/bhyve/bhyve_capabilities.c | 2 +- src/conf/node_device_conf.c | 2 +- src/node_device/node_device_driver.c | 2 +- src/util/virmdev.

[PATCH 3/3] [bhyve] parse passthru argument from XML-config

2025-01-29 Thread Alexander Shursha
Sponsored by: Future Crew, LLC Signed-off-by: Alexander Shursha --- src/bhyve/bhyve_parse_command.c | 59 + 1 file changed, 59 insertions(+) diff --git a/src/bhyve/bhyve_parse_command.c b/src/bhyve/bhyve_parse_command.c index 29d3a678bf..14916c401d 100644 --- a/sr

[PATCH 2/3] [bhyve] add command line argument "passthru"

2025-01-29 Thread Alexander Shursha
Sponsored by: Future Crew, LLC Signed-off-by: Alexander Shursha --- src/bhyve/bhyve_command.c | 22 ++ 1 file changed, 22 insertions(+) diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c index bc287307c8..16986c9d53 100644 --- a/src/bhyve/bhyve_command.c +++ b

Re: [PATCH 1/2] qemu: Decompose qemuSaveImageOpen

2025-01-29 Thread Jim Fehlig via Devel
On 1/29/25 04:40, Michal Prívozník wrote: On 1/28/25 22:23, Jim Fehlig wrote: On 1/28/25 06:52, Michal Prívozník wrote: On 1/25/25 01:37, Jim Fehlig via Devel wrote: Split the reading of libvirt's save image metadata from the opening of the fd that will be passed to QEMU. This allows improved

Re: [PATCH 11/26] qemu: support automatic VM managed save in system daemon

2025-01-29 Thread Peter Krempa
On Wed, Jan 08, 2025 at 19:42:44 +, Daniel P. Berrangé wrote: > Currently automatic VM managed save is only performed in session > daemons, on desktop session close, or host OS shutdown request. > > With this change it is possible to control shutdown behaviour for > all daemons. A recommended

Re: [PATCH] remote: add sysusers file to create 'libvirt' group

2025-01-29 Thread Daniel P . Berrangé
On Wed, Jan 29, 2025 at 05:11:25PM +0100, Jiri Denemark wrote: > On Wed, Jan 29, 2025 at 15:46:30 +, Daniel P. Berrangé wrote: > > We previously added a sysusers file, but missed the 'libvirt' group. > > This group is referenced in the polkit rules, so we should be > > registering that too. It

Re: [PATCH] remote: add sysusers file to create 'libvirt' group

2025-01-29 Thread Jiri Denemark
On Wed, Jan 29, 2025 at 15:46:30 +, Daniel P. Berrangé wrote: > We previously added a sysusers file, but missed the 'libvirt' group. > This group is referenced in the polkit rules, so we should be > registering that too. It must be done in a separate sysusers file, > however, since it is common

[PATCH] glibcompat: Updating "backport" 'g_string_replace'

2025-01-29 Thread Adam Julis
Update the vir_g_string_replace with following commits from glib: c9e48947e gstring: Fix a heap buffer overflow in the new g_string_replace() code e8517e777 remove quadratic behavior in g_string_replace Signed-off-by: Adam Julis --- src/util/glibcompat.c | 125 ++

[PATCH] remote: add sysusers file to create 'libvirt' group

2025-01-29 Thread Daniel P . Berrangé
We previously added a sysusers file, but missed the 'libvirt' group. This group is referenced in the polkit rules, so we should be registering that too. It must be done in a separate sysusers file, however, since it is common to all daemons. Fixes: a2c3e390f7bedf36f4ddc544d09fe3b8772c5c6f Signed-o

Re: [PATCH] Add a check that vmdisk and disk variables are not NULL

2025-01-29 Thread Peter Krempa
On Thu, Jun 20, 2024 at 04:48:05 +0800, Fima Shevrin wrote: > Hello, > > Thank you for your comments and explanations about disk states and snapshots > in general. > > I agree that it is quite dangerous to always delete a snapshot in case one > of the variables is NULL. > > I modified the patch

Re: [PATCH 18/19] qemu: add RDP support

2025-01-29 Thread Daniel P . Berrangé
On Wed, Jan 29, 2025 at 05:40:40PM +0400, marcandre.lur...@redhat.com wrote: > From: Marc-André Lureau > > Wire the external server RDP support with QEMU. > > Check the configuration, allocate a port, start the process > and set the credentials. > > Signed-off-by: Marc-André Lureau > --- > do

Re: [PATCH] qemuSnapshotDeleteValidate: Fix crash when disk is not found in VM definition

2025-01-29 Thread Peter Krempa
On Fri, Nov 29, 2024 at 22:56:45 +0800, kaihuan wrote: > qemuDomainDiskByName() can return a NULL pointer on failure. > But this returned value in qemuSnapshotDeleteValidate is not checked.It will > make libvirtd crash. > > Signed-off-by: kaihuan > --- > src/qemu/qemu_snapshot.c | 15 ++

Re: [PATCH] qemuSnapshotDeleteValidate: Fix crash when disk is not found in VM definition

2025-01-29 Thread Peter Krempa
On Wed, Jan 22, 2025 at 14:05:18 +0100, Martin Kletzander wrote: > On Fri, Nov 29, 2024 at 10:56:45PM +0800, kaihuan wrote: > > qemuDomainDiskByName() can return a NULL pointer on failure. > > But this returned value in qemuSnapshotDeleteValidate is not checked.It > > will make libvirtd crash. > >

Re: [PATCH v3] Support IDE/SATA disk 'product' parameter

2025-01-29 Thread Peter Krempa
On Sat, Jan 18, 2025 at 11:30:20 +0100, Adam Julis wrote: > Since we supported 'product' parameter for SCSI, just expanded existing > solution makes IDE/SATA parameter works too. QEMU requires parameter 'model' > in case of IDE/SATA (instead of 'product'), so the process of making JSON > object is

Re: [PATCH v2 12/15] virDomainGetMessages: Introduce VIR_DOMAIN_MESSAGE_IOERRORS

2025-01-29 Thread Peter Krempa
On Tue, Jan 28, 2025 at 17:28:16 +0100, Peter Krempa wrote: > Report any stored I/O error messages reported by the hypervisor when > reporting messages of a domain. As the I/O error may be already stale we > report also the timestamp when it was recorded. > > Example message: > > I/O error: disk

Re: [PATCH 12/19] qemu: limit to one

2025-01-29 Thread Daniel P . Berrangé
On Wed, Jan 29, 2025 at 05:40:34PM +0400, marcandre.lur...@redhat.com wrote: > From: Marc-André Lureau > > Signed-off-by: Marc-André Lureau > --- > src/qemu/qemu_command.c | 8 ++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_c

[PATCH 01/19] build-sys: drop -Winline

2025-01-29 Thread marcandre . lureau
From: Marc-André Lureau The warning is triggered when compiling with various build options, such as -Doptimization=g. >From gcc(1) man page about -Winline: seemingly insignificant changes in the source program can cause the warnings produced by -Winline to appear or disappear. Such flaky behav

[PATCH 19/19] tests: add qemu test

2025-01-29 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- .../graphics-rdp.x86_64-latest.args | 35 +++ .../graphics-rdp.x86_64-latest.xml| 1 + tests/qemuxmlconfdata/graphics-rdp.xml| 43 +++ tests/qemuxmlconftest.c

[PATCH 18/19] qemu: add RDP support

2025-01-29 Thread marcandre . lureau
From: Marc-André Lureau Wire the external server RDP support with QEMU. Check the configuration, allocate a port, start the process and set the credentials. Signed-off-by: Marc-André Lureau --- docs/formatdomain.rst | 25 -- src/conf/domain_conf.h| 1 + src/qemu/qemu_extdevice.

[PATCH 17/19] qemu: add qemu-rdp helper unit

2025-01-29 Thread marcandre . lureau
From: Marc-André Lureau Helpers to start the qemu-rdp server and set it up. Signed-off-by: Marc-André Lureau --- po/POTFILES| 1 + src/qemu/meson.build | 1 + src/qemu/qemu_domain.c | 1 + src/qemu/qemu_domain.h | 2 + src/qemu/qemu_rdp.c| 427

[PATCH 16/19] qemu: if -display dbus capability is supported, accept rdp

2025-01-29 Thread marcandre . lureau
From: Marc-André Lureau We may want to check qemu-rdp presence, instead of failing later? Signed-off-by: Marc-André Lureau --- src/qemu/qemu_capabilities.c | 7 +-- tests/domaincapsdata/qemu_10.0.0.s390x.xml | 1 + tests/domaincapsdata/qemu_7.0.0-q

[PATCH 15/19] qemu: validate RDP configuration

2025-01-29 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- src/qemu/qemu_validate.c | 30 +- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index c5b66c4966..86fc5ac0fe 100644 --- a/src/qemu/qemu_va

[PATCH 14/19] qemu/dbus: log daemon stdout/err

2025-01-29 Thread marcandre . lureau
From: Marc-André Lureau Currently, if dbus-daemon writes on errfd, it will SIGPIPE. Signed-off-by: Marc-André Lureau --- src/qemu/qemu_dbus.c | 61 +++- 1 file changed, 49 insertions(+), 12 deletions(-) diff --git a/src/qemu/qemu_dbus.c b/src/qemu/qemu_

[PATCH 13/19] qemu/dbus: keep a connection to the VM D-Bus

2025-01-29 Thread marcandre . lureau
From: Marc-André Lureau The following changes are going to communicate with the qemu-rdp server through the VM D-Bus bus, keep a connection for that and further usage. Signed-off-by: Marc-André Lureau --- src/qemu/qemu_dbus.c | 22 +++--- src/qemu/qemu_domain.h | 2 ++ 2 fil

[PATCH 12/19] qemu: limit to one

2025-01-29 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- src/qemu/qemu_command.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index f08dba7988..dc142b366a 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qem

[PATCH 11/19] qemu: add RDP ports range allocator

2025-01-29 Thread marcandre . lureau
From: Marc-André Lureau RDP server use port 3389 by default. Signed-off-by: Marc-André Lureau --- src/qemu/qemu_conf.c | 6 ++ src/qemu/qemu_conf.h | 6 ++ src/qemu/qemu_driver.c | 8 3 files changed, 20 insertions(+) diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf

[PATCH 10/19] qemu: use virDomainDefHasGraphics

2025-01-29 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- src/qemu/qemu_validate.c | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 54226b8c62..c5b66c4966 100644 --- a/src/qemu/qemu_validate.c +++ b/src/

[PATCH 09/19] conf: generalize virDomainDefHasSpiceGraphics

2025-01-29 Thread marcandre . lureau
From: Marc-André Lureau Generalize the function, broaden its potential usage. Signed-off-by: Marc-André Lureau --- src/conf/domain_conf.c | 15 --- src/conf/domain_conf.h | 2 +- src/libvirt_private.syms | 2 +- src/qemu/qemu_validate.c | 4 ++-- 4 files changed, 16 insertio

[PATCH 08/19] conf: parse optional RDP username & password

2025-01-29 Thread marcandre . lureau
From: Marc-André Lureau Like VNC, allow to set credentials for RDP. Signed-off-by: Marc-André Lureau --- src/conf/domain_conf.c| 13 + src/conf/domain_conf.h| 2 ++ src/conf/schemas/domaincommon.rng | 10 ++ 3 files changed, 25 insertions(+) diff -

[PATCH 07/19] qemu: add qemu RDP configuration

2025-01-29 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- src/qemu/libvirtd_qemu.aug | 7 ++ src/qemu/qemu.conf.in | 31 src/qemu/qemu_conf.c | 39 ++ src/qemu/qemu_conf.h | 6 + s

[PATCH 06/19] qemu: add rdp state directory

2025-01-29 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- src/qemu/qemu_conf.c | 2 ++ src/qemu/qemu_conf.h | 1 + src/qemu/qemu_driver.c | 12 tests/testutilsqemu.c | 2 ++ 4 files changed, 17 insertions(+) diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index

[PATCH 04/19] util: add conn != NULL precondition in virGDBusCallMethod()

2025-01-29 Thread marcandre . lureau
From: Marc-André Lureau Helps avoid/debug a potential SEGV if conn is NULL, since gio will not set the "gerror" in that case and we will crash later at: virReportError(VIR_ERR_DBUS_SERVICE, "%s", gerror->message); Signed-off-by: Marc-André Lureau --- src/util/virgdbus.c | 4 1 file chan

[PATCH 05/19] qemu: report an error for unsupported graphics

2025-01-29 Thread marcandre . lureau
From: Marc-André Lureau Without an error message, it can be tedious to figure out failure to start. Signed-off-by: Marc-André Lureau --- src/qemu/qemu_command.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 1f20189e89..f08dba7988

[PATCH 03/19] qemu-slirp: drop unneeded check for OOM

2025-01-29 Thread marcandre . lureau
From: Marc-André Lureau glib anti-pattern, since it aborts on OOM. Signed-off-by: Marc-André Lureau --- src/qemu/qemu_slirp.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/src/qemu/qemu_slirp.c b/src/qemu/qemu_slirp.c index 66d9d77c6c..eac7e4cc47 100644 --- a/src/qemu/qemu_slirp.c +

[PATCH 02/19] build: fix -Werror=maybe-uninitialized

2025-01-29 Thread marcandre . lureau
From: Marc-André Lureau When compiled with -Doptimization=g ../tools/nss/libvirt_nss_macs.c:155:8: error: ‘jerr’ may be used uninitialized [-Werror=maybe-uninitialized] 155 | if (jerr == json_tokener_continue) { |^ Signed-off-by: Marc-André Lureau --- tools/nss/libvirt_ns

[PATCH 00/19] Add qemu RDP server support

2025-01-29 Thread marcandre . lureau
From: Marc-André Lureau Hi, This patch series offers an out-of-process Remote Desktop Protocol (RDP) server solution utilizing QEMU's -display dbus interface, offering improved modularity and potential security benefits compared to built-in server. This initiative was spearheaded by Mihnea Buza

Re: [libvirt PATCH] qemu_snapshot: allow reverting to external disk only snapshot

2025-01-29 Thread Peter Krempa
On Wed, Jan 31, 2024 at 17:14:28 +0100, Pavel Hrdina wrote: > When snapshot is created with disk-only flag it is always external > snapshot without memory state. Historically when there was not support > to revert external snapshots this produced error message. > > error: Failed to revert snap

[PATCH 3/3] tools: Move libvirt-guests lock file out of subsys directory

2025-01-29 Thread Peter Krempa
From: Bronek Kozicki This directory might not exist on systems not supporting old SystemV interfaces. Signed-off-by: Bronek Kozicki Reviewed-by: Peter Krempa --- tools/libvirt-guests.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/libvirt-guests.sh.in b/tools/l

[PATCH 2/3] virsh: pool-list: remove unnecessary spaces to align behavior

2025-01-29 Thread Peter Krempa
From: Philipp Schuster By removing the unnecessary spaces, the behavior is aligned with `virsh list --all --name` and `virsh net-list --all --name`. Without this change, one can't do something like the following easily: `virsh pool-list --all --name | xargs -I {} virsh pool-start \"{}\"` as no

[PATCH 1/3] docs: Document that 'vcpu.delay' statistic is in nanoseconds

2025-01-29 Thread Peter Krempa
From: Assaf Admi Add nanoseconds units for vcpu.delay doc, as it's based on '/proc//task//schedstat' (see 'qemuGetSchedstatDelay()'). 'schedstat' is in nanoseconds, according to https://docs.kernel.org/scheduler/sched-stats.html#proc-pid-schedstat. Signed-off-by: aadmi Reviewed-by: Peter Kremp

[PATCH pushed 0/3] Patches from MR

2025-01-29 Thread Peter Krempa
I've reviewed and fixed some patches from MR's: Assaf Admi (1): docs: Document that 'vcpu.delay' statistic is in nanoseconds https://gitlab.com/libvirt/libvirt/-/merge_requests/352 Bronek Kozicki (1): tools: Move libvirt-guests lock file out of subsys directory https://gitlab.com/li

Re: [PATCH 1/2] qemu: Decompose qemuSaveImageOpen

2025-01-29 Thread Michal Prívozník
On 1/28/25 22:23, Jim Fehlig wrote: > On 1/28/25 06:52, Michal Prívozník wrote: >> On 1/25/25 01:37, Jim Fehlig via Devel wrote: >>> Split the reading of libvirt's save image metadata from the opening >>> of the fd that will be passed to QEMU. This allows improved error >>> handling and provides mo

Re: [PATCH v2 2/2] qemu: Clarify block I/O throttle JSON parsing errors

2025-01-29 Thread Peter Krempa
On Tue, Jan 21, 2025 at 14:33:30 +, Fabian Leditzky via Devel wrote: > The original code incorrectly assumes that the 'inserted' entry is not > in the right format (wrong JSON value type, not an 'Object') when > virJSONValueObjectGetObject(temp_dev, "inserted") returns NULL. However, > NULL is

Re: [PATCH v2 1/2] qemu: Check empty drives in block I/O throttle API

2025-01-29 Thread Peter Krempa
On Tue, Jan 21, 2025 at 14:33:25 +, Fabian Leditzky via Devel wrote: > Provide a proper user facing error when attempting to query block > I/O throttling settings for an empty drive. Without this patch, a less > meaningful internal error produced by qemuMonitorJSONBlockIoThrottleInfo > would be