Re: [PATCH 2/4] hw/block/fdc: Remove the check_media_rate property

2021-02-04 Thread Thomas Huth
On 05/02/2021 01.40, John Snow wrote: On 2/3/21 12:18 PM, Thomas Huth wrote: This was only required for the pc-1.0 and earlier machine types. Now that these have been removed, we can also drop the corresponding code from the FDC device. Signed-off-by: Thomas Huth ---   hw/block/fdc.c  

[PATCH] docs: Remove broken link to Xen channel doc

2021-02-04 Thread Jim Fehlig
Many of Xen's text documents have been converted to man pages over the years, the channel doc being one of them. Replace the broken channel.txt link with the name of the man page providing the same information. Signed-off-by: Jim Fehlig --- docs/formatdomain.rst | 9 - 1 file changed, 4

[PATCH] util: Remove '\n' from vhostuser ifname

2021-02-04 Thread Yalei Li
When deleting the vhostuserclient interface, OVS prompts that the interface does not exist, Through the XML file, I found that the "target dev" has a '\n', results in an XML parsing error. XML file: That is because 'ovs-vsctl' returns a newline result, always come with a '\n', and the

Re: [PATCH 2/4] hw/block/fdc: Remove the check_media_rate property

2021-02-04 Thread John Snow
On 2/3/21 12:18 PM, Thomas Huth wrote: This was only required for the pc-1.0 and earlier machine types. Now that these have been removed, we can also drop the corresponding code from the FDC device. Signed-off-by: Thomas Huth --- hw/block/fdc.c | 17 ++---

Re: [libvirt PATCH 00/15] eliminate VIR_FREE in all *Dispose() functions

2021-02-04 Thread Daniel Henrique Barboza
On 2/4/21 1:38 AM, Laine Stump wrote: A *Dispose() function is similar to a *Free() function, except that 1) the object is always sent as a void* so it has to be typecast into some other object-specific pointer at the top of the function, and 2) it frees all the resources inside the object,

Re: [libvirt PATCH 10/15] rpc: replace VIR_FREE with g_free in all *Dispose() functions

2021-02-04 Thread Daniel Henrique Barboza
This patch does not apply cleanly. The reason: On 2/4/21 1:38 AM, Laine Stump wrote: Signed-off-by: Laine Stump --- src/rpc/virnetclient.c| 4 ++-- src/rpc/virnetdaemon.c| 6 +++--- src/rpc/virnetlibsshsession.c | 18 +- src/rpc/virnetsaslcontext.c |

Re: [PATCH 3/3] utils: Deprecate inexact fractional suffix sizes

2021-02-04 Thread Eric Blake
On 2/4/21 1:07 PM, Eric Blake wrote: > The value '1.1k' is inexact; 1126.4 bytes is not possible, so we > happen to truncate it to 1126. Our use of fractional sizes is > intended for convenience, but when a user specifies a fraction that is > not a clean translation to binary, truncating/rounding

Re: [libvirt PATCH v2 00/24] eliminate VIR_FREE in all *Free() functions

2021-02-04 Thread Daniel Henrique Barboza
On 2/4/21 12:57 AM, Laine Stump wrote: When I sent a patch to convert (what I thought was) all of the VIR_FREEs in any *Free() function in the conf directory to g_free (with the justification that it was trivial to verify that the pointers weren't being referenced after they had been freed),

Re: [libvirt PATCH v2 22/24] qemu: pass pointers instead of copying objects for qemuFirmware*FreeContent()

2021-02-04 Thread Daniel Henrique Barboza
On 2/4/21 12:57 AM, Laine Stump wrote: These functions all cooperate to free memory pointed to by a single object that contains (doesn't *point to*, but acutally contains) s/acutally/actually several sub-objects. They were written to send copies of these sub-objects to subordinate

[PATCH 2/3] utils: Deprecate hex-with-suffix sizes

2021-02-04 Thread Eric Blake
Supporting '0x20M' looks odd, particularly since we have an 'E' suffix that is ambiguous between a hex digit and the extremely large exibyte suffix, as well as a 'B' suffix for bytes. In practice, people using hex inputs are specifying values in bytes (and would have written 0x200, or

Re: [PATCH 4/4] hw/usb/bus: Remove the "full-path" property

2021-02-04 Thread Thomas Huth
On 04/02/2021 09.36, Gerd Hoffmann wrote: Hi, enum USBDeviceFlags { -USB_DEV_FLAG_FULL_PATH, +USB_DEV_FLAG_FULL_PATH, /* unused since QEMU v6.0 */ Why not just drop it? Any remaining users? I didn't want to change the values of the other members of the enum ...

[PATCH] bhyve: relax emulator binary value check

2021-02-04 Thread Roman Bogorodskiy
Currently, requesting domain capabilities fails when the specified emulator binary does not equal to "/usr/sbin/bhyve". Relax this check to allow any path with basename "bhyve", as it's a common case when binary is specified without an absolute path. Signed-off-by: Roman Bogorodskiy --- I'm not

[PATCH 02/12] vsh: Don't put VSH_OT_ALIAS onto list of completions

2021-02-04 Thread Michal Privoznik
We've invented VSH_OT_ALIAS type for --option so that we can rewrite some --options (e.g. fix spelling). For instance blkdeviotune command uses this feature heavily: --options-with-dash are preferred over old --options_with_underscore. Both versions are supported but only the new ones (not

[PATCH 12/12] vsh: Drop unused @text arg from readline generators

2021-02-04 Thread Michal Privoznik
After previous patches neither vshReadlineCommandGenerator() nor vshReadlineOptionsGenerator() use prefix that user wants to complete. The argument is marked as unused in both functions. Drop it then. Signed-off-by: Michal Privoznik --- tools/vsh.c | 10 -- 1 file changed, 4

[PATCH 07/12] vsh: Rewrite opt->type check in vshReadlineParse()

2021-02-04 Thread Michal Privoznik
The vshReadlineParse() function is called whenever user hits . If there is no command (or a partially written one), then a list of possible commands is printed to the user. But, if there is a command then its --options are generated. But obviously, we can not generate --options if there already is

[PATCH 11/12] vsh: Rework vshReadlineCommandGenerator()

2021-02-04 Thread Michal Privoznik
Firstly, move variable declarations into the inner most block they are used. Secondly, use for() loop instead of while so that we don't have to advance loop counter explicitly on 'continue'. Signed-off-by: Michal Privoznik --- tools/vsh.c | 37 +++-- 1 file

[PATCH 09/12] vsh: Deduplicate filtering in vshReadlineCommandGenerator()

2021-02-04 Thread Michal Privoznik
This is what we do for completer callbacks: we let them generate all possible outputs ignoring any partial input (e.g. prefix of a domain name) and then use vshCompleterFilter() to filter out those strings which don't fit the partial input (prefix). The same algorithm is implemented in

[PATCH 04/12] vsh: Accept NULL @list in vshCompleterFilter()

2021-02-04 Thread Michal Privoznik
The aim of vshCompleterFilter() is to take a string list and a prefix and remove all strings from the list that don't have the desired prefix. The function is used to filter out those strings returned by a completer callback that don't correspond with user's (partial) input. For instance, domain

[PATCH 01/12] lib: Substitute some STREQLEN with STRPREFIX

2021-02-04 Thread Michal Privoznik
There are few cases where STREQLEN() is called like this: STREQLEN(var, string, strlen(string)) which is the same as STRPREFIX(var, string). Use STRPREFIX() because it is more obvious what the check is doing. Signed-off-by: Michal Privoznik --- src/libxl/xen_xl.c | 2 +-

[PATCH 10/12] vsh: Simplify condition for calling completer callback

2021-02-04 Thread Michal Privoznik
The way we currently call completer callbacks is that if we've found --option that user wants to complete value for and it has callback set then the callback is called. And just before that, if no --option to have the value completed is found or is found and is of boolean type then a list of

[PATCH 05/12] vsh: Prefer g_strdup_printf() over g_snprintf() in vshReadlineOptionsGenerator()

2021-02-04 Thread Michal Privoznik
The vshReadlineOptionsGenerator() function returns a string list of all --options for given command. But the way that individual items on the list are allocated can be written better. Signed-off-by: Michal Privoznik --- tools/vsh.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff

[PATCH 08/12] vsh: Deduplicate filtering in vshReadlineOptionsGenerator()

2021-02-04 Thread Michal Privoznik
This is what we do for completer callbacks: we let them generate all possible outputs ignoring any partial input (e.g. prefix of a domain name) and then use vshCompleterFilter() to filter out those strings which don't fit the partial input (prefix). The same algorithm is implemented in

[PATCH 06/12] vsh: Use g_auto() for string lists returned in readline command/options generators

2021-02-04 Thread Michal Privoznik
There are two functions that are used to generate completion lists: vshReadlineCommandGenerator() for command names and vshReadlineOptionsGenerator() for --options for given command. Both return a string list, but may also fail while constructing it. For that case, they call g_strfreev()

[PATCH 03/12] vsh: Use g_auto(GStrv) to free string list returned by completer callback

2021-02-04 Thread Michal Privoznik
This saves us explicit call of g_strfreev() in error path. Signed-off-by: Michal Privoznik --- tools/vsh.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/vsh.c b/tools/vsh.c index cc777bee12..3cb657f582 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -2778,9

[PATCH 00/12] vsh: Improve completer code

2021-02-04 Thread Michal Privoznik
There is no functional change to completion. No user visible change, nor to a developer who writes a completer callback. Some code deduplication and code cleanup and adapting code to 2021. Michal Prívozník (12): lib: Substitute some STREQLEN with STRPREFIX vsh: Don't put VSH_OT_ALIAS onto

Re: [libvirt PATCH] qemu_monitor_json: fix JSON generator for VC chardev

2021-02-04 Thread Michal Privoznik
On 2/4/21 1:06 PM, Pavel Hrdina wrote: On Thu, Feb 04, 2021 at 01:00:51PM +0100, Michal Privoznik wrote: On 2/3/21 7:01 PM, Pavel Hrdina wrote: The correct backend type is 'vc', same as in qemuBuildChrChardevStr() where we generate qemu command line. Signed-off-by: Pavel Hrdina ---

Re: [libvirt PATCH] qemu_monitor_json: fix JSON generator for VC chardev

2021-02-04 Thread Pavel Hrdina
On Thu, Feb 04, 2021 at 01:00:51PM +0100, Michal Privoznik wrote: > On 2/3/21 7:01 PM, Pavel Hrdina wrote: > > The correct backend type is 'vc', same as in qemuBuildChrChardevStr() > > where we generate qemu command line. > > > > Signed-off-by: Pavel Hrdina > > --- > >

Re: [libvirt PATCH] qemu_driver: increase recorded counter for disk block stats

2021-02-04 Thread Michal Privoznik
On 2/3/21 7:10 PM, Pavel Hrdina wrote: Commit <318d807a0bd3372b634d1952b559c5c627ccfa5b> added a fix to skip most of the block stat code to not log error message for missing storage sources but forgot to increase the recordnr counter. Signed-off-by: Pavel Hrdina --- src/qemu/qemu_driver.c |

Re: [libvirt PATCH] qemu_monitor_json: fix JSON generator for VC chardev

2021-02-04 Thread Michal Privoznik
On 2/3/21 7:01 PM, Pavel Hrdina wrote: The correct backend type is 'vc', same as in qemuBuildChrChardevStr() where we generate qemu command line. Signed-off-by: Pavel Hrdina --- src/qemu/qemu_monitor_json.c | 5 - tests/qemumonitorjsontest.c | 2 +- 2 files changed, 5 insertions(+), 2

Re: [libvirt PATCH 0/2] tests: Improve macOS stat() mocking logic

2021-02-04 Thread Michal Privoznik
On 2/4/21 10:53 AM, Andrea Bolognani wrote: See 2/2 for more information. Andrea Bolognani (2): tests: Split macOS stat() mocking logic tests: Improve macOS stat() mocking logic tests/virmockstathelpers.c | 75 ++ 1 file changed, 43 insertions(+),

[libvirt PATCH] Revert "tests: Avoid gnulib replacements in mocks"

2021-02-04 Thread Andrea Bolognani
Now that we're no longer using gnulib, we can treat macOS the same as all other targets. This reverts commit 0ae6f5cea54d95c0d1dedf04a0a2accfe2529fb2 Signed-off-by: Andrea Bolognani --- Roman, this seems to work fine both locally and on Cirrus CI[1], but I'd like to have your thumbs up before

[libvirt PATCH 2/2] tests: Improve macOS stat() mocking logic

2021-02-04 Thread Andrea Bolognani
We should not mock stat64() when building on Apple Silicon, because the declaration is not present in the header file. Detect this situation and handle it gracefully. https://gitlab.com/libvirt/libvirt/-/issues/121 Signed-off-by: Andrea Bolognani --- tests/virmockstathelpers.c | 12 +---

[libvirt PATCH 1/2] tests: Split macOS stat() mocking logic

2021-02-04 Thread Andrea Bolognani
On macOS, most of the symbols and declarations that we look at to determine which versions of stat() we need to mock are not present; on the other hand, there are some specific wrinkles that are introduced with Apple Silicon which we will need to take care of. To avoid making the logic even more

[libvirt PATCH 0/2] tests: Improve macOS stat() mocking logic

2021-02-04 Thread Andrea Bolognani
See 2/2 for more information. Andrea Bolognani (2): tests: Split macOS stat() mocking logic tests: Improve macOS stat() mocking logic tests/virmockstathelpers.c | 75 ++ 1 file changed, 43 insertions(+), 32 deletions(-) -- 2.26.2

Re: [PATCH 00/10] Introduce virtio-mem model

2021-02-04 Thread Michal Privoznik
On 2/4/21 3:33 AM, Jing Qi wrote: Michal, I checked the virtio_mem module and it's loaded - lsmod |grep virtio_mem virtio_mem 32768 0 And I can't make the actual value change to non-zerio. -> virsh update-memory pc --requested-size 256M or ->virsh setmem pc 1000M This is

[PATCH] qemuBlockDiskDetectNodes: just return when alias is null

2021-02-04 Thread Yi Li
Just Return when alias is null and Remove the 'ret' variable. Signed-off-by: Yi Li --- src/qemu/qemu_block.c | 21 - 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 0b8ca2a3f5..32b6500a3d 100644 ---

Re: [PATCH 4/4] hw/usb/bus: Remove the "full-path" property

2021-02-04 Thread Gerd Hoffmann
Hi, > enum USBDeviceFlags { > -USB_DEV_FLAG_FULL_PATH, > +USB_DEV_FLAG_FULL_PATH, /* unused since QEMU v6.0 */ Why not just drop it? Any remaining users? take care, Gerd

[PATCH 3/3] storage: Add tests for the Linstor storage backend

2021-02-04 Thread Rene Peinthor
Signed-off-by: Rene Peinthor --- tests/linstorjsondata/broken.json | 1 + tests/linstorjsondata/resource-group.json | 1 + .../linstorjsondata/resource-list-test2.json | 332 .../storage-pools-ssdpool.json| 72

[PATCH 1/3] storage: Linstor configuration

2021-02-04 Thread Rene Peinthor
This adds Linstor storage defines and documentation for the new storage backend for Linstor. Signed-off-by: Rene Peinthor --- docs/schemas/storagepool.rng | 27 +++ include/libvirt/libvirt-storage.h | 1 + src/conf/domain_conf.c

[PATCH 2/3] storage: Linstor support

2021-02-04 Thread Rene Peinthor
Implement a LINSTOR backend storage driver. The Linstor client needs to be installed and it needs to be configured on the nodes used by the controller. It supports most pool/vol commands, except for pool-build/pool-delete and provides a block device in RAW file mode. Linstor supports more than

[PATCH 0/3 V3] Linstor storage backend

2021-02-04 Thread Rene Peinthor
I didn't get any feedback on V2, nor any updates if you still reviewing, but I found myself a few issues. First in V2 the element wasn't optional (which it should be) and I improved a few error messages, because sometimes it wasn't clear from where the error originated. Best regards, Rene Rene