[libvirt PATCH v5 08/32] qemu: Add qemuNbdkitProcess

2023-02-14 Thread Jonathon Jongsma
-by: Jonathon Jongsma Reviewed-by: Peter Krempa --- src/qemu/qemu_conf.c | 22 src/qemu/qemu_conf.h | 2 ++ src/qemu/qemu_domain.c | 31 src/qemu/qemu_domain.h | 4 +++ src/qemu/qemu_nbdkit.c | 82 ++ src/qemu/qemu_nbdkit.h | 26

[libvirt PATCH v5 06/32] qemu: implement persistent file cache for nbdkit caps

2023-02-14 Thread Jonathon Jongsma
Implement the loadFile and saveFile virFileCacheHandlers callbacks so that nbdkit capabilities are cached perstistently across daemon restarts. The format and implementation is modeled on the qemu capabilities, but simplified slightly. Signed-off-by: Jonathon Jongsma Reviewed-by: Peter Krempa

[libvirt PATCH v5 07/32] qemu: use file cache for nbdkit caps

2023-02-14 Thread Jonathon Jongsma
Add the virFileCache implementation for nbdkit capabilities to the qemu driver. This allows us to determine whether nbdkit is installed and which plugins are supported. it also has persistent caching and the capabilities are re-queried whenever something changes. Signed-off-by: Jonathon Jongsma

[libvirt PATCH v5 17/32] qemu: split qemuDomainSecretStorageSourcePrepare

2023-02-14 Thread Jonathon Jongsma
This prepares encryption secrets and authentication secrets. When we add nbdkit-backed network storage sources, we will not need to send authentication secrets to qemu, since they will be sent to nbdkit instead. So split this into two different functions. Signed-off-by: Jonathon Jongsma Reviewed

[libvirt PATCH v5 15/32] qemu: log error output from nbdkit

2023-02-14 Thread Jonathon Jongsma
log stderr and stdout from nbdkit into its own log so that nbdkit-related issues can be debugged more easily. Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_nbdkit.c | 30 +- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_nbdkit.c b

[libvirt PATCH v5 04/32] util: Allow virFileCache data to be any GObject

2023-02-14 Thread Jonathon Jongsma
Since the libvirt documentation suggests to prefer GObject over virObject, and since virObject is a GObject, change virFileCache to allow GObjects as data. Signed-off-by: Jonathon Jongsma Reviewed-by: Peter Krempa --- src/util/virfilecache.c | 14 -- src/util/virfilecache.h | 2

[libvirt PATCH v5 03/32] qemu: expand nbdkit capabilities

2023-02-14 Thread Jonathon Jongsma
. Signed-off-by: Jonathon Jongsma Reviewed-by: Peter Krempa --- src/qemu/qemu_nbdkit.c | 42 ++ 1 file changed, 42 insertions(+) diff --git a/src/qemu/qemu_nbdkit.c b/src/qemu/qemu_nbdkit.c index 9ff293698d..486df8c161 100644 --- a/src/qemu/qemu_nbdkit.c +++ b

[libvirt PATCH v5 00/32] Use nbdkit for http/ftp/ssh network drives in libvirt

2023-02-14 Thread Jonathon Jongsma
nbdkit when libvirt restarts if nbdkit has died in the meantime - simplify ownership of event data used for monitoring and restart of nbdkit process - other smaller changes suggested by Peter in v4 Jonathon Jongsma (32): schema: allow 'ssh' as a protocol for network disks qemu: Add

Re: [libvirt PATCH v4 19/31] qemu: pass sensitive data to nbdkit via pipe

2023-02-07 Thread Jonathon Jongsma
On 2/7/23 10:51 AM, Peter Krempa wrote: On Fri, Jan 20, 2023 at 16:03:13 -0600, Jonathon Jongsma wrote: ... @@ -759,6 +765,29 @@ qemuNbdkitInitStorageSource(qemuNbdkitCaps *caps, } +static int +qemuNbdkitCommandPassDataByPipe(virCommand *cmd, +const

Re: [PATCH] qemu: implement QEMU NBD source reconnect delay attribute

2023-01-27 Thread Jonathon Jongsma
On 1/27/23 8:40 AM, Christian Nautze wrote: Hi! Is it possible to get a review on this  patch I send before Christmas? :) Thank you! Christian _ Currently it's only possible to set this parameter during domain creation via QEMU

[libvirt PATCH v6 6/8] conf: add support for 'blob' in virtio video device

2023-01-25 Thread Jonathon Jongsma
://lists.freedesktop.org/archives/dri-devel/2020-August/275972.html https://www.kraxel.org/blog/2021/05/virtio-gpu-qemu-graphics-update/ Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2032406 Signed-off-by: Jonathon Jongsma Reviewed-by: Ján Tomko --- docs/formatdomain.rst | 7 +++ src

[libvirt PATCH v6 2/8] conf: Refactor video model parsing

2023-01-25 Thread Jonathon Jongsma
Factor out a separate function to parse out the element for video devices. Signed-off-by: Jonathon Jongsma Reviewed-by: Ján Tomko --- src/conf/domain_conf.c | 91 ++ 1 file changed, 56 insertions(+), 35 deletions(-) diff --git a/src/conf/domain_conf.c

[libvirt PATCH v6 7/8] qemu: Add capability for virtio-gpu.blob

2023-01-25 Thread Jonathon Jongsma
Capability to determine whether this qemu supports the 'blob' option for virtio-gpu. Signed-off-by: Jonathon Jongsma Reviewed-by: Ján Tomko --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + tests/qemucapabilitiesdata

[libvirt PATCH v6 4/8] conf: switch to virXMLProp* functions for parsing video

2023-01-25 Thread Jonathon Jongsma
In virDomainVideoModelDefParseXML(), use the virXMLProp* functions rather than reimplementing them with virXPath* functions. Signed-off-by: Jonathon Jongsma Reviewed-by: Ján Tomko --- src/conf/domain_conf.c | 73 -- 1 file changed, 20 insertions(+), 53

[libvirt PATCH v6 8/8] qemu: Implement 'blob' support for virtio gpu

2023-01-25 Thread Jonathon Jongsma
This can improve performance for some guests since it reduces copying of display data between host and guest. Requires udmabuf on the host. Signed-off-by: Jonathon Jongsma Reviewed-by: Ján Tomko --- src/qemu/qemu_cgroup.c| 22 ++--- src/qemu/qemu_command.c

[libvirt PATCH v6 3/8] util: add virXMLPropUIntDefault() function

2023-01-25 Thread Jonathon Jongsma
This function allows you to specify a default value to return if the property is not found rather than always setting *result to 0. Signed-off-by: Jonathon Jongsma --- src/conf/cpu_conf.c| 9 +++-- src/conf/domain_conf.c | 6 +- src/conf/numa_conf.c | 7 +-- src/util

[libvirt PATCH v6 5/8] conf: use enum variable for video type

2023-01-25 Thread Jonathon Jongsma
Rather than storing the video type as an integer, use the proper enum type within the struct. Signed-off-by: Jonathon Jongsma Reviewed-by: Ján Tomko --- src/conf/domain_conf.c | 4 +--- src/conf/domain_conf.h | 2 +- src/libxl/libxl_conf.c | 10 ++ src/libxl

[libvirt PATCH v6 1/8] conf: explicitly set VIR_DOMAIN_VIDEO_TYPE_DEFAULT to 0

2023-01-25 Thread Jonathon Jongsma
Ensure that new virDomainVideoDef objects have their 'type' set to VIR_DOMAIN_VIDEO_TYPE_DEFAULT and remove places that this value is set after construction. Since virDomainVideoDefNew() uses g_new0() allocate the instance, all fields are initialized to 0. Signed-off-by: Jonathon Jongsma

[libvirt PATCH v6 0/8] Add support for 'blob' to virtio video device

2023-01-25 Thread Jonathon Jongsma
the revised series. So here's a v6 after rebasing yet again to current master. changes in v6: - added two new patches: - conf: explicitly set VIR_DOMAIN_VIDEO_TYPE_DEFAULT to 0 - util: add virXMLPropUIntDefault() function - other minor fixes from Jan's review Jonathon Jongsma (8): conf

[libvirt PATCH v4 28/31] schema: add configuration for host verification of ssh disks

2023-01-20 Thread Jonathon Jongsma
In order to make ssh disks usable, we need to be able to validate a remote host. To do this, add a xml element for ssh disks to allow the user to specify a location for a file that contains known host keys. Implementation to follow. Signed-off-by: Jonathon Jongsma --- docs/formatdomain.rst

[libvirt PATCH v4 09/31] qemu: query nbdkit module dir from binary

2023-01-20 Thread Jonathon Jongsma
`nbdkit --version` separately. Signed-off-by: Jonathon Jongsma --- meson.build| 6 meson_options.txt | 1 - src/qemu/qemu_nbdkit.c | 75 +- 3 files changed, 60 insertions(+), 22 deletions(-) diff --git a/meson.build b/meson.build index

[libvirt PATCH v4 20/31] qemu: use nbdkit to serve network disks if available

2023-01-20 Thread Jonathon Jongsma
For virStorageSource objects that contain an nbdkitProcess, start that nbdkit process to serve that network drive and then pass the nbdkit socket to qemu rather than sending the network url to qemu directly. Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_block.c | 162

[libvirt PATCH v4 12/31] Generalize qemuDomainLogContextNew()

2023-01-20 Thread Jonathon Jongsma
Allow to specify a basename for the log file so that qemuDomainLogContextNew() can be used to create log contexts for secondary loggers. Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_domain.c | 5 +++-- src/qemu/qemu_domain.h | 3 ++- src/qemu/qemu_process.c | 2 +- 3 files changed, 6

[libvirt PATCH v4 19/31] qemu: pass sensitive data to nbdkit via pipe

2023-01-20 Thread Jonathon Jongsma
Rather than passing passwords and cookies (which could contain passwords) to nbdkit via commandline arguments, use the alternate format that nbdkit supports where we can specify a file descriptor which nbdkit will read to get the password or cookies. Signed-off-by: Jonathon Jongsma --- src/qemu

[libvirt PATCH v4 02/31] qemu: Add functions for determining nbdkit availability

2023-01-20 Thread Jonathon Jongsma
In future commits, we will optionally use nbdkit to serve some remote disk sources. This patch queries to see whether nbdkit is installed on the host and queries it for capabilities. The data will be used in later commits. Signed-off-by: Jonathon Jongsma Reviewed-by: Peter Krempa --- src/qemu

[libvirt PATCH v4 24/31] qemu: Monitor nbdkit process for exit

2023-01-20 Thread Jonathon Jongsma
was chosen somewhat arbitrarily. Signed-off-by: Jonathon Jongsma --- meson.build | 7 ++ src/qemu/qemu_nbdkit.c | 166 +++- src/qemu/qemu_nbdkit.h | 7 +- src/qemu/qemu_process.c | 4 +- 4 files changed, 177 insertions(+), 7 deletions(-) diff

[libvirt PATCH v4 17/31] qemu: split qemuDomainSecretStorageSourcePrepare

2023-01-20 Thread Jonathon Jongsma
This prepares encryption secrets and authentication secrets. When we add nbdkit-backed network storage sources, we will not need to send authentication secrets to qemu, since they will be sent to nbdkit instead. So split this into two different functions. Signed-off-by: Jonathon Jongsma Reviewed

[libvirt PATCH v4 27/31] qemu: implement password auth for ssh disks with nbdkit

2023-01-20 Thread Jonathon Jongsma
For ssh disks that are served by nbdkit, lookup the password from the configured secret and securely pass it to the nbdkit process using fd passing. Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_nbdkit.c| 87 ++- .../disk-network-ssh

[libvirt PATCH v4 23/31] qemu: add test for authenticating a https network disk

2023-01-20 Thread Jonathon Jongsma
Signed-off-by: Jonathon Jongsma Reviewed-by: Peter Krempa --- tests/qemunbdkitdata/disk-network-source-curl.args.disk1 | 4 +++- .../disk-network-source-curl.args.disk1.pipe.780 | 2 +- .../disk-network-source-curl.args.disk1.pipe.782 | 1 + tests/qemunbdkitdata

[libvirt PATCH v4 26/31] schema: add password configuration for ssh disk

2023-01-20 Thread Jonathon Jongsma
authentication. Implementation will follow. Signed-off-by: Jonathon Jongsma --- docs/formatdomain.rst | 27 ++- src/conf/schemas/domaincommon.rng | 23 ++- 2 files changed, 36 insertions(+), 14 deletions(-) diff --git

[libvirt PATCH v4 21/31] util: make virCommandSetSendBuffer testable

2023-01-20 Thread Jonathon Jongsma
Add a private function to peek at the list of send buffers in virCommand so that it is testable Signed-off-by: Jonathon Jongsma Reviewed-by: Peter Krempa --- src/libvirt_private.syms | 1 + src/util/vircommand.c | 17 + src/util/vircommand.h | 8 src/util

[libvirt PATCH v4 15/31] qemu: log error output from nbdkit

2023-01-20 Thread Jonathon Jongsma
log stderr and stdout from nbdkit into its own log so that nbdkit-related issues can be debugged more easily. Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_nbdkit.c | 28 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_nbdkit.c b/src

[libvirt PATCH v4 31/31] qemu: implement keyfile auth for ssh disk with nbdkit

2023-01-20 Thread Jonathon Jongsma
adds this key to an ssh agent, they can configure the disk with the path to the unix socket for the ssh agent so libvirt can pass this socket path to nbdkit and we can make use of these keys. Signed-off-by: Jonathon Jongsma --- src/conf/domain_conf.c| 36

[libvirt PATCH v4 29/31] qemu: implement knownHosts for ssh disks with nbdkit

2023-01-20 Thread Jonathon Jongsma
For ssh disks that are served by nbdkit, use the configured value for knownHosts and pass it to the nbdkit process. Signed-off-by: Jonathon Jongsma --- src/conf/domain_conf.c| 8 src/conf/storage_source_conf.c| 1 + src

[libvirt PATCH v4 22/31] tests: add tests for nbdkit invocation

2023-01-20 Thread Jonathon Jongsma
We were testing the arguments that were being passed to qemu when a disk was being served by nbdkit, but the arguments used to start nbdkit itself were not testable. This adds a test to ensure that we're invoking nbdkit correctly for various disk source definitions. Signed-off-by: Jonathon

[libvirt PATCH v4 25/31] qemu: try to connect to nbdkit early to detect errors

2023-01-20 Thread Jonathon Jongsma
eturned error: 404 error: Failed to start domain 'nbdkit-test' error: internal error: Failed to connect to nbdkit for 'http://localhost:/nonexistent.iso]: error: problem doing HEAD request to fetch size of URL [http://localhost:/nonexistent.iso]: HTTP response code said error:

[libvirt PATCH v4 16/31] tests: add ability to test various nbdkit capabilities

2023-01-20 Thread Jonathon Jongsma
Add new DO_TEST_CAPS_LATEST_NBDKIT macro to test xml2argv for various nbdkit capability scenarios. Signed-off-by: Jonathon Jongsma Reviewed-by: Peter Krempa --- src/qemu/qemu_nbdkit.c | 20 +--- tests/qemuxml2argvtest.c | 11 +++ tests/testutilsqemu.c| 27

[libvirt PATCH v4 18/31] qemu: include nbdkit state in private xml

2023-01-20 Thread Jonathon Jongsma
Add xml to the private data for a disk source to represent the nbdkit process so that the state can be re-created if the libvirt daemon is restarted. Format: /path/to/nbdkit.pid /path/to/nbdkit.socket Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_domain.c

[libvirt PATCH v4 10/31] qemu: add functions to start and stop nbdkit

2023-01-20 Thread Jonathon Jongsma
Add some helper functions to build a virCommand object and run the nbdkit process for a given virStorageSource. Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_nbdkit.c | 255 + src/qemu/qemu_nbdkit.h | 10 ++ 2 files changed, 265 insertions(+) diff

[libvirt PATCH v4 30/31] schema: add keyfile configuration for ssh disks

2023-01-20 Thread Jonathon Jongsma
: ... ... Signed-off-by: Jonathon Jongsma --- docs/formatdomain.rst | 8 src/conf/schemas/domaincommon.rng | 22 +- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst

[libvirt PATCH v4 07/31] qemu: use file cache for nbdkit caps

2023-01-20 Thread Jonathon Jongsma
Add the virFileCache implementation for nbdkit capabilities to the qemu driver. This allows us to determine whether nbdkit is installed and which plugins are supported. it also has persistent caching and the capabilities are re-queried whenever something changes. Signed-off-by: Jonathon Jongsma

[libvirt PATCH v4 08/31] qemu: Add qemuNbdkitProcess

2023-01-20 Thread Jonathon Jongsma
-by: Jonathon Jongsma --- src/qemu/qemu_conf.c | 22 src/qemu/qemu_conf.h | 2 ++ src/qemu/qemu_domain.c | 31 src/qemu/qemu_domain.h | 4 +++ src/qemu/qemu_nbdkit.c | 82 ++ src/qemu/qemu_nbdkit.h | 26 ++ 6 files

[libvirt PATCH v4 13/31] qemu: Extract qemuDomainLogContext into a new file

2023-01-20 Thread Jonathon Jongsma
This will allow us to use it for nbdkit logging in upcoming commits. Signed-off-by: Jonathon Jongsma --- po/POTFILES| 1 + src/qemu/meson.build | 1 + src/qemu/qemu_domain.c | 247 ++ src/qemu/qemu_domain.h | 29 +--- src/qemu

[libvirt PATCH v4 14/31] qemu: move qemuProcessReadLog() to qemuLogContext

2023-01-20 Thread Jonathon Jongsma
This code can be used by the nbdkit implementation for reading back filtered log data for error reporting. Move it to qemuLogContext so that it can be shared. Renamed to qemuLogContextReadFiltered(). Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_logcontext.c | 65

[libvirt PATCH v4 11/31] qemu: remove unused 'mode' param from qemuDomainLogContextNew()

2023-01-20 Thread Jonathon Jongsma
The only use of this function always passes QEMU_DOMAIN_LOG_CONTEXT_MODE_START. The other enum values are never used anywhere in the code. Remove them. Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_domain.c | 26 +++--- src/qemu/qemu_domain.h | 9 + src/qemu

[libvirt PATCH v4 03/31] qemu: expand nbdkit capabilities

2023-01-20 Thread Jonathon Jongsma
. Signed-off-by: Jonathon Jongsma Reviewed-by: Peter Krempa --- meson.build| 6 ++ meson_options.txt | 1 + src/qemu/qemu_nbdkit.c | 40 3 files changed, 47 insertions(+) diff --git a/meson.build b/meson.build index e498b49be4..ca02fde91b

[libvirt PATCH v4 06/31] qemu: implement persistent file cache for nbdkit caps

2023-01-20 Thread Jonathon Jongsma
Implement the loadFile and saveFile virFileCacheHandlers callbacks so that nbdkit capabilities are cached perstistently across daemon restarts. The format and implementation is modeled on the qemu capabilities, but simplified slightly. Signed-off-by: Jonathon Jongsma --- po/POTFILES

[libvirt PATCH v4 05/31] qemu: implement basic virFileCache for nbdkit caps

2023-01-20 Thread Jonathon Jongsma
Preparatory step for caching nbdkit capabilities. This patch implements the newData and isValid virFileCacheHandlers callback functions. Signed-off-by: Jonathon Jongsma Reviewed-by: Peter Krempa --- src/qemu/qemu_nbdkit.c | 89 +- src/qemu/qemu_nbdkit.h

[libvirt PATCH v4 00/31] Use nbdkit for http/ftp/ssh network drives in libvirt

2023-01-20 Thread Jonathon Jongsma
qemu - nbdkit output logged to a separate file - add missing support for hotplug - lots of smaller changes from Peter's review Jonathon Jongsma (31): schema: allow 'ssh' as a protocol for network disks qemu: Add functions for determining nbdkit availability qemu: expand nbdkit capabilities

[libvirt PATCH v4 04/31] util: Allow virFileCache data to be any GObject

2023-01-20 Thread Jonathon Jongsma
Since the libvirt documentation suggests to prefer GObject over virObject, and since virObject is a GObject, change virFileCache to allow GObjects as data. Signed-off-by: Jonathon Jongsma Reviewed-by: Peter Krempa --- src/util/virfilecache.c | 14 -- src/util/virfilecache.h | 2

[libvirt PATCH v4 01/31] schema: allow 'ssh' as a protocol for network disks

2023-01-20 Thread Jonathon Jongsma
There was support in the code for parsing protocol='ssh' on network disk sources, but it was not present in the xml schema. Add this to the schema and mention it in the documentation. Signed-off-by: Jonathon Jongsma --- src/conf/schemas/domaincommon.rng | 1 + tests/qemublocktest.c

Re: [PATCH 00/15] Clean up credential asking code in SSH transport

2023-01-17 Thread Jonathon Jongsma
- 9 files changed, 223 insertions(+), 359 deletions(-) See separate emails for a few comments on individual patches Reviewed-by: Jonathon Jongsma

Re: [PATCH 13/15] virNetLibsshCheckHostKey: Use virAuthAskCredential

2023-01-17 Thread Jonathon Jongsma
On 1/17/23 10:20 AM, Peter Krempa wrote: Signed-off-by: Peter Krempa --- src/rpc/virnetlibsshsession.c | 57 +-- 1 file changed, 7 insertions(+), 50 deletions(-) diff --git a/src/rpc/virnetlibsshsession.c b/src/rpc/virnetlibsshsession.c index

Re: [PATCH 10/15] virNetLibsshAuthenticateKeyboardInteractive: Use virAuthAskCredential

2023-01-17 Thread Jonathon Jongsma
not much point making this one any different than the others. Reviewed-by: Jonathon Jongsma On 1/17/23 10:20 AM, Peter Krempa wrote: Rework the code to use the new helper instead of open coding the auth callback interaction. Signed-off-by: Peter Krempa --- src/rpc/virnetlibsshsession.c | 47

Re: [PATCH 09/15] util: auth: Introduce virAuthAskCredential

2023-01-17 Thread Jonathon Jongsma
On 1/17/23 10:20 AM, Peter Krempa wrote: The helper uses the user-provided auth callbacks to ask the user. The helper encapsulates the steps we do to query the user in few places into a common helper which can be then used further. Signed-off-by: Peter Krempa --- src/libvirt_private.syms |

Re: [PATCH 06/15] virNetSSHSessionAuthAddPrivKeyAuth: Refactor cleanup

2023-01-17 Thread Jonathon Jongsma
On 1/17/23 10:20 AM, Peter Krempa wrote: With g_strdup not failing we can remove all of the 'error' section. Signed-off-by: Peter Krempa --- src/rpc/virnetsshsession.c | 18 +++--- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/src/rpc/virnetsshsession.c

Re: [PATCH 03/15] util: authconfig: Use automatic pointer clearing for virAuthConfig

2023-01-17 Thread Jonathon Jongsma
+return g_steal_pointer(); } Reviewed-by: Jonathon Jongsma

Re: [PATCH 07/36] virclosecallbacks: Add new close callbacks APIs

2023-01-06 Thread Jonathon Jongsma
On 1/5/23 10:29 AM, Peter Krempa wrote: The new APIs store the list of callbacks for a VM inside the virDomainObj and also allow registering multiple callbacks for a single domain and also for multiple connections. For now this code is dormant until each driver using the old APIs is not

Re: [PATCH 05/36] conf: virdomainobjlist: Remove return value from virDomainObjListCollect

2023-01-05 Thread Jonathon Jongsma
ObjListCollect(driver->domains, conn, , , +virConnectGetAllDomainStatsCheckACL, +lflags); } tmpstats = g_new0(virDomainStatsRecordPtr, ndoms + 1); Reviewed-by: Jonathon Jongsma

Re: [PATCH 04/36] conf: virdomainobjlist: Introduce 'virDomainObjListCollectAll'

2023-01-05 Thread Jonathon Jongsma
private.syms +++ b/src/libvirt_private.syms @@ -1209,6 +1209,7 @@ virDomainMomentObjNew; # conf/virdomainobjlist.h virDomainObjListAdd; virDomainObjListCollect; +virDomainObjListCollectAll; virDomainObjListConvert; virDomainObjListExport; virDomainObjListFindByID; Reviewed-by: Jonathon Jongsma

Re: [PATCH 03/36] conf: virdomainobjlist: Convert header to contemporary style

2023-01-05 Thread Jonathon Jongsma
skip_missing); Fine with me as long as others don't object to mass reformatting Reviewed-by: Jonathon Jongsma

Re: [PATCH 02/36] datatypes: Clean up whitespace in definition of struct _virConnect

2023-01-05 Thread Jonathon Jongsma
by domain driver as it pleases. * NB: 'private' is a reserved word in C++. */ -void *privateData; +void *privateData; /* * Object lock must be acquired before accessing/changing any of Reviewed-by: Jonathon Jongsma

Re: [PATCH 01/36] datatypes: Simplify error path of 'virGetDomain'

2023-01-05 Thread Jonathon Jongsma
strdup(name); ret->conn = virObjectRef(conn); @@ -306,10 +304,6 @@ virGetDomain(virConnectPtr conn, memcpy(&(ret->uuid[0]), uuid, VIR_UUID_BUFLEN); return ret; - - error: -virObjectUnref(ret); -return NULL; } /** Reviewed-by: Jonathon Jongsma

Re: [PATCH 0/9] use g_autofree

2023-01-05 Thread Jonathon Jongsma
| 27 ++ src/vmware/vmware_conf.c | 28 ++ src/vz/vz_utils.c | 18 ++-- 18 files changed, 237 insertions(+), 452 deletions(-) noted a couple minor comments in separate emails Reviewed-by: Jonathon Jongsma

Re: [PATCH 6/9] security: use g_autofree and remove unnecessary label

2023-01-05 Thread Jonathon Jongsma
On 1/5/23 6:26 AM, Jiang Jiacheng wrote: ... @@ -476,33 +459,29 @@ AppArmorGetSecurityProcessLabel(virSecurityManager *mgr G_GNUC_UNUSED, { int rc = -1; 'rc' variable doesn't seem to be used anymore. int status; -char *profile_name = NULL; +g_autofree char

Re: [PATCH 1/9] conf: use g_autofree and remove unnecessary label

2023-01-05 Thread Jonathon Jongsma
On 1/5/23 6:26 AM, Jiang Jiacheng wrote: Signed-off-by: Jiang Jiacheng ... diff --git a/src/conf/nwfilter_conf.c b/src/conf/nwfilter_conf.c index 9a95ae6c12..39f36ca29d 100644 --- a/src/conf/nwfilter_conf.c +++ b/src/conf/nwfilter_conf.c ... @@ -2571,8 +2564,8 @@

Re: [libvirt PATCH v3 09/18] qemu: add functions to start and stop nbdkit

2022-12-13 Thread Jonathon Jongsma
On 12/9/22 9:21 AM, Peter Krempa wrote: On Thu, Oct 20, 2022 at 16:59:00 -0500, Jonathon Jongsma wrote: Add some helper functions to build a virCommand object and run the nbdkit process for a given virStorageSource. Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_nbdkit.c | 251

Re: [libvirt PATCH v3 09/18] qemu: add functions to start and stop nbdkit

2022-12-09 Thread Jonathon Jongsma
On 12/9/22 4:09 AM, Peter Krempa wrote: On Thu, Oct 20, 2022 at 16:59:00 -0500, Jonathon Jongsma wrote: Add some helper functions to build a virCommand object and run the nbdkit process for a given virStorageSource. Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_nbdkit.c | 251

Re: [libvirt PATCH 15/21] meson: remove obsolete check for GET_VLAN_VID_CMD

2022-12-08 Thread Jonathon Jongsma
On 12/8/22 8:35 AM, Daniel P. Berrangé wrote: The ETHTOOL_GFEATURES constant has existed since before Linux moved to git. ^ This sentence mentions the wrong constant name. This is old enough that all our supported platforms can be assumed to have this feature. Signed-off-by: Daniel P.

Re: [libvirt PATCH 11/21] meson: remove obsolete check for ETH_FLAG_NTUPLE

2022-12-08 Thread Jonathon Jongsma
On 12/8/22 8:35 AM, Daniel P. Berrangé wrote: The ETH_FLAG_NTUPLE constant was introduced to Linux in commit 15682bc488d4af8c9bb998844a94281025e0a333 Author: Peter P Waskiewicz Jr Date: Wed Feb 10 20:03:05 2010 -0800 ethtool: Introduce n-tuple filter programming support This

Re: [libvirt PATCH v3 01/18] schema: allow 'ssh' as a protocol for network disks

2022-12-07 Thread Jonathon Jongsma
On 12/7/22 5:15 AM, Peter Krempa wrote: On Tue, Nov 15, 2022 at 12:07:18 +0100, Ján Tomko wrote: On a Thursday in 2022, Jonathon Jongsma wrote: There was support in the code for parsing protocol='ssh' on network disk sources, but it was not present in the xml schema. Add this to the schema

Re: [PATCH 0/9] Couple of virCommand related improvements

2022-11-30 Thread Jonathon Jongsma
| 10 +- tests/virnetsockettest.c | 3 +- tests/virshtest.c| 3 +- 19 files changed, 182 insertions(+), 136 deletions(-) create mode 100644 tests/commanddata/test29.log Reviewed-by: Jonathon Jongsma

[libvirt PATCH] qemu: fix memlock without vIOMMU

2022-11-17 Thread Jonathon Jongsma
Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_domain.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index ef1a9c8c74..8ae458ae45 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -9470,10

Re: [libvirt PATCH v5 2/6] conf: switch to virXMLProp* functions for parsing video

2022-11-08 Thread Jonathon Jongsma
On 11/7/22 1:45 AM, Ján Tomko wrote: On a Friday in 2022, Jonathon Jongsma wrote: In virDomainVideoModelDefParseXML(), use the virXMLProp* functions rather than reimplementing them with virXPath* functions. Signed-off-by: Jonathon Jongsma --- src/conf/domain_conf.c | 78

[libvirt PATCH v5 5/6] qemu: Add capability for virtio-gpu.blob

2022-11-04 Thread Jonathon Jongsma
Capability to determine whether this qemu supports the 'blob' option for virtio-gpu. Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml | 1

[libvirt PATCH v5 2/6] conf: switch to virXMLProp* functions for parsing video

2022-11-04 Thread Jonathon Jongsma
In virDomainVideoModelDefParseXML(), use the virXMLProp* functions rather than reimplementing them with virXPath* functions. Signed-off-by: Jonathon Jongsma --- src/conf/domain_conf.c | 78 +- 1 file changed, 23 insertions(+), 55 deletions(-) diff --git

[libvirt PATCH v5 6/6] qemu: Implement 'blob' support for virtio gpu

2022-11-04 Thread Jonathon Jongsma
This can improve performance for some guests since it reduces copying of display data between host and guest. Requires udmabuf on the host. Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_cgroup.c| 22 ++--- src/qemu/qemu_command.c | 3

[libvirt PATCH v5 3/6] conf: use enum variable for video type

2022-11-04 Thread Jonathon Jongsma
Rather than storing the video type as an integer, use the proper enum type within the struct. Signed-off-by: Jonathon Jongsma --- src/conf/domain_conf.c | 4 +--- src/conf/domain_conf.h | 2 +- src/libxl/libxl_conf.c | 10 ++ src/libxl/libxl_domain.c | 11

[libvirt PATCH v5 0/6] Add support for 'blob' to virtio video device

2022-11-04 Thread Jonathon Jongsma
changes in v4: - rebased to latest master - updated tests changes in v3: - rebased to latest master Changes in v2: - Added some basic documentation - add a qemu capability - Make sure that the /dev/udmabuf device is accessible to qemu (cgroups, etc) Jonathon Jongsma (6): conf: Refactor

[libvirt PATCH v5 4/6] conf: add support for 'blob' in virtio video device

2022-11-04 Thread Jonathon Jongsma
://lists.freedesktop.org/archives/dri-devel/2020-August/275972.html https://www.kraxel.org/blog/2021/05/virtio-gpu-qemu-graphics-update/ Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2032406 Signed-off-by: Jonathon Jongsma --- docs/formatdomain.rst | 7 +++ src/conf/domain_conf.c

[libvirt PATCH v5 1/6] conf: Refactor video model parsing

2022-11-04 Thread Jonathon Jongsma
Factor out a separate function to parse out the element for video devices. Signed-off-by: Jonathon Jongsma --- src/conf/domain_conf.c | 95 ++ 1 file changed, 59 insertions(+), 36 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c

Re: [PATCH 05/12] virschematest: Construct path to the schema in the SCHEMAS_PATH

2022-11-01 Thread Jonathon Jongsma
On 11/1/22 9:01 AM, Peter Krempa wrote: 'abs_top_srcdir' can be prepended to the schema in the macro. Apart from removing one needles string copy it will also allow pointing to schema needless files in the builddir which will come handy in upcoming patches. Signed-off-by: Peter Krempa ---

Re: [PATCH 0/5] node_device: Tiny code cleanups

2022-10-25 Thread Jonathon Jongsma
(+), 16 deletions(-) Reviewed-by: Jonathon Jongsma

Re: [PATCH 0/6] Implement XML validation feature for node devices and storage volumes

2022-10-21 Thread Jonathon Jongsma
++- tools/virsh-nodedev.c| 20 ++-- tools/virsh-volume.c | 14 ++ 17 files changed, 128 insertions(+), 35 deletions(-) Reviewed-by: Jonathon Jongsma

[libvirt PATCH v3 12/18] qemu: include nbdkit state in private xml

2022-10-20 Thread Jonathon Jongsma
Add xml to the private data for a disk source to represent the nbdkit process so that the state can be re-created if the libvirt daemon is restarted. Format: /path/to/nbdkit.pid /path/to/nbdkit.socket Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_domain.c | 53

[libvirt PATCH v3 00/18] Use nbdkit for http/ftp/ssh network drives in libvirt

2022-10-20 Thread Jonathon Jongsma
idfile support built into virCommand rather than nbdkit's --pidfile argument - added significantly more tests Jonathon Jongsma (18): schema: allow 'ssh' as a protocol for network disks qemu: Add functions for determining nbdkit availability qemu: expand nbdkit capabilities util: Allow virFile

[libvirt PATCH v3 07/18] qemu: use file cache for nbdkit caps

2022-10-20 Thread Jonathon Jongsma
Add the virFileCache implementation for nbdkit capabilities to the qemu driver. This allows us to determine whether nbdkit is installed and which plugins are supported. it also has persistent caching and the capabilities are re-queried whenever something changes. Signed-off-by: Jonathon Jongsma

[libvirt PATCH v3 16/18] qemu: pass sensitive data to nbdkit via pipe

2022-10-20 Thread Jonathon Jongsma
Rather than passing passwords and cookies (which could contain passwords) to nbdkit via commandline arguments, use the alternate format that nbdkit supports where we can specify a file descriptor which nbdkit will read to get the password or cookies. Signed-off-by: Jonathon Jongsma --- build

[libvirt PATCH v3 18/18] qemu: Monitor nbdkit process for exit

2022-10-20 Thread Jonathon Jongsma
was chosen somewhat arbitrarily. Signed-off-by: Jonathon Jongsma --- meson.build | 3 + src/qemu/qemu_nbdkit.c | 220 src/qemu/qemu_nbdkit.h | 10 ++ src/qemu/qemu_process.c | 13 +++ 4 files changed, 246 insertions(+) diff --git

[libvirt PATCH v3 17/18] qemu: add test for authenticating a https network disk

2022-10-20 Thread Jonathon Jongsma
Signed-off-by: Jonathon Jongsma --- tests/qemunbdkitdata/disk-network-source-curl.args.1.pipe.1 | 1 + tests/qemunbdkitdata/disk-network-source-curl.args.disk1 | 4 +++- .../disk-network-source-curl.args.disk1.pipe.1780 | 2 +- .../disk-network-source-curl.args.disk1.pipe.1782

[libvirt PATCH v3 11/18] qemu: split qemuDomainSecretStorageSourcePrepare

2022-10-20 Thread Jonathon Jongsma
This prepares encryption secrets and authentication secrets. When we add nbdkit-backed network storage sources, we will not need to send authentication secrets to qemu, since they will be sent to nbdkit instead. So split this into two different functions. Signed-off-by: Jonathon Jongsma Reviewed

[libvirt PATCH v3 10/18] tests: add ability to test various nbdkit capabilities

2022-10-20 Thread Jonathon Jongsma
Add new DO_TEST_CAPS_LATEST_NBDKIT macro to test xml2argv for various nbdkit capability scenarios. Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_nbdkit.c | 20 +--- tests/qemuxml2argvtest.c | 11 +++ tests/testutilsqemu.c| 27 +++ tests

[libvirt PATCH v3 14/18] tests: add tests for nbdkit invocation

2022-10-20 Thread Jonathon Jongsma
for tests that use sensitive data such as passwords and cookies. Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_nbdkit.c| 4 +- src/qemu/qemu_nbdkitpriv.h| 31 +++ tests/meson.build | 1 + .../disk-network-ssh.args.disk0

[libvirt PATCH v3 15/18] util: make virCommandSetSendBuffer testable

2022-10-20 Thread Jonathon Jongsma
Add a private function to peek at the list of send buffers in virCommand so that it is testable Signed-off-by: Jonathon Jongsma --- src/libvirt_private.syms | 1 + src/util/vircommand.c | 16 src/util/vircommand.h | 8 src/util/vircommandpriv.h | 4 4

[libvirt PATCH v3 13/18] qemu: use nbdkit to serve network disks if available

2022-10-20 Thread Jonathon Jongsma
For virStorageSource objects that contain an nbdkitProcess, start that nbdkit process to serve that network drive and then pass the nbdkit socket to qemu rather than sending the network url to qemu directly. Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_block.c | 162

[libvirt PATCH v3 03/18] qemu: expand nbdkit capabilities

2022-10-20 Thread Jonathon Jongsma
. Signed-off-by: Jonathon Jongsma --- meson.build| 6 ++ meson_options.txt | 1 + src/qemu/qemu_nbdkit.c | 40 3 files changed, 47 insertions(+) diff --git a/meson.build b/meson.build index 93de355430..e4581e74dd 100644 --- a/meson.build

[libvirt PATCH v3 05/18] qemu: implement basic virFileCache for nbdkit caps

2022-10-20 Thread Jonathon Jongsma
Preparatory step for caching nbdkit capabilities. This patch implements the newData and isValid virFileCacheHandlers callback functions. Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_nbdkit.c | 93 +- src/qemu/qemu_nbdkit.h | 4 ++ 2 files changed

[libvirt PATCH v3 09/18] qemu: add functions to start and stop nbdkit

2022-10-20 Thread Jonathon Jongsma
Add some helper functions to build a virCommand object and run the nbdkit process for a given virStorageSource. Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_nbdkit.c | 251 + src/qemu/qemu_nbdkit.h | 10 ++ 2 files changed, 261 insertions(+) diff

[libvirt PATCH v3 02/18] qemu: Add functions for determining nbdkit availability

2022-10-20 Thread Jonathon Jongsma
In future commits, we will optionally use nbdkit to serve some remote disk sources. This patch queries to see whether nbdkit is installed on the host and queries it for capabilities. The data will be used in later commits. Signed-off-by: Jonathon Jongsma --- po/POTFILES| 1 + src

[libvirt PATCH v3 04/18] util: Allow virFileCache data to be any GObject

2022-10-20 Thread Jonathon Jongsma
Since the libvirt documentation suggests to prefer GObject over virObject, and since virObject is a GObject, change virFileCache to allow GObjects as data. Signed-off-by: Jonathon Jongsma --- src/util/virfilecache.c | 14 -- src/util/virfilecache.h | 2 +- 2 files changed, 9

<    1   2   3   4   5   6   7   8   9   10   >