[PATCH] meson: tools: depend on keycode generated sources

2021-03-02 Thread Roman Bogorodskiy
Tools depend on keycode generated sources, so declare that as an explicit dependency, otherwise it might fail with: ../tools/virsh-completer-domain.c:35:10: fatal error: 'virkeynametable_linux.h' file not found ^ Signed-off-by: Roman Bogorodskiy --- I noticed

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

2021-03-02 Thread Jim Fehlig
On 3/2/21 3:18 AM, Daniel P. Berrangé wrote: On Tue, Mar 02, 2021 at 08:51:29AM +0100, Peter Krempa wrote: Now when glib was introduced Daniel provided the following analysis of glib versions: RHEL-8: 2.56.1 RHEL-7: 2.50.3 Debian (Buster): 2.58.3 Debian (Stretch):

答复: Some confusion about lsilogic controller

2021-03-02 Thread xingchaochao
Thank you for your kind reply. This issue involves a qemu bug, and the patch has been queued by the qemu community on March 2. https://patchwork.kernel.org/project/qemu-devel/patch/20210302133016.1221081-1-liangpen...@huawei.com/ Regards, Xingchaochao -邮件原件- 发件人: Daniel P. Berrangé

[libvirt PATCH v5 25/30] nodedev: add element to mdev caps

2021-03-02 Thread Jonathon Jongsma
It will be useful to be able to specify a particular UUID for a mediated device when defining the node device. To accomodate that, allow this to be specified in the xml schema. This patch also parses and formats that value to the xml, but does not yet use it. Signed-off-by: Jonathon Jongsma

[libvirt PATCH v5 21/30] virsh: Factor out function to find node device

2021-03-02 Thread Jonathon Jongsma
Several functions accept providing a node device by name or by wwnn,wwpn pair. Extract the logic to do this into a function that can be used by both callers. Signed-off-by: Jonathon Jongsma Reviewed-by: Erik Skultety --- tools/virsh-nodedev.c | 62 +++ 1

[libvirt PATCH v5 18/30] virsh: add nodedev-define command

2021-03-02 Thread Jonathon Jongsma
Add a virsh command that maps to virNodeDeviceDefineXML(). Signed-off-by: Jonathon Jongsma Reviewed-by: Erik Skultety --- tools/virsh-nodedev.c | 58 +++ 1 file changed, 58 insertions(+) diff --git a/tools/virsh-nodedev.c b/tools/virsh-nodedev.c index

[libvirt PATCH v5 28/30] nodedev: add docs about mdev attribute order

2021-03-02 Thread Jonathon Jongsma
Mention that mdev attribute order is significant. Signed-off-by: Jonathon Jongsma --- docs/formatnode.html.in | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/formatnode.html.in b/docs/formatnode.html.in index 5c7286df8a..c58cd01395 100644 ---

[libvirt PATCH v5 30/30] nodedev: avoid delay when defining a new mdev

2021-03-02 Thread Jonathon Jongsma
When calling virNodeDeviceDefineXML() to define a new mediated device, we call virMdevctlDefine() and then wait for the new device to appear in the driver's device list before returning. This caused long delays due to the behavior of nodeDeviceFindNewMediatedDevice(). This function checks to see

[libvirt PATCH v5 27/30] nodedev: fix hang when destroying an mdev in use

2021-03-02 Thread Jonathon Jongsma
Calling `mdevctl stop` for a mediated device that is in use by an active domain will block until that vm exits (or the vm closes the device). Since the nodedev driver cannot query the hypervisor driver to see whether any active domains are using the device, we resort to a workaround that relies on

[libvirt PATCH v5 29/30] nodedev: factor out function to add mediated devices

2021-03-02 Thread Jonathon Jongsma
To accomodate re-use of this functionality in a following patch, split out the processing of an individual mdev definition into a separate function. --- src/node_device/node_device_driver.c | 103 +++ 1 file changed, 57 insertions(+), 46 deletions(-) diff --git

[libvirt PATCH v5 10/30] nodedev: add DEFINED/UNDEFINED lifecycle events

2021-03-02 Thread Jonathon Jongsma
Since a mediated device can be persistently defined by the mdevctl backend, we need additional lifecycle events beyond CREATED/DELETED to indicate that e.g. the device has been stopped but the device definition still exists. Signed-off-by: Jonathon Jongsma --- examples/c/misc/event-test.c

[libvirt PATCH v5 24/30] virsh: add "nodedev-start" command

2021-03-02 Thread Jonathon Jongsma
This virsh command maps to virNodeDeviceCreate(), which starts a node device that has been previously defined by virNodeDeviceDefineXML(). This is only supported for mediated devices. Signed-off-by: Jonathon Jongsma Reviewed-by: Erik Skultety --- tools/virsh-nodedev.c | 57

[libvirt PATCH v5 23/30] api: add virNodeDeviceCreate()

2021-03-02 Thread Jonathon Jongsma
This new API function provides a way to start a persistently-defined mediate device that was defined by virNodeDeviceDefineXML() (or one that was defined externally via mdevctl) Signed-off-by: Jonathon Jongsma Reviewed-by: Erik Skultety --- include/libvirt/libvirt-nodedev.h| 2 +

[libvirt PATCH v5 17/30] virsh: Add --inactive, --all to nodedev-list

2021-03-02 Thread Jonathon Jongsma
Now that we can filter active and inactive node devices in virConnectListAllNodeDevices(), add these switches to the virsh command. Eventual output (once everything is hooked up): virsh # nodedev-list --cap mdev mdev_bd2ea955_3402_4252_8c17_7468083a0f26 virsh # nodedev-list

[libvirt PATCH v5 26/30] nodedev: add ability to specify UUID for new mdevs

2021-03-02 Thread Jonathon Jongsma
Use the new element in the mdev caps to define and start devices with a specific UUID. Signed-off-by: Jonathon Jongsma --- src/node_device/node_device_driver.c | 19 --- ...19_36ea_4111_8f0a_8c9a70e21366-define.argv | 3 ++-

[libvirt PATCH v5 19/30] nodedev: refactor tests to support mdev undefine

2021-03-02 Thread Jonathon Jongsma
mdevctl 'stop' and 'undefine' commands take the same uuid parameter, so refactor the test infrastructure to share common implementation for both of these commands. The 'undefine' command will be introduced in a following patch. Signed-off-by: Jonathon Jongsma --- tests/nodedevmdevctltest.c | 48

[libvirt PATCH v5 22/30] virsh: add nodedev-undefine command

2021-03-02 Thread Jonathon Jongsma
Add a virsh command that maps to virNodeDeviceUndefine(). Signed-off-by: Jonathon Jongsma Reviewed-by: Erik Skultety --- tools/virsh-nodedev.c | 59 +++ 1 file changed, 59 insertions(+) diff --git a/tools/virsh-nodedev.c b/tools/virsh-nodedev.c index

[libvirt PATCH v5 16/30] api: add virNodeDeviceDefineXML()

2021-03-02 Thread Jonathon Jongsma
With mediated devices, we can now define persistent node devices that can be started and stopped. In order to take advantage of this, we need an API to define new node devices. Signed-off-by: Jonathon Jongsma --- include/libvirt/libvirt-nodedev.h| 4 ++ src/driver-nodedev.h

[libvirt PATCH v5 14/30] nodedev: Refresh mdev devices when changes are detected

2021-03-02 Thread Jonathon Jongsma
We need to query mdevctl for changes to device definitions since an administrator can define new devices by executing mdevctl outside of libvirt. In the future, mdevctl may add a way to signal device add/remove via events, but for now we resort to a bit of a workaround: monitoring the mdevctl

[libvirt PATCH v5 15/30] nodedev: add function to generate mdevctl define command

2021-03-02 Thread Jonathon Jongsma
Abstract out the function used to generate the commandline for 'mdevctl start' since they take the same arguments. Add tests to ensure that we're generating the command properly. Signed-off-by: Jonathon Jongsma --- src/node_device/node_device_driver.c | 34 +++--

[libvirt PATCH v5 20/30] api: add virNodeDeviceUndefine()

2021-03-02 Thread Jonathon Jongsma
This interface allows you to undefine a persistently defined (but inactive) mediated devices. It is implemented via 'mdevctl' Signed-off-by: Jonathon Jongsma --- include/libvirt/libvirt-nodedev.h | 2 + src/access/viraccessperm.c| 2 +-

[libvirt PATCH v5 09/30] nodedev: add persistence to virNodeDeviceObj

2021-03-02 Thread Jonathon Jongsma
Consistent with other objects (e.g. virDomainObj), add a field to indicate whether the node device is persistent or transient. Signed-off-by: Jonathon Jongsma --- src/conf/virnodedeviceobj.c | 16 src/conf/virnodedeviceobj.h | 6 ++ src/libvirt_private.syms| 2 ++ 3

[libvirt PATCH v5 12/30] nodedev: add helper functions to remove node devices

2021-03-02 Thread Jonathon Jongsma
When a mediated device is stopped or undefined by an application outside of libvirt, we need to remove it from our list of node devices within libvirt. This patch introduces virNodeDeviceObjListRemoveLocked() and virNodeDeviceObjListForEachRemove() (which are analogous to other types of object

[libvirt PATCH v5 13/30] nodedev: handle mdevs that disappear from mdevctl

2021-03-02 Thread Jonathon Jongsma
mdevctl does not currently provide any events when the list of defined devices changes, so we will need to poll mdevctl for the list of defined devices periodically. When a mediated device no longer exists from one iteration to the next, we need to treat it as an "undefine" event. When we get

[libvirt PATCH v5 08/30] nodedev: add ability to list defined mdevs

2021-03-02 Thread Jonathon Jongsma
This adds an internal API to query for persistent mediated devices that are defined by mdevctl. Upcoming commits will make use of this information. Signed-off-by: Jonathon Jongsma --- src/node_device/node_device_driver.c | 18 + src/node_device/node_device_driver.h |

[libvirt PATCH v5 11/30] nodedev: add mdevctl devices to node device list

2021-03-02 Thread Jonathon Jongsma
At startup, query devices that are defined by 'mdevctl' and add them to the node device list. This adds a complication: we now have two potential sources of information for a node device: - udev for all devices and for activated mediated devices - mdevctl for persistent mediated devices

[libvirt PATCH v5 07/30] nodedev: add ability to parse mdevs from mdevctl

2021-03-02 Thread Jonathon Jongsma
This function will parse the list of mediated devices that are returned by mdevctl and convert it into our internal node device representation. Signed-off-by: Jonathon Jongsma --- src/node_device/node_device_driver.c | 143 ++ src/node_device/node_device_driver.h

[libvirt PATCH v5 06/30] nodedev: expose internal helper for naming devices

2021-03-02 Thread Jonathon Jongsma
Expose a helper function that can be used by udev and mdevctl to generate device names for node devices. Signed-off-by: Jonathon Jongsma Reviewed-by: Erik Skultety --- src/node_device/node_device_driver.c | 25 + src/node_device/node_device_driver.h | 6 ++

[libvirt PATCH v5 03/30] nodedev: introduce concept of 'active' node devices

2021-03-02 Thread Jonathon Jongsma
we will be able to define mediated devices that can be started or stopped, so we need to be able to indicate whether the device is active or not, similar to other resources (storage pools, domains, etc.) Signed-off-by: Jonathon Jongsma Reviewed-by: Erik Skultety --- src/conf/virnodedeviceobj.c

[libvirt PATCH v5 04/30] nodedev: Add ability to filter by active state

2021-03-02 Thread Jonathon Jongsma
Add two flag values for virConnectListAllNodeDevices() so that we can list only node devices that are active or inactive. Signed-off-by: Jonathon Jongsma Reviewed-by: Erik Skultety --- include/libvirt/libvirt-nodedev.h| 9 +++-- src/conf/node_device_conf.h | 8

[libvirt PATCH v5 05/30] nodedev: fix docs for virConnectListAllNodeDevices()

2021-03-02 Thread Jonathon Jongsma
It doesn't make sense to list all of the flag values in the function documentation. This is unnecessary duplication, we already refer to the enum type. Also, remove reference to exclusive groups of flags, since that does not apply to this API. Signed-off-by: Jonathon Jongsma ---

[libvirt PATCH v5 01/30] nodedev: capture and report stderror from mdevctl

2021-03-02 Thread Jonathon Jongsma
When an mdevctl command fails, there is not much information available to the user about why it failed. This is partly because we were not making use of the error message that mdevctl itself prints upon failure. Signed-off-by: Jonathon Jongsma --- src/node_device/node_device_driver.c | 46

[libvirt PATCH v5 00/30] Add support for persistent mediated devices

2021-03-02 Thread Jonathon Jongsma
This patch series follows the previously-merged series which added support for transient mediated devices. This series expands mdev support to include persistent device definitions. Again, it relies on mdevctl as the backend. It follows the common libvirt pattern of APIs by adding the following

[libvirt PATCH v5 02/30] tests: remove extra trailing semicolon

2021-03-02 Thread Jonathon Jongsma
The macro should not have a trailing semicolon so that when the macro is used, the user can add a semicolon themselves. Signed-off-by: Jonathon Jongsma Reviewed-by: Erik Skultety --- tests/nodedevmdevctltest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

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

2021-03-02 Thread Eric Blake
On 3/2/21 12:32 PM, Kevin Wolf wrote: > Am 26.02.2021 um 20:42 hat Eric Blake geschrieben: >> On 2/24/21 7:52 AM, Kevin Wolf wrote: >>> 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

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

2021-03-02 Thread Kevin Wolf
Am 26.02.2021 um 23:21 hat Eric Blake geschrieben: > On 2/24/21 7:52 AM, Kevin Wolf wrote: > > 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 > > --- > >

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

2021-03-02 Thread Kevin Wolf
Am 26.02.2021 um 22:18 hat Eric Blake geschrieben: > On 2/24/21 7:52 AM, Kevin Wolf wrote: > > 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

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

2021-03-02 Thread Kevin Wolf
Am 26.02.2021 um 21:55 hat Eric Blake geschrieben: > On 2/24/21 7:52 AM, Kevin Wolf wrote: > > 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. > >

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

2021-03-02 Thread Kevin Wolf
Am 26.02.2021 um 20:42 hat Eric Blake geschrieben: > On 2/24/21 7:52 AM, Kevin Wolf wrote: > > 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

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

2021-03-02 Thread Kevin Wolf
Am 26.02.2021 um 20:33 hat Eric Blake geschrieben: > On 2/24/21 7:52 AM, Kevin Wolf wrote: > > 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,

Re: [PATCH 1/6] util: virerror: Don't use stack'd buffers in error report helpers

2021-03-02 Thread Ján Tomko
On a Tuesday in 2021, Peter Krempa wrote: This was (probably) a relict from times when we cared about OOM conditions and the possibility to report the error. Nowadays it doesn't make sense as virRaiseErrorFull will do an allocated copy of the strings and also concatenate the error message prefix

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

2021-03-02 Thread Kevin Wolf
Am 26.02.2021 um 20:17 hat Eric Blake geschrieben: > On 2/24/21 7:52 AM, Kevin Wolf wrote: > > diff --git a/qapi/qom.json b/qapi/qom.json > > index 449dca8ec5..2668ad8369 100644 > > --- a/qapi/qom.json > > +++ b/qapi/qom.json > > @@ -7,6 +7,7 @@ > > { 'include': 'authz.json' } > > { 'include':

Re: [PATCH v2 09/31] qapi/qom: Add ObjectOptions for throttle-group

2021-03-02 Thread Kevin Wolf
Am 26.02.2021 um 18:26 hat Eric Blake geschrieben: > On 2/24/21 7:52 AM, Kevin Wolf wrote: > > This adds a QAPI schema for the properties of the throttle-group object. > > > > The only purpose of the x-* properties is to make the nested options in > > 'limits' available for a command line parser

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

2021-03-02 Thread Kevin Wolf
Am 26.02.2021 um 17:23 hat Eric Blake geschrieben: > On 2/24/21 7:52 AM, Kevin Wolf wrote: > > 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

Re: [PATCH v2 06/31] qapi/qom: Add ObjectOptions for dbus-vmstate

2021-03-02 Thread Kevin Wolf
Am 26.02.2021 um 16:58 hat Eric Blake geschrieben: > On 2/24/21 7:52 AM, Kevin Wolf wrote: > > This adds a QAPI schema for the properties of the dbus-vmstate object. > > > > A list represented as a comma separated string is clearly not very > > QAPI-like, but for now just describe the existing

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

2021-03-02 Thread Kevin Wolf
Am 25.02.2021 um 23:55 hat Eric Blake geschrieben: > On 2/24/21 7:52 AM, Kevin Wolf wrote: > > 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

Re: [PATCH] build-aux: require GNU grep on FreeBSD

2021-03-02 Thread Ján Tomko
On a Tuesday in 2021, Roman Bogorodskiy wrote: FreeBSD 13.x and newer ship BSD grep which apparently has some performance issues causing certain syntax check tests to run longer than the default 30 seconds timeout used by meson. However, GNU grep is still available through the textproc/gnugrep

Re: [PATCH 6/6] commandtest: test27: Remove pointless 'cleanup' label

2021-03-02 Thread Ján Tomko
On a Tuesday in 2021, Peter Krempa wrote: Signed-off-by: Peter Krempa --- tests/commandtest.c | 17 ++--- 1 file changed, 6 insertions(+), 11 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signature

Re: [PATCH 5/6] virCommandSetSendBuffer: Provide saner semantics

2021-03-02 Thread Ján Tomko
On a Tuesday in 2021, Peter Krempa wrote: The function is used to automatically feed a buffer into a pipe which can be used by the command to read contents of the buffer. Rather than passing in a pipe, let's create the pipe inside virCommandSetSendBuffer and directly associate the reader end

Re: [PATCH 4/6] virCommandFDSet: Remove return value

2021-03-02 Thread Ján Tomko
On a Tuesday in 2021, Peter Krempa wrote: The function can't fail nowadays. Remove the return value and adjust the only caller which ensures that @cmd is non-NULL and @fd is positive. Signed-off-by: Peter Krempa --- src/util/vircommand.c | 22 +++--- 1 file changed, 3

Re: [PATCH 3/6] util: vircommand: Add wrappers for virCommand error checking

2021-03-02 Thread Ján Tomko
On a Tuesday in 2021, Peter Krempa wrote: Extract the check and reporting of error from the individual virCommand APIs into a separate helper. This will aid future refactors. Signed-off-by: Peter Krempa --- src/util/vircommand.c | 143 ++ 1 file changed,

Re: [PATCH 2/6] virCommandAddEnvBuffer: Remove unused function

2021-03-02 Thread Ján Tomko
On a Tuesday in 2021, Peter Krempa wrote: Signed-off-by: Peter Krempa --- src/libvirt_private.syms | 1 - src/util/vircommand.c| 26 -- src/util/vircommand.h| 3 --- 3 files changed, 30 deletions(-) Last usage was removed in 2011 by: commit

Re: [PATCH 1/6] virPipeImpl: Don't overwrite error

2021-03-02 Thread Ján Tomko
On a Tuesday in 2021, Peter Krempa wrote: If WITH_PIPE2 is not defined we attempt to set the pipe to nonblocking operation after they are created. We errorneously rewrote the existing error message on failure to do so or even reported an error if quiet mode was requested. Signed-off-by: Peter

Re: [PATCH] feat(usb-hostdev): add ability to filter by USB serial strings too

2021-03-02 Thread Giel van Schijndel
Somehow this got lost when playing with 'git send-mail': Signed-off-by: Giel van Schijndel -- Met vriendelijke groet, With kind regards, Giel van Schijndel

[PATCH] feat(usb-hostdev): add ability to filter by USB serial strings too

2021-03-02 Thread Giel van Schijndel
This patch adds the ability to select a specific USB device when multiple are available with the same vendor and product IDs. As an example, I'm using this to pass through a specific USB mouse to my guest VM. I happen to have two of the exact same model (Logitech MX518), differing only in their

[PATCH 6/6] commandtest: test27: Remove pointless 'cleanup' label

2021-03-02 Thread Peter Krempa
Signed-off-by: Peter Krempa --- tests/commandtest.c | 17 ++--- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/tests/commandtest.c b/tests/commandtest.c index 524c959eba..aaf391935c 100644 --- a/tests/commandtest.c +++ b/tests/commandtest.c @@ -1041,7 +1041,6 @@

[PATCH 4/6] virCommandFDSet: Remove return value

2021-03-02 Thread Peter Krempa
The function can't fail nowadays. Remove the return value and adjust the only caller which ensures that @cmd is non-NULL and @fd is positive. Signed-off-by: Peter Krempa --- src/util/vircommand.c | 22 +++--- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git

[PATCH 5/6] virCommandSetSendBuffer: Provide saner semantics

2021-03-02 Thread Peter Krempa
The function is used to automatically feed a buffer into a pipe which can be used by the command to read contents of the buffer. Rather than passing in a pipe, let's create the pipe inside virCommandSetSendBuffer and directly associate the reader end with the command. This way the ownership of

[PATCH 3/6] util: vircommand: Add wrappers for virCommand error checking

2021-03-02 Thread Peter Krempa
Extract the check and reporting of error from the individual virCommand APIs into a separate helper. This will aid future refactors. Signed-off-by: Peter Krempa --- src/util/vircommand.c | 143 ++ 1 file changed, 76 insertions(+), 67 deletions(-) diff

[PATCH 2/6] virCommandAddEnvBuffer: Remove unused function

2021-03-02 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/libvirt_private.syms | 1 - src/util/vircommand.c| 26 -- src/util/vircommand.h| 3 --- 3 files changed, 30 deletions(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 2a3bbdc577..90c02a250c 100644 ---

[PATCH 1/6] virPipeImpl: Don't overwrite error

2021-03-02 Thread Peter Krempa
If WITH_PIPE2 is not defined we attempt to set the pipe to nonblocking operation after they are created. We errorneously rewrote the existing error message on failure to do so or even reported an error if quiet mode was requested. Signed-off-by: Peter Krempa --- src/util/virutil.c | 2 -- 1

[PATCH 0/6] virCommand cleanups

2021-03-02 Thread Peter Krempa
Some cleanups I've accumulated. Peter Krempa (6): virPipeImpl: Don't overwrite error virCommandAddEnvBuffer: Remove unused function util: vircommand: Add wrappers for virCommand error checking virCommandFDSet: Remove return value virCommandSetSendBuffer: Provide saner semantics

[PATCH 1/6] util: virerror: Don't use stack'd buffers in error report helpers

2021-03-02 Thread Peter Krempa
This was (probably) a relict from times when we cared about OOM conditions and the possibility to report the error. Nowadays it doesn't make sense as virRaiseErrorFull will do an allocated copy of the strings and also concatenate the error message prefix with the detail which doesn't guarantee

[PATCH 6/6] util: virerror: Remove VIR_ERROR_MAX_LENGTH macro

2021-03-02 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/util/virerror.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/util/virerror.h b/src/util/virerror.h index da7d7c0afe..bec3863c3f 100644 --- a/src/util/virerror.h +++ b/src/util/virerror.h @@ -23,8 +23,6 @@ #include "internal.h" -#define

[PATCH 4/6] qemuProcessReportLogError: Remove unnecessary math for max error message

2021-03-02 Thread Peter Krempa
Now that error message formatting doesn't use fixed size buffers we can drop the math for calculating the maximum chunk of log to report in the error message and use a round number. This also makes it obvious that the chosen number is arbitrary. Signed-off-by: Peter Krempa ---

[PATCH 2/6] util: virerror: Avoid a copy of the error messages

2021-03-02 Thread Peter Krempa
Some error message reporting functions already have allocated buffers which were used to format the error message, so copying the strings is redundant. Extract the internals from 'virRaiseErrorFull' to 'virRaiseErrorInternal' which takes allocated strings as arguments and steals them, so that

[PATCH 5/6] qemuProcessReportLogError: Don't mark "%s: %s" as translatable

2021-03-02 Thread Peter Krempa
The function is constructing an error message from a prefix and the contents of the qemu log file. Marking just two string modifiers as translatable is pointless and will certainly confuse translators. Remove the marking and add a comment which bypasses the sc_libvirt_unmarked_diagnostics check.

[PATCH 0/6] util: virerror: Avoid stack'd buffers for error message formatting

2021-03-02 Thread Peter Krempa
We don't need OOM resiliency nowadays. Peter Krempa (6): util: virerror: Don't use stack'd buffers in error report helpers util: virerror: Avoid a copy of the error messages util: virprocess: Use local maximum error message size qemuProcessReportLogError: Remove unnecessary math for max

[PATCH 3/6] util: virprocess: Use local maximum error message size

2021-03-02 Thread Peter Krempa
Use of VIR_ERROR_MAX_LENGTH is actually misleading to the readers because it implies that the strings in virError are 1024 bytes at most. That isn't true at least for the 'message' field as it's constructed from concatenating the detail string which (was) max 1024 bytes with the string variant of

[PATCH] build-aux: require GNU grep on FreeBSD

2021-03-02 Thread Roman Bogorodskiy
FreeBSD 13.x and newer ship BSD grep which apparently has some performance issues causing certain syntax check tests to run longer than the default 30 seconds timeout used by meson. However, GNU grep is still available through the textproc/gnugrep port, so require it on FreeBSD if /usr/bin/grep

[PATCH 16/16] util: virstring: Remove virStrncpy

2021-03-02 Thread Peter Krempa
The function is now unused and motivated users to write crazy parsers which were hard to understand, had pointless error paths just to avoid few memory allocations. Remove the function as we're fine with g_strndup and virStrcpy. Signed-off-by: Peter Krempa --- docs/coding-style.rst| 13

[PATCH 13/16] xenParseXLUSB: Rewrite to avoid virStrncpy

2021-03-02 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/libxl/xen_xl.c | 24 ++-- 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/src/libxl/xen_xl.c b/src/libxl/xen_xl.c index 1bce31a549..29c145851e 100644 --- a/src/libxl/xen_xl.c +++ b/src/libxl/xen_xl.c @@ -960,14 +960,10 @@

[PATCH 15/16] virNetLibsshAuthenticatePrivkeyCb: Use virStrcpy instead of virStrncpy

2021-03-02 Thread Peter Krempa
We already assume that 'retr_passphrase.result' is a string, thus we can use virStrcpy instead. Signed-off-by: Peter Krempa --- src/rpc/virnetlibsshsession.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/rpc/virnetlibsshsession.c b/src/rpc/virnetlibsshsession.c index

[PATCH 14/16] virNetLibsshAuthenticatePrivkeyCb: Use g_autofree for 'actual_prompt'

2021-03-02 Thread Peter Krempa
So that the 'error' label can be removed. Signed-off-by: Peter Krempa --- src/rpc/virnetlibsshsession.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/rpc/virnetlibsshsession.c b/src/rpc/virnetlibsshsession.c index 8814487557..0fc1f66706 100644 ---

[PATCH 12/16] xenParseXLUSBController: Avoid use of virStrndup

2021-03-02 Thread Peter Krempa
Use g_strndup with a freed buffer instead of the more complex approach using virStrndup. Signed-off-by: Peter Krempa --- src/libxl/xen_xl.c | 51 ++ 1 file changed, 11 insertions(+), 40 deletions(-) diff --git a/src/libxl/xen_xl.c

[PATCH 11/16] xenParseXLChannel: Use g_strndup instead of virStrndup

2021-03-02 Thread Peter Krempa
Make the temporary string a autofree-ing pointer and copy the contents. Signed-off-by: Peter Krempa --- src/libxl/xen_xl.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/libxl/xen_xl.c b/src/libxl/xen_xl.c index 4113be8cd1..9b2a2fe292 100644 ---

[PATCH 09/16] xenParseSxprSound: Refactor parsing of model list

2021-03-02 Thread Peter Krempa
Copy the input string so that we don't have to use a static buffer and virStrncpy. Signed-off-by: Peter Krempa --- src/libxl/xen_common.c | 46 +- 1 file changed, 19 insertions(+), 27 deletions(-) diff --git a/src/libxl/xen_common.c

[PATCH 10/16] openvzReadNetworkConf: Rework parser

2021-03-02 Thread Peter Krempa
Rewrite so that the parser doesn't use virStrncpy by employing g_strsplit. Signed-off-by: Peter Krempa --- src/openvz/openvz_conf.c | 77 ++-- 1 file changed, 26 insertions(+), 51 deletions(-) diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c

[PATCH 08/16] xenParseVif: Refactor parser

2021-03-02 Thread Peter Krempa
Use g_strsplit to split the string and avoid use of stack'd strings. Signed-off-by: Peter Krempa --- src/libxl/xen_common.c | 136 ++--- 1 file changed, 46 insertions(+), 90 deletions(-) diff --git a/src/libxl/xen_common.c b/src/libxl/xen_common.c index

[PATCH 05/16] virFileLoopDeviceAssociate: Use virStrcpy instead of virStrncpy

2021-03-02 Thread Peter Krempa
Passing 'strlen(src)' for length makes it equivalent to virStrcpy. Signed-off-by: Peter Krempa --- src/util/virfile.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/util/virfile.c b/src/util/virfile.c index 841a0f4e00..29445fc0ff 100644 --- a/src/util/virfile.c +++

[PATCH 07/16] test_driver: Rewrite testBuildFilename

2021-03-02 Thread Peter Krempa
Use glib functions to do the relative name lookup instead of manual assembly. Signed-off-by: Peter Krempa --- src/test/test_driver.c | 35 ++- 1 file changed, 6 insertions(+), 29 deletions(-) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index

[PATCH 06/16] xenParseXMDisk: Replace g_new + virStrncpy by g_strndup

2021-03-02 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/libxl/xen_xm.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/libxl/xen_xm.c b/src/libxl/xen_xm.c index 3e81c9ef0d..cc24317a76 100644 --- a/src/libxl/xen_xm.c +++ b/src/libxl/xen_xm.c @@ -146,14 +146,7 @@ xenParseXMDisk(char

[PATCH 04/16] virDevMapperGetTargetsImpl: Use virStrcpy instead of virStrncpy

2021-03-02 Thread Peter Krempa
virStrncpy was called with -1 for lenght of the copied source which is equivalent to virStrcpy. Signed-off-by: Peter Krempa --- src/util/virdevmapper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/virdevmapper.c b/src/util/virdevmapper.c index

[PATCH 03/16] sanlock: Use virStrcpy instead of virStrncpy

2021-03-02 Thread Peter Krempa
We want a (possibly truncated) copy of the full source string so virStrcpy is a better fit. Signed-off-by: Peter Krempa --- src/locking/lock_driver_sanlock.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/locking/lock_driver_sanlock.c

[PATCH 02/16] virProcessRunInForkHelper: Use virStrcpyStatic for static buffers

2021-03-02 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/util/virprocess.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/util/virprocess.c b/src/util/virprocess.c index 69d64e9466..7a0960e337 100644 --- a/src/util/virprocess.c +++ b/src/util/virprocess.c @@ -1168,14 +1168,14 @@

[PATCH 01/16] util: virstring: Always copy string in virStrcpy

2021-03-02 Thread Peter Krempa
15 out of 72 invocations of virStrcpy(Static) ignore the return value as it's either impossible to fail or in certain cases a truncated copy is still good enough. Unfortunately virStrcpy doesn't copy anything in such case as the checks are done first. Fix this by using g_strlcpy for the

[PATCH 00/16] Improve virStrcpy and remove virStrncpy

2021-03-02 Thread Peter Krempa
Peter Krempa (16): util: virstring: Always copy string in virStrcpy virProcessRunInForkHelper: Use virStrcpyStatic for static buffers sanlock: Use virStrcpy instead of virStrncpy virDevMapperGetTargetsImpl: Use virStrcpy instead of virStrncpy virFileLoopDeviceAssociate: Use virStrcpy

Re: [libvirt PATCH] cpu_map: Install x86_EPYC-Milan.xml

2021-03-02 Thread Pavel Hrdina
On Tue, Mar 02, 2021 at 10:39:16AM +0100, Jiri Denemark wrote: > Signed-off-by: Jiri Denemark > --- > src/cpu_map/meson.build | 1 + > 1 file changed, 1 insertion(+) Reviewed-by: Pavel Hrdina signature.asc Description: PGP signature

Re: using libvirt 4.5 with upstream qemu

2021-03-02 Thread Daniel Henrique Barboza
On 3/2/21 7:40 AM, Thanos Makatos wrote: -Original Message- From: Daniel Henrique Barboza Sent: 01 March 2021 18:07 To: Peter Krempa ; Thanos Makatos Cc: libvir-list@redhat.com Subject: Re: using libvirt 4.5 with upstream qemu On 3/1/21 12:47 PM, Peter Krempa wrote: On Mon,

RE: using libvirt 4.5 with upstream qemu

2021-03-02 Thread Thanos Makatos
> -Original Message- > From: Daniel Henrique Barboza > Sent: 01 March 2021 18:07 > To: Peter Krempa ; Thanos Makatos > > Cc: libvir-list@redhat.com > Subject: Re: using libvirt 4.5 with upstream qemu > > > > On 3/1/21 12:47 PM, Peter Krempa wrote: > > On Mon, Mar 01, 2021 at

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

2021-03-02 Thread Daniel P . Berrangé
On Tue, Mar 02, 2021 at 08:51:29AM +0100, Peter Krempa wrote: > On Mon, Mar 01, 2021 at 16:00:47 -0700, Jim Fehlig wrote: > > There are a few uses of g_autoslist in the qemu driver and likely > > more will come throughout the codebase in the future. g_autoslist > > first appeared in glib 2.56, so

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

2021-03-02 Thread Daniel P . Berrangé
On Tue, Mar 02, 2021 at 09:05:11AM +0100, Pavel Hrdina wrote: > On Tue, Mar 02, 2021 at 08:51:29AM +0100, Peter Krempa wrote: > > On Mon, Mar 01, 2021 at 16:00:47 -0700, Jim Fehlig wrote: > > > There are a few uses of g_autoslist in the qemu driver and likely > > > more will come throughout the

[libvirt PATCH] cpu_map: Install x86_EPYC-Milan.xml

2021-03-02 Thread Jiri Denemark
Signed-off-by: Jiri Denemark --- src/cpu_map/meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cpu_map/meson.build b/src/cpu_map/meson.build index 48f69f623c..013fc62a02 100644 --- a/src/cpu_map/meson.build +++ b/src/cpu_map/meson.build @@ -34,6 +34,7 @@ cpumap_data = [

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

2021-03-02 Thread Ján Tomko
On a Monday in 2021, Jiri Denemark wrote: Introduced in QEMU 6.0.0 by 623972ceae091b31331ae4a1dc94fe5cbb891937 Signed-off-by: Jiri Denemark --- src/cpu_map/index.xml | 1 + src/cpu_map/x86_EPYC-Milan.xml | 92 ++ 2 files changed, 93 insertions(+) create

[PATCH 2/2] lib: Fix calling of virNetworkUpdate() driver callback

2021-03-02 Thread Michal Privoznik
Let me take you ~8 years back. Back then, virNetworkUpdate() API was introduced and the public implementation is nothing special - it calls the networkUpdate() callback of the network driver. Except, a small "typo" slipped through - while the public API takes @command argument first followed by

[PATCH 0/2] Fix calling of virNetworkUpdate() driver callback

2021-03-02 Thread Michal Privoznik
See 2/2 for explanation. BUT, I am not fully convinced about changing XDR though. In my testing it did not really show to be that backward compatible. I did the following tests: 1) run libvirtd unpatched, 2) run libvirtd with just arguments if the callback fixed (i.e. just the first hunk of

[PATCH 1/2] lib: Debug print all arguments of virNetworkUpdate()

2021-03-02 Thread Michal Privoznik
Somehow, command argument was not printed into debug logs. It is imperative that all arguments are logged. Signed-off-by: Michal Privoznik --- src/libvirt-network.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libvirt-network.c b/src/libvirt-network.c index

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

2021-03-02 Thread Andrea Bolognani
On Tue, 2021-03-02 at 09:05 +0100, Pavel Hrdina wrote: > On Tue, Mar 02, 2021 at 08:51:29AM +0100, Peter Krempa wrote: > > Thus we are 2 months out of dropping support for RHEL-7. On the other > > hand starting from RHEL-7.6/CentOS7.6 glib was updated to 2.56, so on a > > updated rhel-7/centos-7

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

2021-03-02 Thread Pavel Hrdina
On Mon, Mar 01, 2021 at 03:49:56PM -0700, Jim Fehlig wrote: > Commit 887dd0d331 caused a small regression in NodeDeviceDetach in the libxl > driver when the 'driver' parameter is not specified. E.g. > > error: Failed to detach device pci__0a_10_0 > error: An error occurred, but the cause is

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

2021-03-02 Thread Pavel Hrdina
On Tue, Mar 02, 2021 at 08:51:29AM +0100, Peter Krempa wrote: > On Mon, Mar 01, 2021 at 16:00:47 -0700, Jim Fehlig wrote: > > There are a few uses of g_autoslist in the qemu driver and likely > > more will come throughout the codebase in the future. g_autoslist > > first appeared in glib 2.56, so

  1   2   >