[PATCH 1/2] network: ignore/don't log errors when unsetting firewalld zone

2024-10-21 Thread Laine Stump
The most common "error" when trying to unset the firewalld zone of an interface is for firewalld to tell us that the interface already isn't in any zone. Since this is what we want, no need to alarm the user by logging it as an error. Signed-off-by: Laine Stump --- src/util/virfirewalld.c | 33 +

[PATCH 2/2] network: don't unset the firewalld zone if it's going to be immediately re-set

2024-10-21 Thread Laine Stump
Any time the firewalld zone for an interface is set, by definition that removes it from any previous zone that it was in, so there is really no point in unsetting the zone if it's just going to be immediately set again. (incoming "weave" - it meanders a bit, but then ties together into a point. Bi

[PATCH 0/2] network: avoid logging unnecessary and misleading errors when failing to unset a zone

2024-10-21 Thread Laine Stump
While testing a recent patch that unsets the zone of bridge interfaces when a virtual network is stopped, a side effect was noticed: when firewalld reloaded its rules, this would result in an error log from libvirt complaining about attempting to unset the zone of an interface that wasn't in any zo

Re: Help with setting up libvirt for development.

2024-10-21 Thread Laine Stump
On 10/21/24 3:39 PM, validsud...@gmail.com wrote: Hi, pardon my ignorance. I'm trying to add some changes to the libvirt codebase (https://gitlab.com/libvirt/libvirt). I've successfully built it with `meson setup /build` and a `compile_commands.json` was generated in the build folder. But vscod

Re: [PATCH] spec: Drop nwfilter dependency in libvirt-daemon-xen

2024-10-21 Thread Laine Stump
On 10/21/24 4:57 PM, Jim Fehlig via Devel wrote: The libvirt xen driver does not support nwfilters. In fact, since commit d721b6840f, the driver rejects VM configuration referencing nwfilters. Drop the needless nwfilter dependency from libvirt-daemon-xen. Signed-off-by: Jim Fehlig Reviewed-by

Re: [PATCH v4 3/6] schema: add TPM emulator

2024-10-21 Thread Stefan Berger
Learn to parse a file path for the TPM state. Signed-off-by: Marc-André Lureau ---  docs/formatdomain.rst   | 19 ++  src/conf/domain_conf.c  | 28 +  src/conf/domain_conf.h  |  9 +++  src/conf/

Re: [PATCH v4 6/6] qemu: explicit swtpm state locking

2024-10-21 Thread Stefan Berger
On 10/21/24 2:23 PM, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau With upcoming v0.10 swtpm (commit https://github.com/stefanberger/swtpm/commit/aa483aeb6df87ed56ccf3d5778d6fd8019089bda), file locking with "lock" option is now supported and reflected in "tpmstate-opt-lock" capa

Re: [PATCH v4 4/6] schema: add TPM emulator

2024-10-21 Thread Stefan Berger
On 10/21/24 2:23 PM, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau Learn to parse a directory for the TPM state. Signed-off-by: Marc-André Lureau Reviewed-by: Stefan Berger --- docs/formatdomain.rst | 3 ++- src/conf/domain_conf.c

Re: [PATCH v4 2/6] tpm: rename 'storagepath' to 'source_path'

2024-10-21 Thread Stefan Berger
On 10/21/24 2:23 PM, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau Mechanically replace existing 'storagepath' with 'source_path', as the following patches introduce configuration. Signed-off-by: Marc-André Lureau Reviewed-by: Stefan Berger

[PATCH] spec: Drop nwfilter dependency in libvirt-daemon-xen

2024-10-21 Thread Jim Fehlig via Devel
The libvirt xen driver does not support nwfilters. In fact, since commit d721b6840f, the driver rejects VM configuration referencing nwfilters. Drop the needless nwfilter dependency from libvirt-daemon-xen. Signed-off-by: Jim Fehlig --- libvirt.spec.in | 1 - 1 file changed, 1 deletion(-) diff

[PATCH v4 5/6] qemu_tpm: handle file/block storage source

2024-10-21 Thread marcandre . lureau
From: Marc-André Lureau When swtpm reports "nvram-backend-dir", it can accepts a single file or block device where TPM state will be stored. --tpmstate must be backend-uri=file://. Teach the storage to use custom directory or file source location. Signed-off-by: Marc-André Lureau --- src/qemu

Help with setting up libvirt for development.

2024-10-21 Thread validsudoku
Hi, pardon my ignorance. I'm trying to add some changes to the libvirt codebase (https://gitlab.com/libvirt/libvirt). I've successfully built it with `meson setup /build` and a `compile_commands.json` was generated in the build folder. But vscode keeps showing that there are errors from trying

[PATCH v4 0/6] Add TPM emulator

2024-10-21 Thread marcandre . lureau
From: Marc-André Lureau Hi, When swtpm capabilities reports "nvram-backend-dir", it can accepts a single file or block device where TPM state will be stored. --tpmstate must be backend-uri=file://. v4: - add "qemu: explicit swtpm state locking" - add r-b from Stefan, first patch only atm v3:

[PATCH v4 6/6] qemu: explicit swtpm state locking

2024-10-21 Thread marcandre . lureau
From: Marc-André Lureau With upcoming v0.10 swtpm (commit https://github.com/stefanberger/swtpm/commit/aa483aeb6df87ed56ccf3d5778d6fd8019089bda), file locking with "lock" option is now supported and reflected in "tpmstate-opt-lock" capability. Signed-off-by: Marc-André Lureau --- src/qemu/qemu

[PATCH v4 4/6] schema: add TPM emulator

2024-10-21 Thread marcandre . lureau
From: Marc-André Lureau Learn to parse a directory for the TPM state. Signed-off-by: Marc-André Lureau --- docs/formatdomain.rst | 3 ++- src/conf/domain_conf.c| 1 + src/conf/domain_conf.h| 1 + src/conf/schemas/domain

[PATCH v4 3/6] schema: add TPM emulator

2024-10-21 Thread marcandre . lureau
From: Marc-André Lureau Learn to parse a file path for the TPM state. Signed-off-by: Marc-André Lureau --- docs/formatdomain.rst | 19 ++ src/conf/domain_conf.c | 28 + src/conf/domain_conf.h | 9 +

[PATCH v4 2/6] tpm: rename 'storagepath' to 'source_path'

2024-10-21 Thread marcandre . lureau
From: Marc-André Lureau Mechanically replace existing 'storagepath' with 'source_path', as the following patches introduce configuration. Signed-off-by: Marc-André Lureau --- src/conf/domain_conf.c | 2 +- src/conf/domain_conf.h | 2 +- src/qemu/qemu_tpm.c | 46

[PATCH v4 1/6] util: check swtpm nvram-backend-{dir,file} capabilities

2024-10-21 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Stefan Berger --- src/util/virtpm.c | 2 ++ src/util/virtpm.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/util/virtpm.c b/src/util/virtpm.c index 81fd6166cf..298caaad80 100644 --- a/src/util/virtpm.c +++ b/src

Re: [PATCH rfcv4 09/13] qemu: add FakeReboot support for TDX guest

2024-10-21 Thread Hector Cao
By "REBOOTED", do you mean VIR_DOMAIN_EVENT_STARTED_REBOOTED ? If yes, do you suggest adding this detail/reason to each lifecycle event caused by a reboot ? Then, we will also have : - VIR_DOMAIN_EVENT_SHUTDOWN_REBOOTED - VIR_DOMAIN_EVENT_STOPPED_REBOOTED - VIR_DOMAIN_EVENT_RESUMED_REBOOTED Best

Re: [PATCH rfcv4 09/13] qemu: add FakeReboot support for TDX guest

2024-10-21 Thread Daniel P . Berrangé
On Mon, Oct 21, 2024 at 03:14:13PM +0200, Hector Cao wrote: > By "REBOOTED", do you mean VIR_DOMAIN_EVENT_STARTED_REBOOTED ? > > If yes, do you suggest adding this detail/reason to each lifecycle event > caused by a reboot ? > > Then, we will also have : > - VIR_DOMAIN_EVENT_SHUTDOWN_REBOOTED > -

Re: [PATCH rfcv4 09/13] qemu: add FakeReboot support for TDX guest

2024-10-21 Thread Daniel P . Berrangé
On Mon, Oct 21, 2024 at 12:34:23PM -, hector@canonical.com wrote: > Hello Zhenzhong and Daniel, > > With this implementation, upon TD reboot, some events > VIR_DOMAIN_EVENT_ID_LIFECYCLE are emitted (STARTED, STOPPED and probably > SHUTDOWN and RESUMED). > > For normal VM, only the event

Re: [PATCH rfcv4 09/13] qemu: add FakeReboot support for TDX guest

2024-10-21 Thread hector . cao
Hello Zhenzhong and Daniel, With this implementation, upon TD reboot, some events VIR_DOMAIN_EVENT_ID_LIFECYCLE are emitted (STARTED, STOPPED and probably SHUTDOWN and RESUMED). For normal VM, only the event VIR_DOMAIN_EVENT_ID_REBOOT is emitted. Do you think it is good to align the API for TD

Re: [PATCH v3 3/5] schema: add TPM emulator

2024-10-21 Thread Daniel P . Berrangé
On Mon, Oct 21, 2024 at 03:06:13PM +0400, Marc-André Lureau wrote: > Hi > > On Mon, Oct 14, 2024 at 5:41 PM Daniel P. Berrangé > wrote: > > > > On Mon, Oct 14, 2024 at 09:35:14AM -0400, Stefan Berger wrote: > > > > > > > > > On 10/14/24 5:17 AM, Daniel P. Berrangé wrote: > > > > On Fri, Oct 11,

Re: [PATCH v3 3/5] schema: add TPM emulator

2024-10-21 Thread Marc-André Lureau
Hi On Mon, Oct 14, 2024 at 5:41 PM Daniel P. Berrangé wrote: > > On Mon, Oct 14, 2024 at 09:35:14AM -0400, Stefan Berger wrote: > > > > > > On 10/14/24 5:17 AM, Daniel P. Berrangé wrote: > > > On Fri, Oct 11, 2024 at 10:16:51AM -0400, Stefan Berger wrote: > > > > > > > > > > > > On 10/11/24 10:10

Re: [PATCH 0/3] Report CPU model blockers in domain capabilities

2024-10-21 Thread Ján Tomko
On a Friday in 2024, Jiri Denemark wrote: Jiri Denemark (3): domain_capabilities: Sort CPU models domain_capabilities: Report CPU blockers NEWS: Report CPU model blockers in domain capabilities NEWS.rst | 6 + docs/formatdomaincaps.rst

Re: [PATCH v3 09/10] qemu: Move adding of keys to swtpm command line into own function

2024-10-21 Thread Marc-André Lureau
On Sat, Oct 19, 2024 at 12:24 AM Stefan Berger wrote: > > Factor-out code related to adding key to the swtpm command line into its > own function. > > Signed-off-by: Stefan Berger Reviewed-by: Marc-André Lureau > --- > src/qemu/qemu_tpm.c | 60 +++-- >

Re: [PATCH v3 08/10] qemu: Extend swtpm_setup command line to set a profile by its name

2024-10-21 Thread Marc-André Lureau
On Sat, Oct 19, 2024 at 12:24 AM Stefan Berger wrote: > > Run swtpm_setup with the --profile-name option if the user provided the > name of a profile. swtpm_setup will try to load the profile from > directories with local profiles and distro profiles and if no profile > by this name with appended