Re: [PATCH v3 0/7] Steps towards enabling -Wshadow=local

2023-09-28 Thread Markus Armbruster
Markus Armbruster writes: > Local variables shadowing other local variables or parameters make the > code needlessly hard to understand. Bugs love to hide in such code. > Evidence: PATCH 1. > > Enabling -Wshadow would prevent bugs like this one. But we'd have to > clean up all the offenders

Re: [PATCH] test-throttle: don't shadow 'index' variable in do_test_accounting()

2023-09-28 Thread Markus Armbruster
Alberto Garcia writes: > Fixes build with -Wshadow=local > > Signed-off-by: Alberto Garcia > --- > tests/unit/test-throttle.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tests/unit/test-throttle.c b/tests/unit/test-throttle.c > index cb587e33e7..ac35d65d19 100644 >

Re: [PATCH 0/3] (few more) Steps towards enabling -Wshadow [3 more]

2023-09-28 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > Just missed while posting v2 eh :/ > (https://lore.kernel.org/qemu-devel/20230904161235.84651-1-phi...@linaro.org/) PATCH 3 has become commit 82fdcd3e140c8d4c63f177ece554f90f2bccdf68. Remainder queued. Thanks!

Re: [PATCH v2 00/22] (few more) Steps towards enabling -Wshadow

2023-09-28 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > Since v1: > - Addressed review comments > - Added R-b tags > - More patches > > For rational see Markus cover on > https://lore.kernel.org/qemu-devel/20230831132546.3525721-1-arm...@redhat.com/ > > This series contains few more, my take. > > Based-on:

Re: [PATCH v2 11/22] hw/ide/ahci: Clean up local variable shadowing

2023-09-28 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > hw/ide/ahci.c:1577:23: error: declaration shadows a local variable > [-Werror,-Wshadow] > IDEState *s = >port.ifs[j]; > ^ > hw/ide/ahci.c:1569:29: note: previous declaration is here > void ahci_uninit(AHCIState *s) >

Re: [PATCH v2 20/22] sysemu/device_tree: Clean up local variable shadowing

2023-09-28 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > Fix: > > hw/mips/boston.c:472:5: error: declaration shadows a local variable > [-Werror,-Wshadow] > qemu_fdt_setprop_cells(fdt, name, "reg", reg_base, reg_size); > ^ > include/sysemu/device_tree.h:129:13: note: expanded from macro >

Re: [PATCH v6 4/5] vhost-user-scsi: start vhost when guest kicks

2023-09-28 Thread Raphael Norwitz
> On Sep 22, 2023, at 7:46 AM, Li Feng wrote: > > Let's keep the same behavior as vhost-user-blk. > > Some old guests kick virtqueue before setting VIRTIO_CONFIG_S_DRIVER_OK. > Reviewed-by: Raphael Norwitz > Signed-off-by: Li Feng > --- > hw/scsi/vhost-user-scsi.c | 48

Re: [PATCH v6 1/5] vhost-user-common: send get_inflight_fd once

2023-09-28 Thread Raphael Norwitz
> On Sep 22, 2023, at 7:46 AM, Li Feng wrote: > > Currently the get_inflight_fd will be sent every time the device is started, > and > the backend will allocate shared memory to save the inflight state. If the > backend finds that it receives the second get_inflight_fd, it will release the >

Re: [PATCH v6 5/5] vhost-user: fix lost reconnect

2023-09-28 Thread Raphael Norwitz
> On Sep 22, 2023, at 7:46 AM, Li Feng wrote: > > When the vhost-user is reconnecting to the backend, and if the vhost-user > fails > at the get_features in vhost_dev_init(), then the reconnect will fail > and it will not be retriggered forever. > > The reason is: > When the vhost-user

Re: [PATCH v6 3/5] vhost-user-scsi: support reconnect to backend

2023-09-28 Thread Raphael Norwitz
One comment on the logging stuff in vhost-scsi. As far as I can tell the logging in vhost-user-scsi looks good. Markus - does this look better to you? Otherwise do you think we should also fix up the vhost-user-blk realize function? > On Sep 22, 2023, at 7:46 AM, Li Feng wrote: > > If the

Re: [PATCH v6 5/5] vhost-user: fix lost reconnect

2023-09-28 Thread Raphael Norwitz
> On Sep 22, 2023, at 7:46 AM, Li Feng wrote: > > When the vhost-user is reconnecting to the backend, and if the vhost-user > fails > at the get_features in vhost_dev_init(), then the reconnect will fail > and it will not be retriggered forever. > > The reason is: > When the vhost-user

Re: [PATCH v7 01/12] nbd/server: Support a request payload

2023-09-28 Thread Vladimir Sementsov-Ogievskiy
On 28.09.23 17:33, Eric Blake wrote: On Thu, Sep 28, 2023 at 12:09:51PM +0300, Vladimir Sementsov-Ogievskiy wrote: On 27.09.23 18:59, Eric Blake wrote: We could also try to be a bit more complicated by peeking at the next few bytes: if they look like a magic number of the next request, assume

Re: [PATCH v4 3/4] qcow2: add zoned emulation capability

2023-09-28 Thread Eric Blake
On Mon, Sep 18, 2023 at 05:53:12PM +0800, Sam Li wrote: > By adding zone operations and zoned metadata, the zoned emulation > capability enables full emulation support of zoned device using > a qcow2 file. The zoned device metadata includes zone type, > zoned device state and write pointer of each

Re: [PATCH v4 2/4] qcow2: add configurations for zoned format extension

2023-09-28 Thread Eric Blake
On Mon, Sep 18, 2023 at 05:53:11PM +0800, Sam Li wrote: > To configure the zoned format feature on the qcow2 driver, it > requires settings as: the device size, zone model, zone size, > zone capacity, number of conventional zones, limits on zone > resources (max append sectors, max open zones, and

Re: [PATCH v7 01/12] nbd/server: Support a request payload

2023-09-28 Thread Eric Blake
On Thu, Sep 28, 2023 at 12:09:51PM +0300, Vladimir Sementsov-Ogievskiy wrote: > On 27.09.23 18:59, Eric Blake wrote: > > We could also try to be a bit more complicated by peeking at the next > > few bytes: if they look like a magic number of the next request, > > assume the client set the bit

Re: [PATCH v3 0/6] python/machine: use socketpair() for console socket

2023-09-28 Thread John Snow
On Thu, Sep 28, 2023, 4:12 AM Daniel P. Berrangé wrote: > On Thu, Sep 28, 2023 at 12:49:37AM -0400, John Snow wrote: > > Like we did for the QMP socket, use socketpair() for the console socket > > so that hopefully there isn't a race condition during early boot where > > data might get dropped

Re: [PATCH 1/1] hw/ide/core: terminate in-flight DMA on IDE bus reset

2023-09-28 Thread Fiona Ebner
Am 26.09.23 um 16:45 schrieb John Snow: > > > On Tue, Sep 26, 2023, 3:11 AM Fiona Ebner > wrote: > > Am 25.09.23 um 21:53 schrieb John Snow: > > On Thu, Sep 21, 2023 at 12:07 PM Simon Rowe > mailto:simon.r...@nutanix.com>> wrote: > >> > >> When

Re: [PATCH v7 01/12] nbd/server: Support a request payload

2023-09-28 Thread Vladimir Sementsov-Ogievskiy
On 27.09.23 18:59, Eric Blake wrote: We could also try to be a bit more complicated by peeking at the next few bytes: if they look like a magic number of the next request, assume the client set the bit accidentally but didn't send a payload after all; for anything else, assume the client did

Re: [PATCH v3 0/6] python/machine: use socketpair() for console socket

2023-09-28 Thread Daniel P . Berrangé
On Thu, Sep 28, 2023 at 12:49:37AM -0400, John Snow wrote: > Like we did for the QMP socket, use socketpair() for the console socket > so that hopefully there isn't a race condition during early boot where > data might get dropped on the floor. > > May or may not help with various race conditions

Re: deadlock when using iothread during backup_clean()

2023-09-28 Thread Fiona Ebner
Am 05.09.23 um 13:42 schrieb Paolo Bonzini: > On 9/5/23 12:01, Fiona Ebner wrote: >> Can we assume block_job_remove_all_bdrv() to always hold the job's >> AioContext? > > I think so, see job_unref_locked(), job_prepare_locked() and > job_finalize_single_locked().  These call the callbacks that