[libvirt PATCH] qemuProcessUpdateGuestCPU: Check cpu if check=full is set

2021-02-24 Thread Tim Wiederhake
libvirt performs cpu checking if "check" is set to "partial", but skips checking the cpu if "check" is set to "full". See https://bugzilla.redhat.com/show_bug.cgi?id=1840770 Signed-off-by: Tim Wiederhake --- src/qemu/qemu_process.c | 8 1 file changed, 8 insertions(+) diff --git

Re: [PATCH v2] qemu: Add missing lock in qemuProcessHandleMonitorEOF

2021-02-24 Thread Michal Privoznik
On 2/25/21 2:39 AM, Peng Liang wrote: On 2/24/2021 9:59 PM, Michal Privoznik wrote: On 2/24/21 12:28 PM, Peng Liang wrote: qemuMonitorUnregister will be called in multiple threads (e.g. threads in rpc worker pool and the vm event thread).  In some cases, it isn't protected by the monitor lock,

Re: [PATCH 04/14] softmmu: remove '-usbdevice' command line option

2021-02-24 Thread Thomas Huth
On 24/02/2021 15.10, Daniel P. Berrangé wrote: On Wed, Feb 24, 2021 at 02:58:19PM +0100, Thomas Huth wrote: On 24/02/2021 14.11, Daniel P. Berrangé wrote: This was replaced by the '-device usb-DEV' option. Signed-off-by: Daniel P. Berrangé --- docs/system/deprecated.rst | 9 ---

Re: [PATCH 33/33] util: virerror: Remove virReportOOMError

2021-02-24 Thread Laine Stump
On 2/24/21 11:17 AM, Peter Krempa wrote: Trying to report an OOM error is pointless since our infrastructure to report error needs to allocate memory to report the error. In addition our code mistakenly reported OOM errors even in cases where a function could fail for another reason, which

Re: [PATCH 32/33] virVMXConvertToUTF8: Report non-OOM error on failure of xmlBufferCreateStatic

2021-02-24 Thread Laine Stump
On 2/24/21 11:17 AM, Peter Krempa wrote: The function has also non-OOM failure case when the passed string has 0 length, so reporting OOM error is not correct. Signed-off-by: Peter Krempa --- src/vmx/vmx.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git

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

2021-02-24 Thread Laine Stump
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 any way of differentiating? (I previously looked into this for some

Re: [PATCH v2] qemu: Add missing lock in qemuProcessHandleMonitorEOF

2021-02-24 Thread Peng Liang
On 2/24/2021 9:59 PM, Michal Privoznik wrote: > On 2/24/21 12:28 PM, Peng Liang wrote: >> qemuMonitorUnregister will be called in multiple threads (e.g. threads >> in rpc worker pool and the vm event thread).  In some cases, it isn't >> protected by the monitor lock, which may lead to call

Re: [PATCH 00/33] Remove the now misleading virReportOOMError infra

2021-02-24 Thread Laine Stump
On 2/24/21 11:16 AM, Peter Krempa wrote: 'virReportOOMError' is nowadays mostly useless since an OOM error will trigger yet another allocation failure in the logger when attempting to log the error. Additionally it was also used in few places which can fail with other failures than OOM. To

Re: [PATCH 3/3] Remove redundant variables/labels

2021-02-24 Thread Laine Stump
On 2/23/21 12:24 PM, Kristina Hanicova wrote: In files: src/lxc/lxc_native: in lxcAddNetworkRouteDefinition(), src/conf/networkcommon_conf: in virNetDevIPRouteCreate() and virNetDevIPRouteParseXML() Signed-off-by: Kristina Hanicova Reviewed-by: Laine Stump

Re: [PATCH 2/3] Use g_autoptr instead of virNetDevIPRouteFree if possible

2021-02-24 Thread Laine Stump
On 2/23/21 12:24 PM, Kristina Hanicova wrote: In files: src/conf/domain_conf: in virDomainNetIPInfoParseXML(), src/lxc/lxc_native: in lxcAddNetworkRouteDefinition(), src/vz/vz_sdk: in prlsdkGetRoutes(), src/conf/networkcommon_conf: in virNetDevIPRouteCreate() Signed-off-by: Kristina Hanicova

Re: [PATCH 1/3] networkcommon_conf: Use g_autofree where possible

2021-02-24 Thread Laine Stump
On 2/23/21 12:24 PM, Kristina Hanicova wrote: Signed-off-by: Kristina Hanicova --- src/conf/networkcommon_conf.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/conf/networkcommon_conf.c b/src/conf/networkcommon_conf.c index 26eeb6dbda..e82dbc3d3d

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

2021-02-24 Thread Jonathon Jongsma
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 transient mediated devices. This series expands mdev > > support to include

[libvirt PATCH] qemu_domainjob: Make copy of owner API

2021-02-24 Thread Jiri Denemark
Using the job owner API name directly works fine as long as it is a static string or the owner's thread is still running. However, this is not always the case. For example, when the owner API name is filled in a job when we're reconnecting to existing domains after daemon restart, the dynamically

Re: [PATCH] qemu_monitor: Document qemuMonitorUnregister()

2021-02-24 Thread Andrea Bolognani
On Wed, 2021-02-24 at 15:04 +0100, Michal Privoznik wrote: > The most important bit is that the caller is expected to pass > locked monitor. > > Signed-off-by: Michal Privoznik > --- > src/qemu/qemu_monitor.c | 7 +++ > 1 file changed, 7 insertions(+) Reviewed-by: Andrea Bolognani --

Re: [PATCH v2 16/31] qapi/qom: Add ObjectOptions for confidential-guest-support

2021-02-24 Thread Kevin Wolf
Am 24.02.2021 um 16:21 hat Dr. David Alan Gilbert geschrieben: > * Kevin Wolf (kw...@redhat.com) wrote: > > This adds a QAPI schema for the properties of the objects implementing > > the confidential-guest-support interface. > > > > pef-guest and s390x-pv-guest don't have any properties, so they

[PATCH 13/33] virfirewall: Don't check OOM in ADD_ARG macro

2021-02-24 Thread Peter Krempa
VIR_RESIZE_N can't fail nowadays, adjust the macro. Signed-off-by: Peter Krempa --- src/util/virfirewall.c | 20 +++- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/src/util/virfirewall.c b/src/util/virfirewall.c index 6b04a8011f..95962568f5 100644 ---

[PATCH 15/33] virfirewall: virFirewallAddRuleFullV: Remove OOM check from VIR_APPEND_ELEMENT

2021-02-24 Thread Peter Krempa
VIR_APPEND_ELEMENT_COPY will abort the program on OOM so there's no need to check. Signed-off-by: Peter Krempa --- src/util/virfirewall.c | 19 ++- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/src/util/virfirewall.c b/src/util/virfirewall.c index

[PATCH 18/33] util: xml: Add virXMLBufferCreate wrapper

2021-02-24 Thread Peter Krempa
'xmlBufferCreate' returns NULL only on allocation failure. Add a wrapper which will call 'abort()' in such case in a centralised spot. It doesn't make much sense to continue execution from here. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 5 + src/conf/network_conf.c | 5

[PATCH 14/33] virfirewall: Remove OOM checks from virFirewallStartTransaction

2021-02-24 Thread Peter Krempa
Neither virFirewallGroupNew nor VIR_EXPAND_N can fail. Signed-off-by: Peter Krempa --- src/util/virfirewall.c | 13 +++-- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/util/virfirewall.c b/src/util/virfirewall.c index 95962568f5..66b33d4a91 100644 ---

[PATCH 25/33] util: iohelper: Don't handle OOM from posix_memalign

2021-02-24 Thread Peter Krempa
Similarly to other allocation calls abort() on failure. Signed-off-by: Peter Krempa --- src/util/iohelper.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/util/iohelper.c b/src/util/iohelper.c index 49d939d290..b8810d16d3 100644 --- a/src/util/iohelper.c +++

[PATCH 28/33] libxl: abort() on failure of libxl_cpu_bitmap_alloc()

2021-02-24 Thread Peter Krempa
Attempting to report error in case when we ran out of memory is pointless. Signed-off-by: Peter Krempa --- src/libxl/libxl_conf.c | 6 ++ src/libxl/libxl_driver.c | 7 +++ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c

[PATCH 12/33] virCloseCallbacksGetForConn: Remove OOM handling

2021-02-24 Thread Peter Krempa
VIR_EXPAND_N will abort so we can simplify the hash iterator. Signed-off-by: Peter Krempa --- src/hypervisor/virclosecallbacks.c | 15 +-- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/hypervisor/virclosecallbacks.c b/src/hypervisor/virclosecallbacks.c index

[PATCH 22/33] virXMLParseHelper: abort() on allocation failure

2021-02-24 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/util/virxml.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/util/virxml.c b/src/util/virxml.c index 62bbafacd6..060b7530fc 100644 --- a/src/util/virxml.c +++ b/src/util/virxml.c @@ -789,10 +789,8 @@ virXMLParseHelper(int

[PATCH 21/33] virXMLXPathContextNew: abort() on allocation failure

2021-02-24 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/util/virxml.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/util/virxml.c b/src/util/virxml.c index ebe479f5d3..62bbafacd6 100644 --- a/src/util/virxml.c +++ b/src/util/virxml.c @@ -51,10 +51,8 @@ virXMLXPathContextNew(xmlDocPtr

[PATCH 26/33] hyperv: abort() failure of wsmc_fault_new()

2021-02-24 Thread Peter Krempa
The function just allocates a helper object. Reporting errors would be pointless when we encounter OOM situation. Signed-off-by: Peter Krempa --- src/hyperv/hyperv_wmi.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/hyperv/hyperv_wmi.c b/src/hyperv/hyperv_wmi.c

[PATCH 31/33] storage: Don't report OOM error on failure of glfs_new

2021-02-24 Thread Peter Krempa
OOM isn't the only failure glfs_new can encounter. Report an error which might give more insight. libgfapi seems to be setting errno but reporting a system error migt be misleading. Signed-off-by: Peter Krempa --- src/storage/storage_backend_gluster.c | 3 ++-

[PATCH 32/33] virVMXConvertToUTF8: Report non-OOM error on failure of xmlBufferCreateStatic

2021-02-24 Thread Peter Krempa
The function has also non-OOM failure case when the passed string has 0 length, so reporting OOM error is not correct. Signed-off-by: Peter Krempa --- src/vmx/vmx.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c index

[PATCH 33/33] util: virerror: Remove virReportOOMError

2021-02-24 Thread Peter Krempa
Trying to report an OOM error is pointless since our infrastructure to report error needs to allocate memory to report the error. In addition our code mistakenly reported OOM errors even in cases where a function could fail for another reason, which would make issues harder to debug. Remove the

[PATCH 29/33] virVBoxSnapshotConfSaveVboxFile: abort() on failure to allocate xmlDoc and comment

2021-02-24 Thread Peter Krempa
'xmlNewDoc' and 'xmlNewDocComment' return NULL only on allocation failure. Attempting to raise an error is pointless. Signed-off-by: Peter Krempa --- src/vbox/vbox_snapshot_conf.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/vbox/vbox_snapshot_conf.c

[PATCH 30/33] util: json: Report non-OOM error on yajl failure

2021-02-24 Thread Peter Krempa
The yajl library returns a wide range of error codes so reporting OOM on any failure is wrong. In case the error was really based by memory issue the error reporting will probably cause an abort anyways. Change the error message so that we know that it happened in JSON at least. Signed-off-by:

[PATCH 23/33] util: virprocess: abort() on CPU_ALLOC failure

2021-02-24 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/util/virprocess.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/util/virprocess.c b/src/util/virprocess.c index 41c5678537..69d64e9466 100644 --- a/src/util/virprocess.c +++ b/src/util/virprocess.c @@ -462,10 +462,8 @@

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

2021-02-24 Thread Peter Krempa
Out of memory isn't the only reason the function can fail. Add a message stating that copying of a XML node failed. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 3 ++- src/test/test_driver.c | 6 -- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git

[PATCH 17/33] util: virnetlink: Add wrapper for 'nlmsg_alloc_simple'

2021-02-24 Thread Peter Krempa
The function is used in many places and fails only on allocation failures. Since trying to recover from allocation failure of a small buffer by reporting error doesn't make sense add a wrapper for 'nlmsg_alloc_simple' which will 'abort()' on failure and replace all allocations of netlink message

[PATCH 27/33] vbox: abort() on allocation failure in UTF8<->UTF16 conversion

2021-02-24 Thread Peter Krempa
Trying to report an error on OOM is pointless since error handling allocates memory. Signed-off-by: Peter Krempa --- src/vbox/vbox_common.c | 20 src/vbox/vbox_common.h | 15 +-- 2 files changed, 13 insertions(+), 22 deletions(-) diff --git

[PATCH 24/33] virURIFormat: abort() on failure

2021-02-24 Thread Peter Krempa
If the argument of 'xmlSaveUri' is non-NULL the function returns NULL on OOM failure only. Thus we can directly abort rather than try to do the impossible recovery. Signed-off-by: Peter Krempa --- src/util/viruri.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git

[PATCH 19/33] util: xml: Add wrapper for 'xmlNewNode'

2021-02-24 Thread Peter Krempa
Add a wrapper that will handle the out of memory condition by abort() and also prevents callers from having to typecast the argument. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c| 7 ++- src/libvirt_private.syms | 1 + src/util/virxml.c | 13

[PATCH 16/33] virfirewall: Remove impossible OOM error reporting

2021-02-24 Thread Peter Krempa
There's nothing that would set the 'err' field of virFirewallPtr to ENOMEM so we can remove the checks. Signed-off-by: Peter Krempa --- src/util/virfirewall.c | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/util/virfirewall.c b/src/util/virfirewall.c index

[PATCH 11/33] util: vircommand: Remove OOM handling

2021-02-24 Thread Peter Krempa
The OOM error handling is dead code nowadays. Signed-off-by: Peter Krempa --- src/util/vircommand.c | 96 +-- 1 file changed, 20 insertions(+), 76 deletions(-) diff --git a/src/util/vircommand.c b/src/util/vircommand.c index f11caf0d6e..1a4b77ea24 100644

[PATCH 10/33] virDomainDefSetMetadata: Rework memory handling

2021-02-24 Thread Peter Krempa
Switch to use g_autoptr for 'doc' and 'new' local variables. Additionally report proper error when 'xmlAddChild' fails because OOM is not the only error it can report. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 34 -- 1 file changed, 16

[PATCH 09/33] lxc_process: Remove OOM handling from logging setup

2021-02-24 Thread Peter Krempa
'virLogGetFilters' doesn't return failure and 'virLogGetOutputs' reports it's own errors. Signed-off-by: Peter Krempa --- src/lxc/lxc_process.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c index cbc04a3dcd..679709605e

[PATCH 05/33] virCommandAddArgBuffer: Simplify clearing of @buf

2021-02-24 Thread Peter Krempa
Get the buffer contents into a temporary variable with automatic clearing so that the error branches don't have to reset the buffer. Additionally handle the NULL string case before assignment. Signed-off-by: Peter Krempa --- src/util/vircommand.c | 14 +++--- 1 file changed, 7

[PATCH 06/33] virCPUx86DataParse: Don't check error from x86FeatureNames

2021-02-24 Thread Peter Krempa
x86FeatureNames uses virBuffer and thus can't fail nowadays. Signed-off-by: Peter Krempa --- src/cpu/cpu_x86.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 92f945beb4..79c5868ae6 100644 --- a/src/cpu/cpu_x86.c +++

[PATCH 08/33] virBuildPath: Remove return value

2021-02-24 Thread Peter Krempa
The function can't fail nowadays, remove the return value and adjust callers. Signed-off-by: Peter Krempa --- docs/internals/command.html.in | 8 +--- src/util/virfcp.c | 3 +-- src/util/virfile.c | 7 +-- src/util/virfile.h | 2 +-

[PATCH 07/33] virhostcputest: linuxCPUStatsCompareFiles: Don't check return value of virBufferContentAndReset

2021-02-24 Thread Peter Krempa
The buffer won't encounter OOM condition nowadays Signed-off-by: Peter Krempa --- tests/virhostcputest.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/virhostcputest.c b/tests/virhostcputest.c index 786a363e48..2608f0becc 100644 --- a/tests/virhostcputest.c +++

[PATCH 04/33] virCommandAddEnv: Make stealing of argument more obvious

2021-02-24 Thread Peter Krempa
The function is supposed to always consume the passed environment variable string. Use a temp variable with autofree and g_steal_pointer to prevent having to free it manually. Signed-off-by: Peter Krempa --- src/util/vircommand.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-)

[PATCH 03/33] virDomainDefSetMetadata: Avoid temporary variable for string copy

2021-02-24 Thread Peter Krempa
Since error checking was removed when switching to g_strdup, it doesn't make much sense to have 'tmp' around. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/conf/domain_conf.c

[PATCH 02/33] util: xml: Introduce autoptr cleanup support for 'xmlNode'

2021-02-24 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/util/virxml.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/util/virxml.h b/src/util/virxml.h index f73b8975ba..e696dd25f5 100644 --- a/src/util/virxml.h +++ b/src/util/virxml.h @@ -255,6 +255,7 @@

[PATCH 01/33] Remove useless comments for VIR_FROM_THIS definition

2021-02-24 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/util/virpci.c | 1 - src/util/virscsi.c | 1 - src/util/virscsivhost.c | 1 - 3 files changed, 3 deletions(-) diff --git a/src/util/virpci.c b/src/util/virpci.c index 8147ce11e9..3df4199532 100644 --- a/src/util/virpci.c +++ b/src/util/virpci.c @@

[PATCH 00/33] Remove the now misleading virReportOOMError infra

2021-02-24 Thread Peter Krempa
'virReportOOMError' is nowadays mostly useless since an OOM error will trigger yet another allocation failure in the logger when attempting to log the error. Additionally it was also used in few places which can fail with other failures than OOM. To prevent both errorneous usage types, let's

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

2021-02-24 Thread Peter Krempa
On Wed, Feb 24, 2021 at 14:52:24 +0100, Kevin Wolf wrote: > This series adds a QAPI type for the properties of all user creatable > QOM types and finally makes the --object command line option (in all > binaries) and the object-add monitor commands (in QMP and HMP) use the > new ObjectOptions

[PATCH v2 12/12] [DON'T PUSH] Force-check all configs with latest capabilities

2021-02-24 Thread Peter Krempa
Hack the qemuxml2argvtest to force-validate everything with latest capabilities. The result is expected: 190) QEMU XML-2-ARGV disk-network-tlsx509-vxhs.x86_64-5.0.0... failed to validate -blockdev

[PATCH v2 03/12] qemu: command: Generate commandline of iothread objects JSON

2021-02-24 Thread Peter Krempa
The commandline generator for 'iothread' objects has a private implementation of the properties. Convert it to JSON so that it can be later validated. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 18 +++--- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git

[PATCH v2 04/12] qemu: capabilities: Introduce QEMU_CAPS_OBJECT_QAPIFIED

2021-02-24 Thread Peter Krempa
Starting from qemu-6.0 the parameters of -object/object-add are formally described by the QAPI schema. Additionally this changes the nesting of the properties as the 'props' nested object will be flattened to the parent. We'll need to detect whether qemu switched to this new approach to generate

[PATCH v2 02/12] qemu: command: Generate commandline of 'sev0' sev-guest object via JSON

2021-02-24 Thread Peter Krempa
While the 'sev0' sev-guest object will never be hotplugged, but we want to generate it through JSON so that we'll be able to validate all parameters of '-object' against the QAPI schema once 'object-add' is qapified in qemu. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c

[PATCH v2 06/12] qemu: command: Introduce raw JSON passthrough for '-object' for testing

2021-02-24 Thread Peter Krempa
The qemu commandline builder's QEMU_BUILD_COMMANDLINE_VALIDATE_KEEP_JSON flag disables JSON->commandline conversion so that our qemuxml2argvtest can use the commandline test repostitory for validating our JSON props generators which are in many cases used on the montitor where we need to conform

[PATCH v2 10/12] qemumonitorjsontest: Remove bomb guarding object-add

2021-02-24 Thread Peter Krempa
Libvirt is now prepared for QAPIfied object-add. Signed-off-by: Peter Krempa --- tests/qemumonitorjsontest.c | 14 -- 1 file changed, 14 deletions(-) diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 82c74e2ef9..48b41c908a 100644 ---

[PATCH v2 01/12] qemu: command: Generate commandline of 'masterKey0' secret via JSON

2021-02-24 Thread Peter Krempa
While the 'masterKey0' secret object will never be hotplugged we want to generate it through JSON so that we'll be able to validate all parameters of '-object' against the QAPI schema once 'object-add' is qapified in qemu. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 12

[PATCH v2 08/12] qemuMonitorCreateObjectPropsWrap: Open-code in qemuBuildMemoryBackendProps

2021-02-24 Thread Peter Krempa
There's just one caller left. Since qemuBuildMemoryBackendProps is too complex to be modified for now, just move the adding of 'id' and 'qom' type directly into the function. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 6 -- src/qemu/qemu_monitor.c | 15 ---

[PATCH v2 11/12] tests: qemucapabilities: Update qemu caps for object-add qapification

2021-02-24 Thread Peter Krempa
qemu qapified object-add, which means that it's introspectable via query-qmp-schema. Update the qemu-6.0 capabilities to commit XX TODO: update to pushed version --- .../caps_6.0.0.x86_64.replies | 3238 - .../caps_6.0.0.x86_64.xml |

[PATCH v2 05/12] tests: qemuxml2argv: Validate generation of JSON props for object-add

2021-02-24 Thread Peter Krempa
Similarly to the validation for blockdev-add and netdev_add, use the qemuxml2argv test repository to drive validation of props for object-add. Signed-off-by: Peter Krempa --- tests/qemuxml2argvtest.c | 20 1 file changed, 20 insertions(+) diff --git

[PATCH v2 07/12] qemu: monitor: Make wrapping of 'props' of 'object-add' optional

2021-02-24 Thread Peter Krempa
Construct the JSON object which is used for object-add without the 'props' wrapper and add the wrapper only in the monitor code. This simplifies the JSON->commandline generator in the first place and also prepares for upcoming qemu where 'props' will be removed. Signed-off-by: Peter Krempa ---

[PATCH v2 00/12] qemu: Prepare for QAPIfied object-add

2021-02-24 Thread Peter Krempa
QEMU plans to QAPIfy object add. This series prepares for the API change (drop of 'props' wrapper for the object) and adds testing based on our qemuxml2argv test data which forces the output to JSON and validates it agains the schema. Based on Kevin's qemu patches:

[PATCH v2 09/12] qemu: monitor: Don't add 'props' wrapper if qemu has QEMU_CAPS_OBJECT_QAPIFIED

2021-02-24 Thread Peter Krempa
Set 'objectAddNoWrap' when the capability is present. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor.c | 5 + 1 file changed, 5 insertions(+) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 121c21be5c..1e4c4809b1 100644 --- a/src/qemu/qemu_monitor.c +++

Re: [PATCH v2 28/31] hmp: QAPIfy object_add

2021-02-24 Thread Dr. David Alan Gilbert
* Kevin Wolf (kw...@redhat.com) wrote: > This switches the HMP command object_add from a QemuOpts-based parser to > user_creatable_add_from_str() which uses a keyval parser and enforces > the QAPI schema. > > Apart from being a cleanup, this makes non-scalar properties and help > accessible. In

Re: [PATCH v2 16/31] qapi/qom: Add ObjectOptions for confidential-guest-support

2021-02-24 Thread Dr. David Alan Gilbert
* Kevin Wolf (kw...@redhat.com) wrote: > This adds a QAPI schema for the properties of the objects implementing > the confidential-guest-support interface. > > pef-guest and s390x-pv-guest don't have any properties, so they only > need to be added to the ObjectType enum without adding a new

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

2021-02-24 Thread Philippe Mathieu-Daudé
On 2/24/21 3:38 PM, Peter Maydell wrote: > On Wed, 24 Feb 2021 at 13:21, Daniel P. Berrangé wrote: >> >> The following features have been deprecated for well over the 2 >> release cycle we promise >> >> ``-usbdevice`` (since 2.10.0) >> ``-drive file=3Djson:{...{'driver':'file'}}`` (since 3.0)

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

2021-02-24 Thread Daniel P . Berrangé
On Wed, Feb 24, 2021 at 02:38:43PM +, Peter Maydell wrote: > On Wed, 24 Feb 2021 at 13:21, Daniel P. Berrangé wrote: > > > > The following features have been deprecated for well over the 2 > > release cycle we promise > > > > ``-usbdevice`` (since 2.10.0) > > ``-drive

Re: [PATCH 11/14] block: remove 'encryption_key_missing' flag from QAPI

2021-02-24 Thread Thomas Huth
On 24/02/2021 14.11, Daniel P. Berrangé wrote: This has been hardcoded to "false" since 2.10.0, since secrets required to unlock block devices are now always provided upfront instead of using interactive prompts. Signed-off-by: Daniel P. Berrangé --- block/qapi.c | 1 -

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

2021-02-24 Thread Peter Maydell
On Wed, 24 Feb 2021 at 13:21, Daniel P. Berrangé wrote: > > The following features have been deprecated for well over the 2 > release cycle we promise > > ``-usbdevice`` (since 2.10.0) > ``-drive file=3Djson:{...{'driver':'file'}}`` (since 3.0) > ``-vnc acl`` (since 4.0.0) > ``-mon

Re: [PATCH 10/14] hw/scsi: remove 'scsi-disk' device

2021-02-24 Thread Thomas Huth
On 24/02/2021 14.11, Daniel P. Berrangé wrote: The 'scsi-hd' and 'scsi-cd' devices provide suitable alternatives. Signed-off-by: Daniel P. Berrangé --- docs/system/deprecated.rst | 9 - docs/system/removed-features.rst | 6 hw/i386/pc.c | 1 -

Re: [PATCH 09/14] hw/ide: remove 'ide-drive' device

2021-02-24 Thread Thomas Huth
On 24/02/2021 14.11, Daniel P. Berrangé wrote: The 'ide-hd' and 'ide-cd' devices provide suitable alternatives. Signed-off-by: Daniel P. Berrangé --- docs/qdev-device-use.txt | 2 +- docs/system/deprecated.rst | 6 - docs/system/removed-features.rst | 9

Re: [PATCH 04/14] softmmu: remove '-usbdevice' command line option

2021-02-24 Thread Daniel P . Berrangé
On Wed, Feb 24, 2021 at 02:58:19PM +0100, Thomas Huth wrote: > On 24/02/2021 14.11, Daniel P. Berrangé wrote: > > This was replaced by the '-device usb-DEV' option. > > > > Signed-off-by: Daniel P. Berrangé > > --- > > docs/system/deprecated.rst | 9 --- > >

[PATCH] qemu_monitor: Document qemuMonitorUnregister()

2021-02-24 Thread Michal Privoznik
The most important bit is that the caller is expected to pass locked monitor. Signed-off-by: Michal Privoznik --- src/qemu/qemu_monitor.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index ed35da17e1..73f337a6be 100644 ---

Re: [PATCH v2] qemu: Add missing lock in qemuProcessHandleMonitorEOF

2021-02-24 Thread Michal Privoznik
On 2/24/21 12:28 PM, Peng Liang wrote: qemuMonitorUnregister will be called in multiple threads (e.g. threads in rpc worker pool and the vm event thread). In some cases, it isn't protected by the monitor lock, which may lead to call g_source_unref more than one time and a use-after-free problem

[PATCH v2 31/31] qom: Drop QemuOpts based interfaces

2021-02-24 Thread Kevin Wolf
user_creatable_add_opts() has only a single user left, which is a test case. Rewrite the test to use user_creatable_add_type() instead (which is the remaining function that doesn't require a QAPI schema) and drop the QemuOpts related functions. Signed-off-by: Kevin Wolf ---

[PATCH v2 23/31] qom: Factor out user_creatable_process_cmdline()

2021-02-24 Thread Kevin Wolf
The implementation for --object can be shared between qemu-storage-daemon and other binaries, so move it into a function in qom/object_interfaces.c that is accessible from everywhere. This also requires moving the implementation of qmp_object_add() into a new user_creatable_add_qapi(), because

[PATCH v2 22/31] qom: Remove user_creatable_add_dict()

2021-02-24 Thread Kevin Wolf
This function is now unused and can be removed. Signed-off-by: Kevin Wolf --- include/qom/object_interfaces.h | 18 -- qom/object_interfaces.c | 32 2 files changed, 50 deletions(-) diff --git a/include/qom/object_interfaces.h

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

2021-02-24 Thread Kevin Wolf
This converts object-add from 'gen': false to the ObjectOptions QAPI type. As an immediate benefit, clients can now use QAPI schema introspection for user creatable QOM objects. It is also the first step towards making the QAPI schema the only external interface for the creation of user creatable

[PATCH v2 27/31] qom: Add user_creatable_add_from_str()

2021-02-24 Thread Kevin Wolf
This is a version of user_creatable_process_cmdline() with an Error parameter that never calls exit() and is therefore usable in HMP. Signed-off-by: Kevin Wolf --- include/qom/object_interfaces.h | 16 qom/object_interfaces.c | 29 - 2 files

Re: [PATCH 04/14] softmmu: remove '-usbdevice' command line option

2021-02-24 Thread Thomas Huth
On 24/02/2021 14.11, Daniel P. Berrangé wrote: This was replaced by the '-device usb-DEV' option. Signed-off-by: Daniel P. Berrangé --- docs/system/deprecated.rst | 9 --- docs/system/removed-features.rst | 9 +++ softmmu/vl.c | 42

[PATCH v2 28/31] hmp: QAPIfy object_add

2021-02-24 Thread Kevin Wolf
This switches the HMP command object_add from a QemuOpts-based parser to user_creatable_add_from_str() which uses a keyval parser and enforces the QAPI schema. Apart from being a cleanup, this makes non-scalar properties and help accessible. In order for help to be printed to the monitor instead

[PATCH v2 25/31] qemu-img: Use user_creatable_process_cmdline() for --object

2021-02-24 Thread Kevin Wolf
This switches qemu-img from a QemuOpts-based parser for --object to user_creatable_process_cmdline() which uses a keyval parser and enforces the QAPI schema. Apart from being a cleanup, this makes non-scalar properties accessible. Signed-off-by: Kevin Wolf --- qemu-img.c | 239

[PATCH v2 24/31] qemu-io: Use user_creatable_process_cmdline() for --object

2021-02-24 Thread Kevin Wolf
This switches qemu-io from a QemuOpts-based parser for --object to user_creatable_process_cmdline() which uses a keyval parser and enforces the QAPI schema. Apart from being a cleanup, this makes non-scalar properties accessible. Signed-off-by: Kevin Wolf --- qemu-io.c | 33

[PATCH v2 30/31] vl: QAPIfy -object

2021-02-24 Thread Kevin Wolf
This switches the system emulator from a QemuOpts-based parser for -object to user_creatable_parse_str() which uses a keyval parser and enforces the QAPI schema. Apart from being a cleanup, this makes non-scalar properties accessible. This adopts a similar model as -blockdev uses: When parsing

[PATCH v2 21/31] qemu-storage-daemon: Implement --object with qmp_object_add()

2021-02-24 Thread Kevin Wolf
This QAPIfies --object and ensures that QMP and the command line option behave the same. Signed-off-by: Kevin Wolf --- storage-daemon/qemu-storage-daemon.c | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/storage-daemon/qemu-storage-daemon.c

[PATCH v2 07/31] qapi/qom: Add ObjectOptions for memory-backend-*

2021-02-24 Thread Kevin Wolf
This adds a QAPI schema for the properties of the memory-backend-* objects. HostMemPolicy has to be moved to an include file that can be used by the storage daemon, too, because ObjectOptions must be the same in all binaries if we don't want to compile the whole code multiple times.

[PATCH v2 29/31] qom: Add user_creatable_parse_str()

2021-02-24 Thread Kevin Wolf
The system emulator has a more complicated way of handling command line options in that it reorders options before it processes them. This means that parsing object options and creating the object happen at two different points. Split the parsing part into a separate function that can be reused by

[PATCH v2 26/31] qemu-nbd: Use user_creatable_process_cmdline() for --object

2021-02-24 Thread Kevin Wolf
This switches qemu-nbd from a QemuOpts-based parser for --object to user_creatable_process_cmdline() which uses a keyval parser and enforces the QAPI schema. Apart from being a cleanup, this makes non-scalar properties accessible. Signed-off-by: Kevin Wolf --- qemu-nbd.c | 34

[PATCH v2 18/31] qapi/qom: Add ObjectOptions for x-remote-object

2021-02-24 Thread Kevin Wolf
This adds a QAPI schema for the properties of the x-remote-object object. Signed-off-by: Kevin Wolf --- qapi/qom.json | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/qapi/qom.json b/qapi/qom.json index f8ff322df0..6793342e81 100644 --- a/qapi/qom.json

[PATCH v2 05/31] qapi/qom: Add ObjectOptions for cryptodev-*

2021-02-24 Thread Kevin Wolf
This adds a QAPI schema for the properties of the cryptodev-* objects. These interfaces have some questionable aspects (cryptodev-backend is really an abstract base class without function, and the queues option only makes sense for cryptodev-vhost-user), but as the goal is to represent the

[PATCH v2 20/31] qom: Make "object" QemuOptsList optional

2021-02-24 Thread Kevin Wolf
This code is going away anyway, but for a few more commits, we'll be in a state where some binaries still use QemuOpts and others don't. If the "object" QemuOptsList doesn't even exist, we don't have to remove (or fail to remove, and therefore abort) a user creatable object from it.

[PATCH v2 14/31] qapi/qom: Add ObjectOptions for filter-*

2021-02-24 Thread Kevin Wolf
This adds a QAPI schema for the properties of the filter-* objects. Some parts of the interface (in particular NetfilterProperties.position) are very unusual for QAPI, but for now just describe the existing interface. net.json can't be included in qom.json because the storage daemon doesn't have

[PATCH v2 10/31] qapi/qom: Add ObjectOptions for secret*, deprecate 'loaded'

2021-02-24 Thread Kevin Wolf
This adds a QAPI schema for the properties of the secret* objects. The 'loaded' property doesn't seem to make sense as an external interface: It is automatically set to true in ucc->complete, and explicitly setting it to true earlier just means that additional options will be silently ignored.

[PATCH v2 08/31] qapi/qom: Add ObjectOptions for rng-*, deprecate 'opened'

2021-02-24 Thread Kevin Wolf
This adds a QAPI schema for the properties of the rng-* objects. The 'opened' property doesn't seem to make sense as an external interface: It is automatically set to true in ucc->complete, and explicitly setting it to true earlier just means that trying to set additional options will result in

[PATCH v2 03/31] qapi/qom: Add ObjectOptions for iothread

2021-02-24 Thread Kevin Wolf
Add an ObjectOptions union that will eventually describe the options of all user creatable object types. As unions can't exist without any branches, also add the first object type. This adds a QAPI schema for the properties of the iothread object. Signed-off-by: Kevin Wolf --- qapi/qom.json |

[PATCH v2 11/31] qapi/qom: Add ObjectOptions for tls-*, deprecate 'loaded'

2021-02-24 Thread Kevin Wolf
This adds a QAPI schema for the properties of the tls-* objects. The 'loaded' property doesn't seem to make sense as an external interface: It is automatically set to true in ucc->complete, and explicitly setting it to true earlier just means that additional options will be silently ignored. In

[PATCH v2 13/31] qapi/qom: Add ObjectOptions for colo-compare

2021-02-24 Thread Kevin Wolf
This adds a QAPI schema for the properties of the colo-compare object. Signed-off-by: Kevin Wolf --- qapi/qom.json | 49 + 1 file changed, 49 insertions(+) diff --git a/qapi/qom.json b/qapi/qom.json index 4b1cd4b8dc..8e4414f843 100644 ---

[PATCH v2 12/31] qapi/qom: Add ObjectOptions for can-*

2021-02-24 Thread Kevin Wolf
This adds a QAPI schema for the properties of the can-* objects. can-bus doesn't have any properties, so it only needs to be added to the ObjectType enum without adding a new branch to ObjectOptions. Signed-off-by: Kevin Wolf --- qapi/qom.json | 18 ++ 1 file changed, 18

[PATCH v2 17/31] qapi/qom: Add ObjectOptions for input-*

2021-02-24 Thread Kevin Wolf
This adds a QAPI schema for the properties of the input-* objects. ui.json cannot be included in qom.json because the storage daemon can't use it, so move GrabToggleKeys to common.json. Signed-off-by: Kevin Wolf --- qapi/common.json | 12 ++ qapi/qom.json| 58

[PATCH v2 16/31] qapi/qom: Add ObjectOptions for confidential-guest-support

2021-02-24 Thread Kevin Wolf
This adds a QAPI schema for the properties of the objects implementing the confidential-guest-support interface. pef-guest and s390x-pv-guest don't have any properties, so they only need to be added to the ObjectType enum without adding a new branch to ObjectOptions. Signed-off-by: Kevin Wolf

  1   2   >