Re: [PATCH] cpu_map: Introduce A64FX

2022-08-31 Thread Liu Yiding
Hi Jiri On 8/31/22 20:30, Jiri Denemark wrote: On Wed, Aug 31, 2022 at 09:22:16 +, Liu Yiding wrote: Add A64FX as a supported cpu model. Signed-off-by: Liu Yiding --- src/cpu_map/arm_A64FX.xml | 6 ++ src/cpu_map/arm_vendors.xml | 1 + src/cpu_map/index.xml | 3 +++

[libvirt PATCH v2 03/16] qemu: expand nbdkit capabilities

2022-08-31 Thread Jonathon Jongsma
In order to add caching of the nbdkit capabilities, we will need to compare against file modification times, etc. So look up this information when creating the nbdkit caps. Add a nbdkit_moddir build option to allow the builder to specify the location to look for nbdkit plugins and filters.

[libvirt PATCH v2 04/16] util: Allow virFileCache data to be any GObject

2022-08-31 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 | 15 +-- src/util/virfilecache.h | 2 +- 2 files changed, 10

[libvirt PATCH v2 16/16] qemu: add test for authenticating a https network disk

2022-08-31 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.47 | 2 +- .../disk-network-source-curl.args.disk1.pipe.49

[libvirt PATCH v2 11/16] qemu: split qemuDomainSecretStorageSourcePrepare

2022-08-31 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 ---

[libvirt PATCH v2 00/16] Use nbdkit for http/ftp/ssh network drives in libvirt

2022-08-31 Thread Jonathon Jongsma
After a bit of a lengthy delay, this is the second version of this patch series. See https://bugzilla.redhat.com/show_bug.cgi?id=2016527 for more information about the goal, but the summary is that RHEL does not want to ship the qemu storage plugins for curl and ssh. Handling them outside of the

[libvirt PATCH v2 06/16] qemu: implement persistent file cache for nbdkit caps

2022-08-31 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 --- src/qemu/qemu_nbdkit.c

[libvirt PATCH v2 15/16] qemu: pass sensitive data to nbdkit via pipe

2022-08-31 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 ---

[libvirt PATCH v2 14/16] tests: add tests for nbdkit invocation

2022-08-31 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 v2 02/16] qemu: Add qemuNbdkitCaps to qemu driver

2022-08-31 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. These capabilities are stored in the qemu driver. Signed-off-by: Jonathon Jongsma --- po/POTFILES|

[libvirt PATCH v2 10/16] tests: add ability to test various nbdkit capabilities

2022-08-31 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 +++

[libvirt PATCH v2 09/16] qemu: add functions to start and stop nbdkit

2022-08-31 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 | 208 + src/qemu/qemu_nbdkit.h | 8 ++ 2 files changed, 216 insertions(+) diff

[libvirt PATCH v2 12/16] qemu: use nbdkit to serve network disks if available

2022-08-31 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 | 168

[libvirt PATCH v2 05/16] qemu: implement basic virFileCache for nbdkit caps

2022-08-31 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 | 91 ++ src/qemu/qemu_nbdkit.h | 3 ++ 2 files changed,

[libvirt PATCH v2 13/16] qemu: include nbdkit state in private xml

2022-08-31 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 | 51

[libvirt PATCH v2 07/16] qemu: use file cache for nbdkit caps

2022-08-31 Thread Jonathon Jongsma
Switch to using the virFileCache implementation for nbdkit capabilities so that we have persistent caching and re-load capabilities whenever something changes. Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_conf.h | 2 +- src/qemu/qemu_driver.c | 2 +- src/qemu/qemu_nbdkit.c | 24

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

2022-08-31 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 --- docs/formatdomain.rst | 2 +-

[libvirt PATCH v2 08/16] qemu: Add qemuNbdkitProcess

2022-08-31 Thread Jonathon Jongsma
An object for storing information about a nbdkit process that is serving a specific virStorageSource. At the moment, this information is just stored in the private data of virStorageSource and not used at all. Future commits will use this data to actually start a nbdkit process. Signed-off-by:

Re: [PATCH 07/17] qemu: use virDomainObjBeginJob()

2022-08-31 Thread Ján Tomko
On a Wednesday in 2022, Kristina Hanicova wrote: This patch moves qemuDomainObjBeginJob() into src/conf/virdomainjob as universal virDomainObjBeginJob(). Signed-off-by: Kristina Hanicova --- docs/kbase/internals/qemu-threads.rst | 8 +- src/conf/virdomainjob.c | 18 +++

Re: [PATCH 02/17] libxl: remove usage of virDomainJobData

2022-08-31 Thread Ján Tomko
On a Wednesday in 2022, Kristina Hanicova wrote: Struct virDomainJobData is meant for statistics for async jobs. It was used to keep track of only two attributes, one of which is also in the generalized virDomainJobObj ("started") and one which is always set to the same value, if any job is

Re: [PATCH 17/17] qemu & conf: move BeginNestedJob & BeginJobNowait into src/conf

2022-08-31 Thread Ján Tomko
On a Wednesday in 2022, Kristina Hanicova wrote: Signed-off-by: Kristina Hanicova --- src/conf/virdomainjob.c | 44 +++ src/conf/virdomainjob.h | 6 ++ src/libvirt_private.syms | 2 ++ src/qemu/qemu_domain.c| 2 +- src/qemu/qemu_domainjob.c | 44

Re: [PATCH 12/17] libxl: use virDomainObjEndJob()

2022-08-31 Thread Ján Tomko
On a Wednesday in 2022, Kristina Hanicova wrote: This patch removes libxlDomainObjEndJob() and replaces it with call to the generalized virDomainObjEndJob(). Signed-off-by: Kristina Hanicova --- src/libxl/libxl_domain.c| 27 ++-- src/libxl/libxl_domain.h| 4 ---

Re: [PATCH 10/17] CH: use virDomainObjBeginJob()

2022-08-31 Thread Ján Tomko
On a Wednesday in 2022, Kristina Hanicova wrote: This patch removes virCHDomainObjBeginJob() and replaces it with call to the generalized virDomainObjBeginJob(). Signed-off-by: Kristina Hanicova --- src/ch/ch_domain.c | 51 +- src/ch/ch_domain.h | 4

Re: [PATCH 08/17] libxl: use virDomainObjBeginJob()

2022-08-31 Thread Ján Tomko
On a Wednesday in 2022, Kristina Hanicova wrote: This patch removes libxlDomainObjBeginJob() and replaces it with generalized virDomainObjBeginJob(). Signed-off-by: Kristina Hanicova --- src/libxl/libxl_domain.c| 62 ++--- src/libxl/libxl_domain.h| 6

Re: [PATCH 09/17] LXC: use virDomainObjBeginJob()

2022-08-31 Thread Ján Tomko
On a Wednesday in 2022, Kristina Hanicova wrote: This patch removes virLXCDomainObjBeginJob() and replaces it with call to the generalized virDomainObjBeginJob(). Signed-off-by: Kristina Hanicova --- src/lxc/lxc_domain.c | 57 src/lxc/lxc_domain.h |

Re: [PATCH 05/17] conf: extend xmlopt with job config & add job object into domain object

2022-08-31 Thread Ján Tomko
On a Wednesday in 2022, Kristina Hanicova wrote: This patch adds the generalized job object into the domain object so that it can be used by all drivers without the need to extract it from the private data. Because of this, the job object needs to be created and set during the creation of the

Re: [PATCH 15/17] qemu & conf: move BeginAgentJob & EndAgentJob into src/conf/virdomainjob

2022-08-31 Thread Ján Tomko
On a Wednesday in 2022, Kristina Hanicova wrote: Although these and functions in the following two patches are for now just being used by the qemu driver, it makes sense to have all begin job functions in the same file. Signed-off-by: Kristina Hanicova --- docs/kbase/internals/qemu-threads.rst

Re: [PATCH 14/17] CH: use virDomainObjEndJob()

2022-08-31 Thread Ján Tomko
On a Wednesday in 2022, Kristina Hanicova wrote: This patch removes virCHDomainObjEndJob() and replaces it with call to the generalized virDomainObjEndJob(). Signed-off-by: Kristina Hanicova --- src/ch/ch_domain.c | 18 -- src/ch/ch_domain.h | 3 --- src/ch/ch_driver.c | 20

Re: [PATCH 16/17] qemu & conf: move BeginAsyncJob & EndAsyncJob into src/conf

2022-08-31 Thread Ján Tomko
On a Wednesday in 2022, Kristina Hanicova wrote: Signed-off-by: Kristina Hanicova --- docs/kbase/internals/qemu-threads.rst | 12 +-- src/conf/virdomainjob.c | 30 +++ src/conf/virdomainjob.h | 6 ++ src/libvirt_private.syms

Re: [PATCH 06/17] virdomainjob: make drivers use job object in the domain object

2022-08-31 Thread Ján Tomko
On a Wednesday in 2022, Kristina Hanicova wrote: This patch uses the job object directly in the domain object and removes the job object from private data of all drivers that use it as well as other relevant code (initializing and freeing the structure). Signed-off-by: Kristina Hanicova ---

Re: [PATCH 11/17] qemu: use virDomainObjEndJob()

2022-08-31 Thread Ján Tomko
On a Wednesday in 2022, Kristina Hanicova wrote: This patch moves qemuDomainObjEndJob() into src/conf/virdomainjob as universal virDomainObjEndJob(). Signed-off-by: Kristina Hanicova --- docs/kbase/internals/qemu-threads.rst | 6 +- src/conf/virdomainjob.c | 28 +

Re: [PATCH 13/17] LXC: use virDomainObjEndJob()

2022-08-31 Thread Ján Tomko
On a Wednesday in 2022, Kristina Hanicova wrote: This patch removes virLXCDomainObjEndJob() and replaces it with call to the generalized virDomainObjEndJob(). Signed-off-by: Kristina Hanicova --- src/lxc/lxc_domain.c | 20 src/lxc/lxc_domain.h | 4 src/lxc/lxc_driver.c |

Re: [PATCH 04/17] virdomainjob: add check for callbacks

2022-08-31 Thread Ján Tomko
On a Wednesday in 2022, Kristina Hanicova wrote: There may be a case that the callback structure will exist with no callbacks (following patches). This patch adds check for specific callbacks before using them. Signed-off-by: Kristina Hanicova --- src/conf/virdomainjob.c | 8 1 file

Re: [PATCH 01/17] qemu & hypervisor: move qemuDomainObjBeginJobInternal() into hyperisor

2022-08-31 Thread Ján Tomko
There is a 'hyperisor' typo in the commit summary. Since the whole file is moved anyway in patch 3/3, I suggest avoiding the typo by moving "virdomainjob.c" first and then moving this function into its final place. On a Wednesday in 2022, Kristina Hanicova wrote: This patch moves

[PATCH] Fix race condition when detaching a device

2022-08-31 Thread Pierre LIBEAU
Qemu reply to libvirt "DeviceNotFound" and libvirt didn't clean on the side the live configuration. qemuMonitorDelDevice() return -2 to qemuDomainDeleteDevice() and during this action in qemuDomainDetachDeviceLive() the remove is never call. Ref #359 Signed-off-by: Pierre LIBEAU ---

Re: [PATCH] cpu_map: Introduce A64FX

2022-08-31 Thread Jiri Denemark
On Wed, Aug 31, 2022 at 15:11:41 +0100, Daniel P. Berrangé wrote: > On Wed, Aug 31, 2022 at 02:30:52PM +0200, Jiri Denemark wrote: > > On Wed, Aug 31, 2022 at 09:22:16 +, Liu Yiding wrote: > > > Add A64FX as a supported cpu model. > > > > > > Signed-off-by: Liu Yiding > > > --- > > >

Re: [PATCH] cpu_map: Introduce A64FX

2022-08-31 Thread Daniel P . Berrangé
On Wed, Aug 31, 2022 at 02:30:52PM +0200, Jiri Denemark wrote: > On Wed, Aug 31, 2022 at 09:22:16 +, Liu Yiding wrote: > > Add A64FX as a supported cpu model. > > > > Signed-off-by: Liu Yiding > > --- > > src/cpu_map/arm_A64FX.xml | 6 ++ > > src/cpu_map/arm_vendors.xml | 1 + > >

Re: [PATCH] cpu_map: Introduce A64FX

2022-08-31 Thread Jiri Denemark
On Wed, Aug 31, 2022 at 09:22:16 +, Liu Yiding wrote: > Add A64FX as a supported cpu model. > > Signed-off-by: Liu Yiding > --- > src/cpu_map/arm_A64FX.xml | 6 ++ > src/cpu_map/arm_vendors.xml | 1 + > src/cpu_map/index.xml | 3 +++ > src/cpu_map/meson.build | 1 + > 4

[PATCH] cpu_map: Introduce A64FX

2022-08-31 Thread Liu Yiding
Add A64FX as a supported cpu model. Signed-off-by: Liu Yiding --- src/cpu_map/arm_A64FX.xml | 6 ++ src/cpu_map/arm_vendors.xml | 1 + src/cpu_map/index.xml | 3 +++ src/cpu_map/meson.build | 1 + 4 files changed, 11 insertions(+) create mode 100644 src/cpu_map/arm_A64FX.xml

[libvirt][PATCH v15 9/9] qemu: Add command-line to generate SGX EPC memory backend

2022-08-31 Thread Lin Yang
According to the result parsing from xml, add the argument of SGX EPC memory backend into QEMU command line. With NUMA config: #qemu-system-x86_64 \ .. \ -object

[libvirt][PATCH v15 7/9] qemu_namespace: Create SGX related nodes in domain's namespace

2022-08-31 Thread Lin Yang
From: Michal Privoznik This is similar to the previous commit. SGX memory backend needs to access /dev/sgx_vepc and /dev/sgx_provision. Create these nodes in domain's private /dev when required by domain's config. Signed-off-by: Michal Privoznik Signed-off-by: Haibin Huang ---

[libvirt][PATCH v15 8/9] security_dac: Set DAC label on SGX /dev nodes

2022-08-31 Thread Lin Yang
From: Michal Privoznik As advertised in previous commits, QEMU needs to access /dev/sgx_vepc and /dev/sgx_provision files when SGX memory backend is configured. And if it weren't for QEMU's namespaces, we wouldn't dare to relabel them, because they are system wide files. But if namespaces are

[libvirt][PATCH v15 4/9] conf: expose SGX feature in domain capabilities

2022-08-31 Thread Lin Yang
From: Haibin Huang Extend hypervisor capabilities to include sgx feature. When available, the hypervisor supports launching an VM with SGX on Intel platfrom. The SGX feature tag privides additional details like section size and sgx1 or sgx2. Signed-off-by: Haibin Huang Signed-off-by: Michal

[libvirt][PATCH v15 2/9] qemu: Get SGX capabilities form QMP

2022-08-31 Thread Lin Yang
From: Haibin Huang Generate the QMP command for query-sgx-capabilities and the command return SGX capabilities from QMP. {"execute":"query-sgx-capabilities"} the right reply: {"return": { "sgx": true, "section-size": 197132288, "flc": true } } the error reply:

[libvirt][PATCH v15 6/9] qemu_cgroup: Allow SGX in devices controller

2022-08-31 Thread Lin Yang
From: Michal Privoznik SGX memory backend needs to access /dev/sgx_vepc (which allows userspace to allocate "raw" EPC without an associated enclave) and /dev/sgx_provision (which allows creating provisioning enclaves). Allow these two devices in CGroups if a domain is configured so.

[libvirt][PATCH v15 5/9] conf: Introduce SGX EPC element into device memory xml

2022-08-31 Thread Lin Yang
With NUMA config: ... 0-1 512 0 ... Without NUMA config: ... 512 ... Signed-off-by: Lin Yang Signed-off-by: Michal Privoznik Signed-off-by: Haibin Huang --- docs/formatdomain.rst | 25

[libvirt][PATCH v15 3/9] Convert QMP capabilities to domain capabilities

2022-08-31 Thread Lin Yang
From: Haibin Huang the QMP capabilities: {"return": { "sgx": true, "section-size": 1024, "flc": true } } the domain capabilities: yes 1 Signed-off-by: Michal Privoznik Signed-off-by: Haibin Huang --- src/qemu/qemu_capabilities.c |

[libvirt][PATCH v15 1/9] domain_capabilities: Define SGX capabilities structs

2022-08-31 Thread Lin Yang
From: Haibin Huang Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa Signed-off-by: Haibin Huang --- src/conf/domain_capabilities.c | 11 +++ src/conf/domain_capabilities.h | 21 + src/libvirt_private.syms | 1 + 3 files changed, 33 insertions(+)

[libvirt][PATCH v15 0/9] Support query and use SGX

2022-08-31 Thread Lin Yang
The previous v14 version can be found here: https://listman.redhat.com/archives/libvir-list/2022-July/233257.html Diff to v14: - Dropped SGX support for QEMU 6.2.0, only focus on QEMU 7.0.0 (BTW, I noticed the default QEMU version in RHEL9 is still 6.2.0, so those user cannot access this