Re: [libvirt][PATCH RESEND v12 0/6] Support query and use SGX

2022-06-02 Thread Yang, Lin A
On 6/2/22, 11:28 AM, "Yang, Lin A" wrote: > On 6/1/22, 11:37 PM, "Michal Prívozník" wrote: > > Worst case scenario we can do a version check. It's very suboptimal > > because if somebody backports your patches in QEMU, libvirt will stop > > working despite having the version check. > > > > Theref

Re: [libvirt][PATCH RESEND v12 6/6] qemu: Add command-line to generate SGX EPC memory backend

2022-06-02 Thread Yang, Lin A
On 5/30/22, 6:09 AM, "Michal Prívozník" wrote: > On 5/18/22 09:59, Haibin Huang wrote: > > From: Lin Yang > > > > According to the result parsing from xml, add the argument of > > SGX EPC memory backend into QEMU command line: > > > > #qemu-system-x86_64 \ > > .. \ > > -o

Re: [libvirt][PATCH RESEND v12 0/6] Support query and use SGX

2022-06-02 Thread Yang, Lin A
On 6/1/22, 11:37 PM, "Michal Prívozník" wrote: > Worst case scenario we can do a version check. It's very suboptimal > because if somebody backports your patches in QEMU, libvirt will stop > working despite having the version check. > > Therefore, I'm more inclined to just use the newest API and

Re: [libvirt PATCH] ci: gitlab: Expire artifacts after 1 day

2022-06-02 Thread Erik Skultety
... > Well, the worse news is that we cannot run a CI job to prune the artifacts > automatically, because one would need a personal access token for that. Why > personal access token? Because Project/Group access tokens are apparently > unavailable on GitLab SaaS if you're not a paying customer (wh

Re: [PATCH] qemu: Restore label to temp file in qemuDomainScreenshot()

2022-06-02 Thread Jiri Denemark
On Thu, Jun 02, 2022 at 15:14:25 +0200, Michal Privoznik wrote: > Obtaining a screenshot via virDomainScreenshot() works like this: > 1) we create a temp file, label it, then > 2) tell QEMU to store the screenshot into it, and > 3) finally, open the file for transfer via virStream > > Since

Re: [libvirt PATCH] ci: gitlab: Expire artifacts after 1 day

2022-06-02 Thread Erik Skultety
On Thu, Jun 02, 2022 at 03:20:17PM +0200, Peter Krempa wrote: > On Thu, Jun 02, 2022 at 15:02:24 +0200, Erik Skultety wrote: > > With GitLab cutting down on shared resource usage it's very likely that > > following our measure to decrease the number of CI minutes we'll also > > need to decrease our

Re: [PATCH 07/16] conf: Introduce pool_min and pool_max attributes to IOThread

2022-06-02 Thread Michal Prívozník
On 6/2/22 10:08, Peter Krempa wrote: > On Thu, Jun 02, 2022 at 09:17:57 +0200, Michal Privoznik wrote: >> At least in case of QEMU an IOThread is actually a pool of >> threads (see iothread_set_aio_context_params() in QEMU's code >> base). As such, it can have minimal and maximal number of worker >

Re: [libvirt PATCH] ci: gitlab: Expire artifacts after 1 day

2022-06-02 Thread Peter Krempa
On Thu, Jun 02, 2022 at 15:02:24 +0200, Erik Skultety wrote: > With GitLab cutting down on shared resource usage it's very likely that > following our measure to decrease the number of CI minutes we'll also > need to decrease our usage of storage. Start by decreasing artifact > expiration time to 1

[PATCH] qemu: Restore label to temp file in qemuDomainScreenshot()

2022-06-02 Thread Michal Privoznik
Obtaining a screenshot via virDomainScreenshot() works like this: 1) we create a temp file, label it, then 2) tell QEMU to store the screenshot into it, and 3) finally, open the file for transfer via virStream Since the file is just temporary and even explicitly unlinked at the end, no secla

[libvirt PATCH] ci: gitlab: Expire artifacts after 1 day

2022-06-02 Thread Erik Skultety
With GitLab cutting down on shared resource usage it's very likely that following our measure to decrease the number of CI minutes we'll also need to decrease our usage of storage. Start by decreasing artifact expiration time to 1 day for jobs that are currently exceeding it (by a lot -> 30 days).

Re: [PATCH 14/16] conf: Expose QEMU's main loop object

2022-06-02 Thread Peter Krempa
On Thu, Jun 02, 2022 at 09:18:04 +0200, Michal Privoznik wrote: > As of v7.0.0-877-g70ac26b9e5 QEMU exposes its main event loop as > an QMP object. In the very next commit (v7.0.0-878-g71ad4713cc) > it was extended for thread-pool-min and thread-pool-max > attributes. Expose them under new element

Re: [PATCH v3 0/5] Introduce network backed NVRAM

2022-06-02 Thread Rohit Kumar
On 17/05/22 8:55 pm, Peter Krempa wrote: On Mon, May 16, 2022 at 16:03:21 +0530, Rohit Kumar wrote: Ping. Hi Peter, can you please take a look on this v3 patchset ? Yes, don't worry and please be patient. There are some intricacies that are not properly handled by your series and rather than

Re: [PATCH v3 0/5] Introduce network backed NVRAM

2022-06-02 Thread Rohit Kumar
On 17/05/22 8:55 pm, Peter Krempa wrote: On Mon, May 16, 2022 at 16:03:21 +0530, Rohit Kumar wrote: Ping. Hi Peter, can you please take a look on this v3 patchset ? Yes, don't worry and please be patient. There are some intricacies that are not properly handled by your series and rather than

Re: [PATCH 13/16] virsh: Wire up new virDomainSetIOThreadParams parameters

2022-06-02 Thread Peter Krempa
On Thu, Jun 02, 2022 at 09:18:03 +0200, Michal Privoznik wrote: > Since virsh implements a wrapper over virDomainSetIOThreadParams() > (command iothreadset) let's wire up new typed parameters there too. > > Signed-off-by: Michal Privoznik > --- > docs/manpages/virsh.rst | 7 ++- > tools/vir

Re: [PATCH 11/16] include: Introduce typed params for virDomainSetIOThreadParams wrt pool size

2022-06-02 Thread Peter Krempa
On Thu, Jun 02, 2022 at 10:15:41 +0200, Peter Krempa wrote: > On Thu, Jun 02, 2022 at 09:18:01 +0200, Michal Privoznik wrote: > > Our public API offers virDomainSetIOThreadParams() function which > > allows users to set various aspects of IOThreads. Introduce two > > new typed parameters: VIR_DOMAI

Re: [PATCH 12/16] qemu: Wire up new virDomainSetIOThreadParams parameters

2022-06-02 Thread Peter Krempa
On Thu, Jun 02, 2022 at 09:18:02 +0200, Michal Privoznik wrote: > Introduced in previous commit, QEMU driver needs to be taught how > to set VIR_DOMAIN_IOTHREAD_THREAD_POOL_MIN and > VIR_DOMAIN_IOTHREAD_THREAD_POOL_MAX parameters on given IOThread. > Fortunately, this is fairly trivial to do and si

Re: [PATCH 12/16] qemu: Wire up new virDomainSetIOThreadParams parameters

2022-06-02 Thread Peter Krempa
On Thu, Jun 02, 2022 at 09:18:02 +0200, Michal Privoznik wrote: > Introduced in previous commit, QEMU driver needs to be taught how > to set VIR_DOMAIN_IOTHREAD_THREAD_POOL_MIN and > VIR_DOMAIN_IOTHREAD_THREAD_POOL_MAX parameters on given IOThread. > Fortunately, this is fairly trivial to do and si

Re: [PATCH 11/16] include: Introduce typed params for virDomainSetIOThreadParams wrt pool size

2022-06-02 Thread Peter Krempa
On Thu, Jun 02, 2022 at 09:18:01 +0200, Michal Privoznik wrote: > Our public API offers virDomainSetIOThreadParams() function which > allows users to set various aspects of IOThreads. Introduce two > new typed parameters: VIR_DOMAIN_IOTHREAD_THREAD_POOL_MIN and > VIR_DOMAIN_IOTHREAD_THREAD_POOL_MAX

Re: [PATCH 10/16] qemu: Generate command line for IOThread pool size

2022-06-02 Thread Peter Krempa
On Thu, Jun 02, 2022 at 09:18:00 +0200, Michal Privoznik wrote: > Signed-off-by: Michal Privoznik > --- > src/qemu/qemu_command.c | 15 ++- > ...othreads-ids-pool-sizes.x86_64-latest.args | 44 +++ > tests/qemuxml2argvtest.c | 1 + >

Re: [PATCH 09/16] qemu_validate: Check if QEMU's capable of setting iothread pool size

2022-06-02 Thread Peter Krempa
On Thu, Jun 02, 2022 at 09:17:59 +0200, Michal Privoznik wrote: > Now that we have a capability that reflects whether QEMU is > capable of setting iothread pool size, let's introduce a > validator check to make sure users are not trying to use this > feature with QEMU that doesn't support it. > >

Re: [PATCH 08/16] qemu: Introduce QEMU_CAPS_IOTHREAD_THREAD_POOL_MAX

2022-06-02 Thread Peter Krempa
On Thu, Jun 02, 2022 at 09:17:58 +0200, Michal Privoznik wrote: > This capability reflects whether QEMU allows setting > thread-pool-min and thread-pool-max attributes on iothread > object. Since both attributes were introduced in the same commit > (v7.0.0-878-g71ad4713cc) and can't exist independe

Re: [PATCH 07/16] conf: Introduce pool_min and pool_max attributes to IOThread

2022-06-02 Thread Peter Krempa
On Thu, Jun 02, 2022 at 09:17:57 +0200, Michal Privoznik wrote: > At least in case of QEMU an IOThread is actually a pool of > threads (see iothread_set_aio_context_params() in QEMU's code > base). As such, it can have minimal and maximal number of worker > threads. Allow setting them in domain XML

Re: [PATCH 06/16] conf: Introduce allocator for virDomainIOThreadIDDef

2022-06-02 Thread Peter Krempa
On Thu, Jun 02, 2022 at 09:17:56 +0200, Michal Privoznik wrote: > So far, iothread configuration structure (virDomainIOThreadIDDef) > is allocated by plain g_new0(). This is perfectly okay because > all members of the struct default to value 0 anyway. But soon > this is going to change. Therefore,

Re: [PATCH 05/16] conf: Move iothread formatter into a separate function

2022-06-02 Thread Peter Krempa
On Thu, Jun 02, 2022 at 09:17:55 +0200, Michal Privoznik wrote: > Formatting iothreads is currently open coded inside of > virDomainDefFormatInternalSetRootName(). While this works, it > makes the function needlessly long, especially if the formatting > code will expand in near future. Therefore, m

Re: [PATCH 04/16] virDomainIOThreadIDDefArrayInit: Decrease scope of @iothrid

2022-06-02 Thread Peter Krempa
On Thu, Jun 02, 2022 at 09:17:54 +0200, Michal Privoznik wrote: > In virDomainIOThreadIDDefArrayInit() the variable @iothrid is > used only inside a loop but is declared for whole function. Bring > the variable into the loop so that it's obvious that the variable > is not used elsewhere. > > Signe

Re: [PATCH 03/16] virDomainDefParseIOThreads: Use g_autoptr() for @iothrid

2022-06-02 Thread Peter Krempa
On Thu, Jun 02, 2022 at 09:17:53 +0200, Michal Privoznik wrote: > Using g_autoptr() for @iothrid variable inside > virDomainDefParseIOThreads() allows us to drop explicit call to > virDomainIOThreadIDDefFree() in one case. > > Signed-off-by: Michal Privoznik > --- > src/conf/domain_conf.c | 6 ++

Re: [PATCH] util: json: Add modifier for adding non-negative long values to JSON objects

2022-06-02 Thread Peter Krempa
On Thu, Jun 02, 2022 at 09:48:28 +0200, Jiri Denemark wrote: > On Thu, Jun 02, 2022 at 09:45:16 +0200, Peter Krempa wrote: > > Similarly to the 'k' modifier for integers introduce 'K' for long > > integers. > > > > Signed-off-by: Peter Krempa > > --- > > src/util/virjson.c | 5 + > > 1 file

Re: [PATCH] util: json: Add modifier for adding non-negative long values to JSON objects

2022-06-02 Thread Jiri Denemark
On Thu, Jun 02, 2022 at 09:45:16 +0200, Peter Krempa wrote: > Similarly to the 'k' modifier for integers introduce 'K' for long > integers. > > Signed-off-by: Peter Krempa > --- > src/util/virjson.c | 5 + > 1 file changed, 5 insertions(+) > > diff --git a/src/util/virjson.c b/src/util/virj

Re: [PATCH 02/16] virxml: Introduce virXMLPropLongLong()

2022-06-02 Thread Peter Krempa
On Thu, Jun 02, 2022 at 09:17:52 +0200, Michal Privoznik wrote: > So far, we have functions that parse an enum, int, tristate bool, > and what not but we have none for long long. Heavily inspired by > virXMLPropInt(), introduce virXMLPropLongLong() for parsing long > long attributes. > > Signed-of

[PATCH] util: json: Add modifier for adding non-negative long values to JSON objects

2022-06-02 Thread Peter Krempa
Similarly to the 'k' modifier for integers introduce 'K' for long integers. Signed-off-by: Peter Krempa --- src/util/virjson.c | 5 + 1 file changed, 5 insertions(+) diff --git a/src/util/virjson.c b/src/util/virjson.c index 6e13e97e15..ae970c7653 100644 --- a/src/util/virjson.c +++ b/src/u

Re: [PATCH 01/16] virml: Introduce VIR_XML_PROP_NONNEGATIVE flag

2022-06-02 Thread Peter Krempa
On Thu, Jun 02, 2022 at 09:17:51 +0200, Michal Privoznik wrote: > For easier attribute parsing we have virXMLProp*() family of > functions. These accept flags through which a caller can pose > some conditions onto the attribute value, for instance: > VIR_XML_PROP_NONZERO when the attribute may not

[PATCH 14/16] conf: Expose QEMU's main loop object

2022-06-02 Thread Michal Privoznik
As of v7.0.0-877-g70ac26b9e5 QEMU exposes its main event loop as an QMP object. In the very next commit (v7.0.0-878-g71ad4713cc) it was extended for thread-pool-min and thread-pool-max attributes. Expose them under new element. Signed-off-by: Michal Privoznik --- docs/formatdomain.rst

[PATCH 08/16] qemu: Introduce QEMU_CAPS_IOTHREAD_THREAD_POOL_MAX

2022-06-02 Thread Michal Privoznik
This capability reflects whether QEMU allows setting thread-pool-min and thread-pool-max attributes on iothread object. Since both attributes were introduced in the same commit (v7.0.0-878-g71ad4713cc) and can't exist independently of each other we can stick with one capability covering both of the

[PATCH 11/16] include: Introduce typed params for virDomainSetIOThreadParams wrt pool size

2022-06-02 Thread Michal Privoznik
Our public API offers virDomainSetIOThreadParams() function which allows users to set various aspects of IOThreads. Introduce two new typed parameters: VIR_DOMAIN_IOTHREAD_THREAD_POOL_MIN and VIR_DOMAIN_IOTHREAD_THREAD_POOL_MAX which will allow users to modify the thread-pool-min and thread-pool-ma

[PATCH 16/16] qemu: Generate command line for main-loop pool size

2022-06-02 Thread Michal Privoznik
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2059511 Signed-off-by: Michal Privoznik --- src/qemu/qemu_command.c | 33 +++ ...othreads-ids-pool-sizes.x86_64-latest.args | 1 + 2 files changed, 34 insertions(+) diff --git a/src/qemu/qemu_command.c b

[PATCH 15/16] qemu_validate: Check if QEMU's capable of setting main loop pool size

2022-06-02 Thread Michal Privoznik
Since the main-loop and iothread classes are derived from the same class (EventLoopBaseClass) we don't need new capability and can use QEMU_CAPS_IOTHREAD_THREAD_POOL_MAX directly to check whether QEMU's capable of setting worker pool size. Signed-off-by: Michal Privoznik --- src/qemu/qemu_valida

[PATCH 13/16] virsh: Wire up new virDomainSetIOThreadParams parameters

2022-06-02 Thread Michal Privoznik
Since virsh implements a wrapper over virDomainSetIOThreadParams() (command iothreadset) let's wire up new typed parameters there too. Signed-off-by: Michal Privoznik --- docs/manpages/virsh.rst | 7 ++- tools/virsh-domain.c| 24 +++- 2 files changed, 29 insertions(+

[PATCH 12/16] qemu: Wire up new virDomainSetIOThreadParams parameters

2022-06-02 Thread Michal Privoznik
Introduced in previous commit, QEMU driver needs to be taught how to set VIR_DOMAIN_IOTHREAD_THREAD_POOL_MIN and VIR_DOMAIN_IOTHREAD_THREAD_POOL_MAX parameters on given IOThread. Fortunately, this is fairly trivial to do and since these two parameters are exposed in domain XML too the update of ina

[PATCH 10/16] qemu: Generate command line for IOThread pool size

2022-06-02 Thread Michal Privoznik
Signed-off-by: Michal Privoznik --- src/qemu/qemu_command.c | 15 ++- ...othreads-ids-pool-sizes.x86_64-latest.args | 44 +++ tests/qemuxml2argvtest.c | 1 + 3 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 tests

[PATCH 09/16] qemu_validate: Check if QEMU's capable of setting iothread pool size

2022-06-02 Thread Michal Privoznik
Now that we have a capability that reflects whether QEMU is capable of setting iothread pool size, let's introduce a validator check to make sure users are not trying to use this feature with QEMU that doesn't support it. Signed-off-by: Michal Privoznik --- src/qemu/qemu_validate.c | 24

[PATCH 04/16] virDomainIOThreadIDDefArrayInit: Decrease scope of @iothrid

2022-06-02 Thread Michal Privoznik
In virDomainIOThreadIDDefArrayInit() the variable @iothrid is used only inside a loop but is declared for whole function. Bring the variable into the loop so that it's obvious that the variable is not used elsewhere. Signed-off-by: Michal Privoznik --- src/conf/domain_conf.c | 5 +++-- 1 file ch

[PATCH 06/16] conf: Introduce allocator for virDomainIOThreadIDDef

2022-06-02 Thread Michal Privoznik
So far, iothread configuration structure (virDomainIOThreadIDDef) is allocated by plain g_new0(). This is perfectly okay because all members of the struct default to value 0 anyway. But soon this is going to change. Therefore, replace those g_new0() with a function so that the default value can be

[PATCH 03/16] virDomainDefParseIOThreads: Use g_autoptr() for @iothrid

2022-06-02 Thread Michal Privoznik
Using g_autoptr() for @iothrid variable inside virDomainDefParseIOThreads() allows us to drop explicit call to virDomainIOThreadIDDefFree() in one case. Signed-off-by: Michal Privoznik --- src/conf/domain_conf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/conf/d

[PATCH 07/16] conf: Introduce pool_min and pool_max attributes to IOThread

2022-06-02 Thread Michal Privoznik
At least in case of QEMU an IOThread is actually a pool of threads (see iothread_set_aio_context_params() in QEMU's code base). As such, it can have minimal and maximal number of worker threads. Allow setting them in domain XML. Signed-off-by: Michal Privoznik --- docs/formatdomain.rst

[PATCH 05/16] conf: Move iothread formatter into a separate function

2022-06-02 Thread Michal Privoznik
Formatting iothreads is currently open coded inside of virDomainDefFormatInternalSetRootName(). While this works, it makes the function needlessly long, especially if the formatting code will expand in near future. Therefore, move it into a separate function. At the same time, make virDomainDefIoth

[PATCH 01/16] virml: Introduce VIR_XML_PROP_NONNEGATIVE flag

2022-06-02 Thread Michal Privoznik
For easier attribute parsing we have virXMLProp*() family of functions. These accept flags through which a caller can pose some conditions onto the attribute value, for instance: VIR_XML_PROP_NONZERO when the attribute may not be zero, etc. What we are missing is VIR_XML_PROP_NONNEGATIVE when the

[PATCH 02/16] virxml: Introduce virXMLPropLongLong()

2022-06-02 Thread Michal Privoznik
So far, we have functions that parse an enum, int, tristate bool, and what not but we have none for long long. Heavily inspired by virXMLPropInt(), introduce virXMLPropLongLong() for parsing long long attributes. Signed-off-by: Michal Privoznik --- src/libvirt_private.syms | 1 + src/util/virxm

[PATCH 00/16] qemu: Allow setting EventLoopBaseProperties

2022-06-02 Thread Michal Privoznik
QEMU introduced a way to set minimal and maximal number of worker threads for its worker thread pools. Currently, only IOThreads and main loop pools have this ability. Nevertheless, setting these boundaries (and basically making QEMU spawn enough threads upfront) is crucial for real-time workloads