Re: [PATCH v6 2/6] qmp: add QMP command x-debug-virtio-status

2021-09-03 Thread Michael S. Tsirkin
On Mon, Jul 12, 2021 at 06:35:33AM -0400, Jonah Palmer wrote: > From: Laurent Vivier > > This new command shows the status of a VirtIODevice > (features, endianness and number of virtqueues) > > Next patch will improve output by decoding feature bits. > > Signed-off-by: Laurent Vivier > Signed

[PATCH v6 01/11] block/io: bring request check to bdrv_co_(read, write)v_vmstate

2021-09-03 Thread Vladimir Sementsov-Ogievskiy via
Only qcow2 driver supports vmstate. In qcow2 these requests go through .bdrv_co_p{read,write}v_part handlers. So, let's do our basic check for the request on vmstate generic handlers. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- block/io.c | 18 -- 1

[PATCH v6 00/11] 64bit block-layer: part II

2021-09-03 Thread Vladimir Sementsov-Ogievskiy
Hi all! Sorry for a long delay :( Finally, here is v6. v6: rebase on new rbd handlers and backup-top renamed to copy-before-write. Also: 01: add Eric's r-b tweak commit msg to not mention sheepdog 02: add Eric's r-b 03: tweak commit msg drop extra type conversion in raw_co_pwrite_zeroes

[PATCH v6 03/11] block: use int64_t instead of uint64_t in driver read handlers

2021-09-03 Thread Vladimir Sementsov-Ogievskiy
We are generally moving to int64_t for both offset and bytes parameters on all io paths. Main motivation is realization of 64-bit write_zeroes operation for fast zeroing large disk chunks, up to the whole disk. We chose signed type, to be consistent with off_t (which is signed) and with possibili

[PATCH v6 02/11] qcow2: check request on vmstate save/load path

2021-09-03 Thread Vladimir Sementsov-Ogievskiy
We modify the request by adding an offset to vmstate. Let's check the modified request. It will help us to safely move .bdrv_co_preadv_part and .bdrv_co_pwritev_part to int64_t type of offset and bytes. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- include/block/block_

[PATCH v6 08/11] block/io: allow 64bit write-zeroes requests

2021-09-03 Thread Vladimir Sementsov-Ogievskiy
Now that all drivers are updated by previous commit, we can drop two last limiters on write-zeroes path: INT_MAX in bdrv_co_do_pwrite_zeroes() and bdrv_check_request32() in bdrv_co_pwritev_part(). Now everything is prepared for implementing incredibly cool and fast big-write-zeroes in NBD and qcow

[PATCH v6 04/11] block: use int64_t instead of uint64_t in driver write handlers

2021-09-03 Thread Vladimir Sementsov-Ogievskiy
We are generally moving to int64_t for both offset and bytes parameters on all io paths. Main motivation is realization of 64-bit write_zeroes operation for fast zeroing large disk chunks, up to the whole disk. We chose signed type, to be consistent with off_t (which is signed) and with possibili

[PATCH v6 05/11] block: use int64_t instead of uint64_t in copy_range driver handlers

2021-09-03 Thread Vladimir Sementsov-Ogievskiy
We are generally moving to int64_t for both offset and bytes parameters on all io paths. Main motivation is realization of 64-bit write_zeroes operation for fast zeroing large disk chunks, up to the whole disk. We chose signed type, to be consistent with off_t (which is signed) and with possibili

[PATCH v6 06/11] block: make BlockLimits::max_pwrite_zeroes 64bit

2021-09-03 Thread Vladimir Sementsov-Ogievskiy
We are going to support 64 bit write-zeroes requests. Now update the limit variable. It's absolutely safe. The variable is set in some drivers, and used in bdrv_co_do_pwrite_zeroes(). Update also max_write_zeroes variable in bdrv_co_do_pwrite_zeroes(), so that bdrv_co_do_pwrite_zeroes() is now pre

[PATCH v6 07/11] block: use int64_t instead of int in driver write_zeroes handlers

2021-09-03 Thread Vladimir Sementsov-Ogievskiy
We are generally moving to int64_t for both offset and bytes parameters on all io paths. Main motivation is realization of 64-bit write_zeroes operation for fast zeroing large disk chunks, up to the whole disk. We chose signed type, to be consistent with off_t (which is signed) and with possibili

[PATCH v6 11/11] block/io: allow 64bit discard requests

2021-09-03 Thread Vladimir Sementsov-Ogievskiy
Now that all drivers are updated by the previous commit, we can drop the last limiter on pdiscard path: INT_MAX in bdrv_co_pdiscard(). Now everything is prepared for implementing incredibly cool and fast big-discard requests in NBD and qcow2. And any other driver which wants it of course. Signed-

[PATCH v6 09/11] block: make BlockLimits::max_pdiscard 64bit

2021-09-03 Thread Vladimir Sementsov-Ogievskiy
We are going to support 64 bit discard requests. Now update the limit variable. It's absolutely safe. The variable is set in some drivers, and used in bdrv_co_pdiscard(). Update also max_pdiscard variable in bdrv_co_pdiscard(), so that bdrv_co_pdiscard() is now prepared for 64bit requests. The rem

[PATCH v6 10/11] block: use int64_t instead of int in driver discard handlers

2021-09-03 Thread Vladimir Sementsov-Ogievskiy
We are generally moving to int64_t for both offset and bytes parameters on all io paths. Main motivation is realization of 64-bit write_zeroes operation for fast zeroing large disk chunks, up to the whole disk. We chose signed type, to be consistent with off_t (which is signed) and with possibili

[PATCH 00/28] glib: Replace g_memdup() by g_memdup2_qemu()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[PATCH 01/28] hw/hyperv/vmbus: Remove unused vmbus_load/save_req()

2021-09-03 Thread Philippe Mathieu-Daudé
vmbus_save_req() and vmbus_load_req() are not used. Remove them to avoid maintaining dead code. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/hyperv/vmbus.h | 3 -- hw/hyperv/vmbus.c | 59 --- 2 files changed, 62 deletions(-) diff --git a/incl

[PATCH 02/28] glib-compat: Introduce g_memdup2() wrapper

2021-09-03 Thread Philippe Mathieu-Daudé
When experimenting raising GLIB_VERSION_MIN_REQUIRED to 2.68 (Fedora 34 provides GLib 2.68.1) we get: hw/virtio/virtio-crypto.c:245:24: error: 'g_memdup' is deprecated: Use 'g_memdup2' instead [-Werror,-Wdeprecated-declarations] ... g_memdup() has been updated by g_memdup2() to fix eventual

[PATCH 03/28] qapi: Replace g_memdup() by g_memdup2_qemu()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[PATCH 04/28] accel/tcg: Replace g_memdup() by g_memdup2_qemu()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[PATCH 05/28] block/qcow2-bitmap: Replace g_memdup() by g_memdup2_qemu()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[PATCH 09/28] hw/acpi: Replace g_memdup() by g_memdup2_qemu()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[PATCH 10/28] hw/core/machine: Replace g_memdup() by g_memdup2_qemu()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[PATCH 08/28] hw/acpi: Avoid truncating acpi_data_len() to 32-bit

2021-09-03 Thread Philippe Mathieu-Daudé
acpi_data_len() returns an unsigned type, which might be bigger than 32-bit (although it is unlikely such value is returned). Hold the returned value in an 'unsigned' type to avoid unlikely size truncation. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/virt-acpi-build.c | 2 +- hw/i386/acpi-b

[PATCH 11/28] hw/hppa/machine: Replace g_memdup() by g_memdup2_qemu()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[PATCH 12/28] hw/i386/multiboot: Replace g_memdup() by g_memdup2_qemu()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[PATCH 14/28] hw/nvram/fw_cfg: Replace g_memdup() by g_memdup2_qemu()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[PATCH 06/28] softmmu: Replace g_memdup() by g_memdup2_qemu()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[PATCH 07/28] hw/9pfs: Replace g_memdup() by g_memdup2_qemu()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[PATCH 18/28] hw/vfio/pci: Replace g_memdup() by g_memdup2_qemu()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[RFC PATCH 19/28] hw/virtio: Replace g_memdup() by g_memdup2_qemu()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[PATCH 20/28] net/colo: Replace g_memdup() by g_memdup2_qemu()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[PATCH 17/28] hw/rdma: Replace g_memdup() by g_memdup2_qemu()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[RFC PATCH 21/28] ui/clipboard: Replace g_memdup() by g_memdup2_qemu()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[PATCH 16/28] hw/ppc/spapr_pci: Replace g_memdup() by g_memdup2_qemu()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[RFC PATCH 22/28] linux-user: Replace g_memdup() by g_memdup2_qemu()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[PATCH 24/28] tests/qtest: Replace g_memdup() by g_memdup2_qemu()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[PATCH 25/28] target/arm: Replace g_memdup() by g_memdup2_qemu()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[PATCH 23/28] tests/unit: Replace g_memdup() by g_memdup2_qemu()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[PATCH 27/28] contrib: Replace g_memdup() by g_memdup2_qemu()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[PATCH 26/28] target/ppc: Replace g_memdup() by g_memdup2_qemu()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[PATCH 28/28] checkpatch: Do not allow deprecated g_memdup()

2021-09-03 Thread Philippe Mathieu-Daudé
g_memdup() is insecure and as been deprecated in GLib 2.68. QEMU provides the safely equivalent g_memdup2_qemu() wrapper. Do not allow more g_memdup() calls in the repository, provide a hint to use g_memdup2_qemu(). Signed-off-by: Philippe Mathieu-Daudé --- scripts/checkpatch.pl | 5 + 1 fi

[PATCH 15/28] hw/scsi/mptsas: Replace g_memdup() by g_memdup2_qemu()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

Re: [PATCH 03/28] qapi: Replace g_memdup() by g_memdup2_qemu()

2021-09-03 Thread Daniel P . Berrangé
On Fri, Sep 03, 2021 at 01:06:37PM +0200, Philippe Mathieu-Daudé wrote: > Per > https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 > > The old API took the size of the memory to duplicate as a guint, > whereas most memory functions take memory sizes as a gsize.

[PATCH 13/28] hw/net/eepro100: Replace g_memdup() by g_memdup2_qemu()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

Re: [PATCH 02/28] glib-compat: Introduce g_memdup2() wrapper

2021-09-03 Thread Daniel P . Berrangé
On Fri, Sep 03, 2021 at 01:06:36PM +0200, Philippe Mathieu-Daudé wrote: > When experimenting raising GLIB_VERSION_MIN_REQUIRED to 2.68 > (Fedora 34 provides GLib 2.68.1) we get: > > hw/virtio/virtio-crypto.c:245:24: error: 'g_memdup' is deprecated: Use > 'g_memdup2' instead [-Werror,-Wdeprecate

[PATCH v2] include/block.h: remove outdated comment

2021-09-03 Thread Emanuele Giuseppe Esposito
There are a couple of errors in bdrv_drained_begin header comment: - block_job_pause does not exist anymore, it has been replaced with job_pause in b15de82867 - job_pause is automatically invoked as a .drained_begin callback (child_job_drained_begin) by the child_job BdrvChildClass struct in

Re: [PATCH 02/28] glib-compat: Introduce g_memdup2() wrapper

2021-09-03 Thread Daniel P . Berrangé
On Fri, Sep 03, 2021 at 02:51:21PM +0300, Vladimir Sementsov-Ogievskiy wrote: > That was most probably already discussed, so sorry my question: > > Why we can't just do > > #if ! GLIB_CHECK_VERSION(2, 68, 0) > static inline gpointer g_memdup2(gconstpointer mem, gsize byte_size) > { > gpointer

Re: [PATCH 02/28] glib-compat: Introduce g_memdup2() wrapper

2021-09-03 Thread Vladimir Sementsov-Ogievskiy
03.09.2021 14:16, Daniel P. Berrangé wrote: On Fri, Sep 03, 2021 at 01:06:36PM +0200, Philippe Mathieu-Daudé wrote: When experimenting raising GLIB_VERSION_MIN_REQUIRED to 2.68 (Fedora 34 provides GLib 2.68.1) we get: hw/virtio/virtio-crypto.c:245:24: error: 'g_memdup' is deprecated: Use 'g

[PATCH v2] iotests/check: move long options to double dash

2021-09-03 Thread Vladimir Sementsov-Ogievskiy
So, the change: -makecheck -> --makecheck -gdb -> --gdb -valgrind -> --valgrind -misalign -> --misalign -nocache -> --nocache -qcow2 (and other formats) -> --qcow2 -file (and other protocols) -> --file Motivation: 1. check scripts uses ArgumentParser to parse options, whi

Re: [PATCH 02/28] glib-compat: Introduce g_memdup2() wrapper

2021-09-03 Thread Vladimir Sementsov-Ogievskiy
03.09.2021 14:56, Daniel P. Berrangé wrote: On Fri, Sep 03, 2021 at 02:51:21PM +0300, Vladimir Sementsov-Ogievskiy wrote: That was most probably already discussed, so sorry my question: Why we can't just do #if ! GLIB_CHECK_VERSION(2, 68, 0) static inline gpointer g_memdup2(gconstpointer mem,

Re: [PATCH] spec: Relax NBD_OPT_LIST_META_CONTEXTS

2021-09-03 Thread Eric Blake
Ping. On Mon, Aug 16, 2021 at 01:40:59PM -0500, Eric Blake wrote: > Using OPT_SET_META_CONTEXTS is stateful (it is documented to wipe out > any previously-requested contexts, and we just tightened the spec to > clarify that starting TLS also wipes it out). But > OPT_LIST_META_CONTEXTS is not stat

Re: [PATCH v2 18/19] qapi: backup: add immutable-source parameter

2021-09-03 Thread Markus Armbruster
Vladimir Sementsov-Ogievskiy writes: > We are on the way to implement internal-backup with fleecing scheme, > which includes backup job copying from fleecing block driver node > (which is target of copy-before-write filter) to final target of > backup. This job doesn't need own filter, as fleecin

Re: [PATCH v2 3/3] qapi: deprecate drive-backup

2021-09-03 Thread Markus Armbruster
Vladimir Sementsov-Ogievskiy writes: > 24.05.2021 21:37, John Snow wrote: >> On 5/24/21 10:06 AM, Vladimir Sementsov-Ogievskiy wrote: >>> 15.05.2021 01:38, John Snow wrote: On 5/6/21 5:57 AM, Kashyap Chamarthy wrote: > TODO: We also need to deprecate drive-backup transaction action.. >>>

Re: [PATCH v2 10/19] block: introduce fleecing block driver

2021-09-03 Thread Markus Armbruster
Vladimir Sementsov-Ogievskiy writes: > Introduce a new driver, that works in pair with copy-before-write to > improve fleecing. > > Without fleecing driver, old fleecing scheme looks as follows: > > [guest] > | > |root > v > [copy-before-write] -> [temp.qcow2] <--- [nbd export] > |

Re: [PATCH v6 1/6] qmp: add QMP command x-debug-query-virtio

2021-09-03 Thread Markus Armbruster
Jonah Palmer writes: > No problem! Comments below: > > On 8/23/21 9:27 AM, Markus Armbruster wrote: [...] >> Hmm... how is this enum used? In this patch: >> >> VirtioInfoList *qmp_x_debug_query_virtio(Error **errp) >> { >> VirtioInfoList *list = NULL; >> VirtioInfo

Re: [PATCH v2] fdc: check null block pointer before r/w data transfer

2021-09-03 Thread Salvatore Bonaccorso
On Tue, Sep 22, 2020 at 06:42:22PM +0800, Li Qiang wrote: > P J P 于2020年9月22日周二 下午5:29写道: > > > > From: Prasad J Pandit > > > > While transferring data via fdctrl_read/write_data() routines, > > check that current drive does not have a null block pointer. > > Avoid null pointer dereference. > > >

Re: [PATCH v2 10/19] block: introduce fleecing block driver

2021-09-03 Thread Vladimir Sementsov-Ogievskiy
01.09.2021 14:44, Markus Armbruster wrote: Vladimir Sementsov-Ogievskiy writes: Introduce a new driver, that works in pair with copy-before-write to improve fleecing. Without fleecing driver, old fleecing scheme looks as follows: [guest] | |root v [copy-before-write] -> [temp.qc

Re: [PATCH v6 1/5] block/nbd: nbd_channel_error() shutdown channel unconditionally

2021-09-03 Thread Eric Blake
On Thu, Sep 02, 2021 at 01:38:01PM +0300, Vladimir Sementsov-Ogievskiy wrote: > Don't rely on connection being totally broken in case of -EIO. More > safe and correct just shutdown the channel anyway, as we change the > state and going to reconnect. If you don't mind me tweaking grammar, I propose

Re: [PATCH 02/28] glib-compat: Introduce g_memdup2() wrapper

2021-09-03 Thread Philippe Mathieu-Daudé
On 9/3/21 1:16 PM, Daniel P. Berrangé wrote: > On Fri, Sep 03, 2021 at 01:06:36PM +0200, Philippe Mathieu-Daudé wrote: >> When experimenting raising GLIB_VERSION_MIN_REQUIRED to 2.68 >> (Fedora 34 provides GLib 2.68.1) we get: >> >> hw/virtio/virtio-crypto.c:245:24: error: 'g_memdup' is deprecate

Re: [PATCH 03/28] qapi: Replace g_memdup() by g_memdup2_qemu()

2021-09-03 Thread Philippe Mathieu-Daudé
On 9/3/21 1:18 PM, Daniel P. Berrangé wrote: > On Fri, Sep 03, 2021 at 01:06:37PM +0200, Philippe Mathieu-Daudé wrote: >> Per >> https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 >> >> The old API took the size of the memory to duplicate as a guint, >> whereas

Re: [PATCH v2] iotests/check: move long options to double dash

2021-09-03 Thread Eric Blake
On Fri, Sep 03, 2021 at 03:00:39PM +0300, Vladimir Sementsov-Ogievskiy wrote: > So, the change: > > -makecheck -> --makecheck > -gdb -> --gdb > -valgrind -> --valgrind > -misalign -> --misalign > -nocache -> --nocache > -qcow2 (and other formats) -> --qcow2 > -file (and oth

Re: [PATCH v6 3/5] block/nbd: refactor nbd_recv_coroutines_wake_all()

2021-09-03 Thread Eric Blake
On Thu, Sep 02, 2021 at 01:38:03PM +0300, Vladimir Sementsov-Ogievskiy wrote: > Split out nbd_recv_coroutine_wake_one(), as it will be used in > separate. > Rename the function and add a possibility to wake only first found > sleeping coroutine. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > -

[PATCH v2 00/30] glib: Replace g_memdup() by g_memdup2()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[PATCH v2 02/30] glib-compat: Introduce g_memdup2() wrapper

2021-09-03 Thread Philippe Mathieu-Daudé
When experimenting raising GLIB_VERSION_MIN_REQUIRED to 2.68 (Fedora 34 provides GLib 2.68.1) we get: hw/virtio/virtio-crypto.c:245:24: error: 'g_memdup' is deprecated: Use 'g_memdup2' instead [-Werror,-Wdeprecated-declarations] ... g_memdup() has been updated by g_memdup2() to fix eventual

Re: [PATCH v2 00/30] glib: Replace g_memdup() by g_memdup2()

2021-09-03 Thread Philippe Mathieu-Daudé
On 9/3/21 7:39 PM, Philippe Mathieu-Daudé wrote: > Per > https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 > > The old API took the size of the memory to duplicate as a guint, > whereas most memory functions take memory sizes as a gsize. This > made it easy

[PATCH v3 00/28] glib: Replace g_memdup() by g_memdup2()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[PATCH v2 01/30] hw/hyperv/vmbus: Remove unused vmbus_load/save_req()

2021-09-03 Thread Philippe Mathieu-Daudé
vmbus_save_req() and vmbus_load_req() are not used. Remove them to avoid maintaining dead code. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/hyperv/vmbus.h | 3 -- hw/hyperv/vmbus.c | 59 --- 2 files changed, 62 deletions(-) diff --git a/incl

[PATCH v3 06/28] softmmu: Replace g_memdup() by g_memdup2()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[PATCH v3 02/28] glib-compat: Introduce g_memdup2() wrapper

2021-09-03 Thread Philippe Mathieu-Daudé
When experimenting raising GLIB_VERSION_MIN_REQUIRED to 2.68 (Fedora 34 provides GLib 2.68.1) we get: hw/virtio/virtio-crypto.c:245:24: error: 'g_memdup' is deprecated: Use 'g_memdup2' instead [-Werror,-Wdeprecated-declarations] ... g_memdup() has been updated by g_memdup2() to fix eventual

[PATCH v3 01/28] hw/hyperv/vmbus: Remove unused vmbus_load/save_req()

2021-09-03 Thread Philippe Mathieu-Daudé
vmbus_save_req() and vmbus_load_req() are not used. Remove them to avoid maintaining dead code. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/hyperv/vmbus.h | 3 -- hw/hyperv/vmbus.c | 59 --- 2 files changed, 62 deletions(-) diff --git a/incl

[PATCH v3 03/28] qapi: Replace g_memdup() by g_memdup2()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[PATCH v3 04/28] accel/tcg: Replace g_memdup() by g_memdup2()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[PATCH v3 05/28] block/qcow2-bitmap: Replace g_memdup() by g_memdup2()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[PATCH v3 09/28] hw/acpi: Replace g_memdup() by g_memdup2()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[PATCH v3 11/28] hw/hppa/machine: Replace g_memdup() by g_memdup2()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[PATCH v3 12/28] hw/i386/multiboot: Replace g_memdup() by g_memdup2()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[PATCH v3 15/28] hw/scsi/mptsas: Replace g_memdup() by g_memdup2()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[PATCH v3 16/28] hw/ppc/spapr_pci: Replace g_memdup() by g_memdup2()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[PATCH v3 07/28] hw/9pfs: Replace g_memdup() by g_memdup2()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[PATCH v3 08/28] hw/acpi: Avoid truncating acpi_data_len() to 32-bit

2021-09-03 Thread Philippe Mathieu-Daudé
acpi_data_len() returns an unsigned type, which might be bigger than 32-bit (although it is unlikely such value is returned). Hold the returned value in an 'unsigned' type to avoid unlikely size truncation. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/virt-acpi-build.c | 2 +- hw/i386/acpi-b

[PATCH v3 10/28] hw/core/machine: Replace g_memdup() by g_memdup2()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[RFC PATCH v3 21/28] ui/clipboard: Replace g_memdup() by g_memdup2()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[PATCH v3 13/28] hw/net/eepro100: Replace g_memdup() by g_memdup2()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[PATCH v3 17/28] hw/rdma: Replace g_memdup() by g_memdup2()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[PATCH v3 14/28] hw/nvram/fw_cfg: Replace g_memdup() by g_memdup2()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[PATCH v3 23/28] tests/unit: Replace g_memdup() by g_memdup2()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[PATCH v3 18/28] hw/vfio/pci: Replace g_memdup() by g_memdup2()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[PATCH v3 24/28] tests/qtest: Replace g_memdup() by g_memdup2()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[PATCH v3 28/28] checkpatch: Do not allow deprecated g_memdup()

2021-09-03 Thread Philippe Mathieu-Daudé
g_memdup() is insecure and as been deprecated in GLib 2.68. QEMU provides the safely equivalent g_memdup2() wrapper. Do not allow more g_memdup() calls in the repository, provide a hint to use g_memdup2(). Signed-off-by: Philippe Mathieu-Daudé --- scripts/checkpatch.pl | 5 + 1 file changed

[PATCH v3 20/28] net/colo: Replace g_memdup() by g_memdup2()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[RFC PATCH v3 19/28] hw/virtio: Replace g_memdup() by g_memdup2()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[RFC PATCH v3 22/28] linux-user: Replace g_memdup() by g_memdup2()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[PATCH v3 26/28] target/ppc: Replace g_memdup() by g_memdup2()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[PATCH v3 25/28] target/arm: Replace g_memdup() by g_memdup2()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

[PATCH v3 27/28] contrib: Replace g_memdup() by g_memdup2()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value

Re: [PATCH v6 5/5] block/nbd: check that received handle is valid

2021-09-03 Thread Eric Blake
On Thu, Sep 02, 2021 at 01:38:05PM +0300, Vladimir Sementsov-Ogievskiy wrote: > If we don't have active request, that waiting for this handle to be > received, we should report an error. If we don't have an active request waiting for this handle to be received, > > Signed-off-by: Vladimir Sement

Re: [PATCH v2] block: drop BLK_PERM_GRAPH_MOD

2021-09-03 Thread Eric Blake
On Thu, Sep 02, 2021 at 12:37:54PM +0300, Vladimir Sementsov-Ogievskiy wrote: > First, this permission never protected a node from being changed, as > generic child-replacing functions don't check it. > > Second, it's a strange thing: it presents a permission of parent node > to change its child.

Re: [PATCH v3 02/28] glib-compat: Introduce g_memdup2() wrapper

2021-09-03 Thread Eric Blake
On Fri, Sep 03, 2021 at 07:44:44PM +0200, Philippe Mathieu-Daudé wrote: > When experimenting raising GLIB_VERSION_MIN_REQUIRED to 2.68 > (Fedora 34 provides GLib 2.68.1) we get: > > hw/virtio/virtio-crypto.c:245:24: error: 'g_memdup' is deprecated: Use > 'g_memdup2' instead [-Werror,-Wdeprecate

Re: [PATCH v3 03/28] qapi: Replace g_memdup() by g_memdup2()

2021-09-03 Thread Eric Blake
On Fri, Sep 03, 2021 at 07:44:45PM +0200, Philippe Mathieu-Daudé wrote: > Per > https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 > > The old API took the size of the memory to duplicate as a guint, > whereas most memory functions take memory sizes as a gsize.

Re: [PATCH v3 05/28] block/qcow2-bitmap: Replace g_memdup() by g_memdup2()

2021-09-03 Thread Eric Blake
On Fri, Sep 03, 2021 at 07:44:47PM +0200, Philippe Mathieu-Daudé wrote: > Per > https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 > > The old API took the size of the memory to duplicate as a guint, > whereas most memory functions take memory sizes as a gsize.

Re: [PATCH v3 28/28] checkpatch: Do not allow deprecated g_memdup()

2021-09-03 Thread Eric Blake
On Fri, Sep 03, 2021 at 07:45:10PM +0200, Philippe Mathieu-Daudé wrote: > g_memdup() is insecure and as been deprecated in GLib 2.68. > QEMU provides the safely equivalent g_memdup2() wrapper. > > Do not allow more g_memdup() calls in the repository, provide > a hint to use g_memdup2(). > > Signe

  1   2   >