Re: [PATCH] build: Require glib >= 2.56

2021-03-01 Thread Peter Krempa
On Mon, Mar 01, 2021 at 16:00:47 -0700, Jim Fehlig wrote: > There are a few uses of g_autoslist in the qemu driver and likely > more will come throughout the codebase in the future. g_autoslist > first appeared in glib 2.56, so bump the minimum version. > >

Re: [PATCH] hyperv: Fix 32bit compilation

2021-03-01 Thread Matt Coleman
> On Mar 1, 2021, at 1:54 PM, Cole Robinson wrote: > > Example: > ../src/hyperv/hyperv_driver.c:3007:54: error: format ‘%lu’ expects argument > of type ‘long unsigned int’, but argument 7 has type ‘size_t’ {aka ‘unsigned > int’} [-Werror=format=] > 3007 |

[PATCH] build: Require glib >= 2.56

2021-03-01 Thread Jim Fehlig
There are a few uses of g_autoslist in the qemu driver and likely more will come throughout the codebase in the future. g_autoslist first appeared in glib 2.56, so bump the minimum version. https://developer.gnome.org/glib/stable/glib-Miscellaneous-Macros.html#g-autoslist Signed-off-by: Jim

[PATCH] libxl: Fix node device detach when driver unspecified

2021-03-01 Thread Jim Fehlig
Commit 887dd0d331 caused a small regression in NodeDeviceDetach in the libxl driver when the 'driver' parameter is not specified. E.g. error: Failed to detach device pci__0a_10_0 error: An error occurred, but the cause is unknown If the driver name is not specified, NULL is passed to

Re: [PATCH v2 0/3] Use g_autoptr and g_autofree

2021-03-01 Thread Laine Stump
On 2/25/21 6:51 AM, Kristina Hanicova wrote: This is v2 from https://listman.redhat.com/archives/libvir-list/2021-February/msg01129.html I changed variable names in patch 1/3 as suggested by Laine. Patches 2/3 and 3/3 have already been reviewed-by and I am sending them for completeness. This

[libvirt PATCH] cpu_map: Add EPYC-Milan x86 CPU model

2021-03-01 Thread Jiri Denemark
Introduced in QEMU 6.0.0 by 623972ceae091b31331ae4a1dc94fe5cbb891937 Signed-off-by: Jiri Denemark --- src/cpu_map/index.xml | 1 + src/cpu_map/x86_EPYC-Milan.xml | 92 ++ 2 files changed, 93 insertions(+) create mode 100644

Re: [libvirt PATCH 0/5] cpu_map: Sync with Qemu

2021-03-01 Thread Jiri Denemark
On Mon, Feb 22, 2021 at 13:20:05 +0100, Tim Wiederhake wrote: > Qemu updated its list of known cpu features. Follow suit. > > Tim Wiederhake (5): > cpu_map/sync_qemu_i386.py: Add mapping for amd-ssbd > cpu_map/sync_qemu_i386.py: Add mapping for ibrs > cpu_map/sync_qemu_i386.py: Add mapping

[PATCH] hyperv: Fix 32bit compilation

2021-03-01 Thread Cole Robinson
Example: ../src/hyperv/hyperv_driver.c:3007:54: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘size_t’ {aka ‘unsigned int’} [-Werror=format=] 3007 | virReportError(VIR_ERR_INTERNAL_ERROR, _("Could not attach serial port %lu"), i);

Re: using libvirt 4.5 with upstream qemu

2021-03-01 Thread Daniel Henrique Barboza
On 3/1/21 12:47 PM, Peter Krempa wrote: On Mon, Mar 01, 2021 at 15:30:58 +, Thanos Makatos wrote: I'm trying to use QEMU master with libvirt 4.5 and QEMU seems to be hanging when I try to start a guest. My environment is a modified CentOS 7.9 installation using libvirt 4.5.0. When I use

Re: [PATCH] tools: Fix dry run of libvirt_recover_xattrs.sh

2021-03-01 Thread Ján Tomko
On a Monday in 2021, Michal Privoznik wrote: The libvirt_recover_xattrs.sh script can be used to remove stale XATTRs that were left behind by secdrivers (which should happen only if there' an imbalance between set and restore calls). *there's Anyway, the script has '-n' switch which is

Re: [PATCH 3/4] qemu_tpm: Drop @logDir argument from qemuTPMEmulatorPrepareHost()

2021-03-01 Thread Ján Tomko
On a Monday in 2021, Michal Privoznik wrote: After previous commit, the log directory doesn't have to be passed as an extra argument but can be deducted from logfile path. I'm not convinced this is an improvement. From the execution point of view it's one passed argument vs finding a slash

Re: [PATCH 2/4] qemu_tpm: Generate log file path among with storage path

2021-03-01 Thread Ján Tomko
On a Monday in 2021, Michal Privoznik wrote: When starting a guest with TPM of type='emulator' an external process is started with it (swtmp) to emulat TPM. This external *swtpm *emulate process is passed path to a log file via --logfile. The path to the log file is generated in

Re: [PATCH 1/4] qemu_tpm: Move logfile path generation into a separate function

2021-03-01 Thread Ján Tomko
On a Monday in 2021, Michal Privoznik wrote: Strictly not needed, but the rest of paths is generated in separate functions. Helps with code readability. Signed-off-by: Michal Privoznik --- src/qemu/qemu_tpm.c | 17 - 1 file changed, 16 insertions(+), 1 deletion(-)

Re: [PATCH 4/4] virtmp: Fix @path handling in virTPMEmulatorInit()

2021-03-01 Thread Ján Tomko
*tpm On a Monday in 2021, Michal Privoznik wrote: This function finds "swtmp", "swtpm_setup" and "swtpm_ioctl" binaries in $PATH and stores resolved paths in global variables so that they can be obtainer later. Anyway, the resolved path is marked as g_autofree and to avoid its freeing later on

[PATCH 4/4] virtmp: Fix @path handling in virTPMEmulatorInit()

2021-03-01 Thread Michal Privoznik
This function finds "swtmp", "swtpm_setup" and "swtpm_ioctl" binaries in $PATH and stores resolved paths in global variables so that they can be obtainer later. Anyway, the resolved path is marked as g_autofree and to avoid its freeing later on in the function the variable is set to NULL manually.

[PATCH 2/4] qemu_tpm: Generate log file path among with storage path

2021-03-01 Thread Michal Privoznik
When starting a guest with TPM of type='emulator' an external process is started with it (swtmp) to emulat TPM. This external process is passed path to a log file via --logfile. The path to the log file is generated in qemuTPMEmulatorPrepareHost() which works, until the daemon is restarted. The

[PATCH 1/4] qemu_tpm: Move logfile path generation into a separate function

2021-03-01 Thread Michal Privoznik
Strictly not needed, but the rest of paths is generated in separate functions. Helps with code readability. Signed-off-by: Michal Privoznik --- src/qemu/qemu_tpm.c | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_tpm.c b/src/qemu/qemu_tpm.c

[PATCH 3/4] qemu_tpm: Drop @logDir argument from qemuTPMEmulatorPrepareHost()

2021-03-01 Thread Michal Privoznik
After previous commit, the log directory doesn't have to be passed as an extra argument but can be deducted from logfile path. Signed-off-by: Michal Privoznik --- src/qemu/qemu_tpm.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_tpm.c

[PATCH 0/4] qemu_tmp: Generate log file path for emulated TPMs more frequently

2021-03-01 Thread Michal Privoznik
The real fix is in 2/4 and the rest is just cleanups. Long story short, the path to log file is not stored anywhere and thus is forgotten on libvirtd restart which means it's seclabel is not restored properly. Michal Prívozník (4): qemu_tpm: Move logfile path generation into a separate function

[PATCH] tools: Fix dry run of libvirt_recover_xattrs.sh

2021-03-01 Thread Michal Privoznik
The libvirt_recover_xattrs.sh script can be used to remove stale XATTRs that were left behind by secdrivers (which should happen only if there' an imbalance between set and restore calls). Anyway, the script has '-n' switch which is supposed to perform just a dry run, i.e. just to report which

Re: [PATCH 1/4] vsh-table: Use g_autofree where possible

2021-03-01 Thread Ján Tomko
On a Thursday in 2021, Michal Privoznik wrote: On 2/25/21 1:20 PM, Ján Tomko wrote: On a Tuesday in 2021, Kristina Hanicova wrote: In: vshTableRowNew(), vshTablePrint(), vshTablePrintToStdout(). Signed-off-by: Kristina Hanicova --- tools/vsh-table.c | 16 +--- 1 file changed, 5

Re: using libvirt 4.5 with upstream qemu

2021-03-01 Thread Peter Krempa
On Mon, Mar 01, 2021 at 15:30:58 +, Thanos Makatos wrote: > I'm trying to use QEMU master with libvirt 4.5 and QEMU seems to be hanging > when I try to start a guest. > > My environment is a modified CentOS 7.9 installation using libvirt 4.5.0. When > I use a modified version of QEMU 2.12

RE: using libvirt 4.5 with upstream qemu

2021-03-01 Thread Thanos Makatos
> -Original Message- > From: Daniel P. Berrangé > Sent: 01 March 2021 15:39 > To: Thanos Makatos > Cc: libvir-list@redhat.com > Subject: Re: using libvirt 4.5 with upstream qemu > > On Mon, Mar 01, 2021 at 03:30:58PM +, Thanos Makatos wrote: > > I'm trying to use QEMU master with

Re: using libvirt 4.5 with upstream qemu

2021-03-01 Thread Daniel P . Berrangé
On Mon, Mar 01, 2021 at 03:30:58PM +, Thanos Makatos wrote: > I'm trying to use QEMU master with libvirt 4.5 and QEMU seems to be hanging > when I try to start a guest. > > My environment is a modified CentOS 7.9 installation using libvirt 4.5.0. When > I use a modified version of QEMU 2.12

Re: [libvirt PATCH v4 00/25] Add support for persistent mediated devices

2021-03-01 Thread Erik Skultety
On Wed, Feb 24, 2021 at 04:48:34PM -0600, Jonathon Jongsma wrote: > On Mon, 22 Feb 2021 11:08:12 +0100 > Erik Skultety wrote: > > > On Wed, Feb 03, 2021 at 11:38:44AM -0600, Jonathon Jongsma wrote: > > > This patch series follows the previously-merged series which added > > > support for

using libvirt 4.5 with upstream qemu

2021-03-01 Thread Thanos Makatos
I'm trying to use QEMU master with libvirt 4.5 and QEMU seems to be hanging when I try to start a guest. My environment is a modified CentOS 7.9 installation using libvirt 4.5.0. When I use a modified version of QEMU 2.12 (reasonably close to the stock CentOS version) everything works fine. When

Re: [PATCH] Use g_steal_pointer where possible

2021-03-01 Thread Ján Tomko
On a Tuesday in 2021, Ján Tomko wrote: On a Tuesday in 2021, Kristina Hanicova wrote: [...] 21 files changed, 45 insertions(+), 90 deletions(-) Reviewed-by: Ján Tomko Now pushed. Jano signature.asc Description: PGP signature

Re: [PATCH 20/33] Don't report OOM error on xmlCopyNode failure

2021-03-01 Thread Peter Krempa
On Wed, Feb 24, 2021 at 22:25:56 -0500, Laine Stump wrote: > On 2/24/21 11:16 AM, Peter Krempa wrote: > > Out of memory isn't the only reason the function can fail. Add a message > > stating that copying of a XML node failed. > > Could it still fail due to OOM as well, though? And if so, is there

Re: [PATCH 2/4] docs: Lift restriction on running API from the event loop thread

2021-03-01 Thread Eric Blake
On 3/1/21 5:49 AM, Michal Privoznik wrote: > Since v6.2.0-rc1~238 (and friends) QMP processing was moved to a > per-domain thread. Therefore, it is now safe to call APIs from > the event loop thread (e.g. just like qemu shim is doing in > qemuShimEventLoop(). However, it is still important to let

Re: [PATCH 0/2] backup: Don't try to update stats if VM isn't alive

2021-03-01 Thread Michal Privoznik
On 2/25/21 2:29 PM, Peter Krempa wrote: Doing so results in a crash. Peter Krempa (2): qemuBackupJobTerminate: Move cleanup of temp files earlier qemuBackupJobTerminate: Don't calculate backup job stats if VM isn't active src/qemu/qemu_backup.c | 33

Re: [PATCH 0/4] Storage volume (crash) fixes

2021-03-01 Thread Michal Privoznik
On 2/25/21 2:26 PM, Peter Krempa wrote: Patch 1/4 should go into this release, the rest can wait. Peter Krempa (4): storageBackendProbeTarget: Check return value of virStorageSourceNewFromBacking storageBackendProbeTarget: Don't fail if backing store can't be parsed

Re: [PATCH 3/4] virStorageVolDefFormat: Extract formatting of source extents

2021-03-01 Thread Michal Privoznik
On 2/25/21 2:26 PM, Peter Krempa wrote: Move the extent formatting code into virStorageVolDefFormatSourceExtents. Signed-off-by: Peter Krempa --- src/conf/storage_conf.c | 53 +++-- 1 file changed, 30 insertions(+), 23 deletions(-) diff --git

Re: [PATCH v2 19/31] qapi/qom: QAPIfy object-add

2021-03-01 Thread Paolo Bonzini
On 01/03/21 12:54, Kevin Wolf wrote: Please add a check in object_property_add_child that the id is well formed (using the id_wellformed function). This is pre-existing, but it becomes a regression for -object later in the series. Are the conditions for internally called

Re: [PATCH v2 19/31] qapi/qom: QAPIfy object-add

2021-03-01 Thread Kevin Wolf
Am 26.02.2021 um 12:30 hat Paolo Bonzini geschrieben: > On 24/02/21 14:52, Kevin Wolf wrote: > > +v = qobject_output_visitor_new(); > > +visit_type_ObjectOptions(v, NULL, , _abort); > > +visit_complete(v, ); > > +visit_free(v); > > + > > +props = qobject_to(QDict, qobj); > > +

[PATCH 4/4] qemu_shim: Always pre-create root dir

2021-03-01 Thread Michal Privoznik
This problem is reproducible only with secret driver. When starting a domain via virt-qemu-run and both secret and (nonexistent) root directory specified this is what happens: 1) virt-qemu-run opens "secret:///embed?root=$rootdir" connection, which results in the secret driver initialization

[PATCH 1/4] qemu_shim: Don't hang if failed to start domain

2021-03-01 Thread Michal Privoznik
The qemu shim spawns a separate thread in which the event loop is ran. The virEventRunDefaultImpl() call is wrapped in a while() loop, just like it should. There are few lines of code around which try to ensure that domain is destroyed (when quitting) and that the last round of event loop is ran

[PATCH 2/4] docs: Lift restriction on running API from the event loop thread

2021-03-01 Thread Michal Privoznik
Since v6.2.0-rc1~238 (and friends) QMP processing was moved to a per-domain thread. Therefore, it is now safe to call APIs from the event loop thread (e.g. just like qemu shim is doing in qemuShimEventLoop(). However, it is still important to let the event loop run after each API call (obviously).

[PATCH 0/4] Couple of qemu:///embed related fixes

2021-03-01 Thread Michal Privoznik
*** BLURB HERE *** Michal Prívozník (4): qemu_shim: Don't hang if failed to start domain docs: Lift restriction on running API from the event loop thread virConnectOpen: Require root dir to be absolute path qemu_shim: Always pre-create root dir docs/drvqemu.html.in | 8 ++--

[PATCH 3/4] virConnectOpen: Require root dir to be absolute path

2021-03-01 Thread Michal Privoznik
In theory, users might want to use a relative path as a root directory for embed drivers. But in practice, nothing in driver initialization (specifically QEMU driver since it's the only one that supports embedding now), is prepared for that. Document and enforce absolute paths. Resolves:

Re: [PATCH] build-aux: increase tests timeout

2021-03-01 Thread Daniel P . Berrangé
On Mon, Mar 01, 2021 at 03:34:00PM +0400, Roman Bogorodskiy wrote: > Daniel P. Berrangé wrote: > > > On Sun, Feb 28, 2021 at 05:00:01PM +0400, Roman Bogorodskiy wrote: > > > Peter Krempa wrote: > > > > > > > On Sun, Feb 28, 2021 at 08:24:58 +0400, Roman Bogorodskiy wrote: > > > > > Meson

Re: [PATCH] build-aux: increase tests timeout

2021-03-01 Thread Roman Bogorodskiy
Daniel P. Berrangé wrote: > On Sun, Feb 28, 2021 at 05:00:01PM +0400, Roman Bogorodskiy wrote: > > Peter Krempa wrote: > > > > > On Sun, Feb 28, 2021 at 08:24:58 +0400, Roman Bogorodskiy wrote: > > > > Meson default timeout for test() is 30 seconds. This may be not enough > > > > for some

Re: [PATCH 00/14] deprecations: remove many old deprecations

2021-03-01 Thread Kevin Wolf
Am 25.02.2021 um 18:32 hat Jim Fehlig geschrieben: > Adding xen-devel and Ian to cc. > > On 2/24/21 6:11 AM, Daniel P. Berrangé wrote: > > The following features have been deprecated for well over the 2 > > release cycle we promise > > This reminded me of a bug report we received late last year

Release of libvirt-7.1.0

2021-03-01 Thread Jiri Denemark
The 7.1.0 release of both libvirt and libvirt-python is tagged and signed tarballs and source RPMs are available at https://libvirt.org/sources/ https://libvirt.org/sources/python/ Thanks everybody who helped with this release by sending patches, reviewing, testing, or providing any

Re: [PATCH] build-aux: increase tests timeout

2021-03-01 Thread Daniel P . Berrangé
On Sun, Feb 28, 2021 at 05:00:01PM +0400, Roman Bogorodskiy wrote: > Peter Krempa wrote: > > > On Sun, Feb 28, 2021 at 08:24:58 +0400, Roman Bogorodskiy wrote: > > > Meson default timeout for test() is 30 seconds. This may be not enough > > > for some tests like sc_prohibit_nonreentrant or > >

[PATCH 3/4] lib: Replace virFileMakePath() with g_mkdir_with_parents()

2021-03-01 Thread Michal Privoznik
Generated using the following spatch: @@ expression path; @@ - virFileMakePath(path) + g_mkdir_with_parents(path, 0777) However, 14 occurrences were not replaced, e.g. in virHostdevManagerNew(). I don't really understand why. Fixed by hand afterwards. Signed-off-by: Michal Privoznik

[PATCH 1/4] virfile: Replace virFileMakePathHelper() with g_mkdir_with_parents()

2021-03-01 Thread Michal Privoznik
Our virFileMakePathHelper() does exactly the same as g_mkdir_with_parents() except for printing a debug message. Well, tough luck. Replace the former with the latter. Signed-off-by: Michal Privoznik --- src/util/virfile.c | 47 ++ 1 file changed, 2

[PATCH 4/4] util: Drop virFileMakePath() and virFileMakePathWithMode()

2021-03-01 Thread Michal Privoznik
These functions are now unused. Signed-off-by: Michal Privoznik --- src/libvirt_private.syms | 2 -- src/util/virfile.c | 20 src/util/virfile.h | 3 --- 3 files changed, 25 deletions(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index

[PATCH 2/4] lib: Replace virFileMakePathWithMode() with g_mkdir_with_parents()

2021-03-01 Thread Michal Privoznik
These functions are identical. Made using this spatch: @@ expression path, mode; @@ - virFileMakePathWithMode(path, mode) + g_mkdir_with_parents(path, mode) Signed-off-by: Michal Privoznik --- src/interface/interface_backend_netcf.c | 2 +- src/interface/interface_backend_udev.c | 2

[PATCH 0/4] Replace virFileMakePath*() with g_mkdir_with_parents()

2021-03-01 Thread Michal Privoznik
While reading through glib manual I've noticed there's g_mkdir_with_parents() which does the same as our virFileMakePath() and virFileMakePathWithMode(). Michal Prívozník (4): virfile: Replace virFileMakePathHelper() with g_mkdir_with_parents() lib: Replace virFileMakePathWithMode() with