Re: [PATCH v2 6/6] libvduse: Add support for reconnecting

2022-03-15 Thread Yongji Xie
On Tue, Mar 15, 2022 at 9:48 PM Stefan Hajnoczi wrote: > > On Tue, Feb 15, 2022 at 06:59:43PM +0800, Xie Yongji wrote: > > +static int vduse_queue_inflight_get(VduseVirtq *vq, int desc_idx) > > +{ > > +vq->log->inflight.desc[desc_idx].counter = vq->counter++; > > +

Re: [PATCH experiment 00/16] C++20 coroutine backend

2022-03-15 Thread Paolo Bonzini
On 3/15/22 16:55, Daniel P. Berrangé wrote: Expecting maintainers to enforce a subset during code review feels like it would be a tedious burden, that will inevitably let stuff through because humans are fallible, especially when presented with uninspiring, tedious, repetitive tasks.

Re: [PATCH v2 1/6] block: Support passing NULL ops to blk_set_dev_ops()

2022-03-15 Thread John Snow
On Tue, Mar 15, 2022 at 4:47 AM Stefan Hajnoczi wrote: > > On Mon, Mar 14, 2022 at 03:09:35PM -0400, John Snow wrote: > > On Mon, Mar 14, 2022 at 1:23 PM Stefan Hajnoczi wrote: > > > > > > On Tue, Feb 15, 2022 at 06:59:38PM +0800, Xie Yongji wrote: > > > > This supports passing NULL ops to

Re: [PATCH experiment 00/16] C++20 coroutine backend

2022-03-15 Thread Daniel P . Berrangé
On Tue, Mar 15, 2022 at 06:27:57PM +0100, Paolo Bonzini wrote: > On 3/15/22 10:32, Daniel P. Berrangé wrote: > > > > So NetBSD is our biggest constraint on requiring GCC 10 > > > > > > Do we care about the BSDs since they have newer compilers (including > > > gcc10) > > > available in pkgsrc?

Summary on new backup interfaces in QEMU

2022-03-15 Thread Vladimir Sementsov-Ogievskiy
Hi all! Here I want to summarize new interfaces and use cases for backup in QEMU. TODO for me: convert this into good rst documentation in docs/. OK, let's begin. First, note that drive-backup qmp command is deprecated. Next, some terminology: push backup: the whole process is inside QEMU

Re: [PATCH v2] block-qdict: Fix -Werror=maybe-uninitialized build failure

2022-03-15 Thread Murilo Opsfelder Araújo
Hi, Philippe. On Monday, March 14, 2022 10:47:11 AM -03 Philippe Mathieu-Daudé wrote: > On 11/3/22 23:16, Murilo Opsfelder Araujo wrote: > > Building QEMU on Fedora 37 (Rawhide Prerelease) ppc64le failed with the > > following error: > > > > $ ../configure --prefix=/usr/local/qemu-disabletcg

Re: [PATCH experiment 00/16] C++20 coroutine backend

2022-03-15 Thread Paolo Bonzini
On 3/15/22 17:15, Daniel P. Berrangé wrote: Bear with me as I suggest something potentially/probably silly given my limited knowledge of C++ coroutines. Given a function I know about: void coroutine_fn qio_channel_yield(QIOChannel *ioc, GIOCondition

Re: [PATCH experiment 00/16] C++20 coroutine backend

2022-03-15 Thread Paolo Bonzini
On 3/15/22 15:24, Peter Maydell wrote: On Tue, 15 Mar 2022 at 14:09, Stefan Hajnoczi wrote: Also, once C++ is available people will start submitting C++ patches simply because they are more comfortable with C++ (especially one-time/infrequent contributors). This to my mind is the major

Re: [PATCH experiment 00/16] C++20 coroutine backend

2022-03-15 Thread Paolo Bonzini
On 3/15/22 10:32, Daniel P. Berrangé wrote: So NetBSD is our biggest constraint on requiring GCC 10 Do we care about the BSDs since they have newer compilers (including gcc10) available in pkgsrc? If you go by the base system, then RHEL8 has 8.5.0 and newer version are only available with

When and how to use C++ (was Re: [PATCH experiment 00/16] C++20 coroutine backend)

2022-03-15 Thread Paolo Bonzini
On 3/15/22 15:50, Kevin Wolf wrote: I'm not sure what the C++ lock guards offer that our current lock guards don't? Passing down lock guards makes sense to me, but why can't you do that with QemuLockable? Passing a QemuLockable alone doesn't ensure that the lock has been taken. I guess we

Re: [PATCH 3/3] Use g_new() & friends where that makes obvious sense

2022-03-15 Thread Alex Bennée
Markus Armbruster writes: > Philippe Mathieu-Daudé writes: > >> On 15/3/22 14:59, Markus Armbruster wrote: >>> Alex Bennée writes: >>> Markus Armbruster writes: > g_new(T, n) is neater than g_malloc(sizeof(T) * n). It's also safer, > for two reasons. One, it catches

Re: [PATCH experiment 00/16] C++20 coroutine backend

2022-03-15 Thread Daniel P . Berrangé
On Mon, Mar 14, 2022 at 10:31:47AM +0100, Paolo Bonzini wrote: > However, there are no ramifications to actual coroutine code, except > for the template syntax "CoroutineFn" for the function and > the mandatory co_await/co_return keywords... both of which are an > improvement, really: the fact

Re: [PATCH experiment 00/16] C++20 coroutine backend

2022-03-15 Thread Daniel P . Berrangé
On Tue, Mar 15, 2022 at 03:50:26PM +0100, Kevin Wolf wrote: > Am 15.03.2022 um 15:05 hat Stefan Hajnoczi geschrieben: > > On Mon, Mar 14, 2022 at 05:21:22PM +0100, Paolo Bonzini wrote: > > > On 3/14/22 15:07, Stefan Hajnoczi wrote: > > > > If we can reach a consensus about C++ language usage in

Re: [PATCH experiment 00/16] C++20 coroutine backend

2022-03-15 Thread Stefan Hajnoczi
On Tue, Mar 15, 2022 at 03:50:26PM +0100, Kevin Wolf wrote: > Am 15.03.2022 um 15:05 hat Stefan Hajnoczi geschrieben: > > On Mon, Mar 14, 2022 at 05:21:22PM +0100, Paolo Bonzini wrote: > > > On 3/14/22 15:07, Stefan Hajnoczi wrote: > > > > If we can reach a consensus about C++ language usage in

Re: [PATCH experiment 00/16] C++20 coroutine backend

2022-03-15 Thread Kevin Wolf
Am 15.03.2022 um 15:05 hat Stefan Hajnoczi geschrieben: > On Mon, Mar 14, 2022 at 05:21:22PM +0100, Paolo Bonzini wrote: > > On 3/14/22 15:07, Stefan Hajnoczi wrote: > > > If we can reach a consensus about C++ language usage in QEMU then I'm in > > > favor of using C++ coroutines. It's probably

Re: [PATCH 3/3] Use g_new() & friends where that makes obvious sense

2022-03-15 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > On 15/3/22 14:59, Markus Armbruster wrote: >> Alex Bennée writes: >> >>> Markus Armbruster writes: >>> g_new(T, n) is neater than g_malloc(sizeof(T) * n). It's also safer, for two reasons. One, it catches multiplication overflowing size_t.

[PATCH v2 0/3] Use g_new() & friends where that makes obvious sense

2022-03-15 Thread Markus Armbruster
g_new(T, n) is neater than g_malloc(sizeof(T) * n). It's also safer, for two reasons. One, it catches multiplication overflowing size_t. Two, it returns T * rather than void *, which lets the compiler catch more type errors. This series only touches allocations with size arguments of the form

[PATCH v2 2/3] 9pfs: Use g_new() & friends where that makes obvious sense

2022-03-15 Thread Markus Armbruster
g_new(T, n) is neater than g_malloc(sizeof(T) * n). It's also safer, for two reasons. One, it catches multiplication overflowing size_t. Two, it returns T * rather than void *, which lets the compiler catch more type errors. This commit only touches allocations with size arguments of the form

[PATCH v2 3/3] Use g_new() & friends where that makes obvious sense

2022-03-15 Thread Markus Armbruster
g_new(T, n) is neater than g_malloc(sizeof(T) * n). It's also safer, for two reasons. One, it catches multiplication overflowing size_t. Two, it returns T * rather than void *, which lets the compiler catch more type errors. This commit only touches allocations with size arguments of the form

[PATCH v2 1/3] scripts/coccinelle: New use-g_new-etc.cocci

2022-03-15 Thread Markus Armbruster
This is the semantic patch from commit b45c03f585 "arm: Use g_new() & friends where that makes obvious sense". Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée --- scripts/coccinelle/use-g_new-etc.cocci | 75

Re: [PATCH experiment 00/16] C++20 coroutine backend

2022-03-15 Thread Peter Maydell
On Tue, 15 Mar 2022 at 14:09, Stefan Hajnoczi wrote: > Also, once C++ is available people will > start submitting C++ patches simply because they are more comfortable > with C++ (especially one-time/infrequent contributors). This to my mind is the major argument against using C++ for

Re: [PATCH 3/3] Use g_new() & friends where that makes obvious sense

2022-03-15 Thread Philippe Mathieu-Daudé
On 15/3/22 14:59, Markus Armbruster wrote: Alex Bennée writes: Markus Armbruster writes: g_new(T, n) is neater than g_malloc(sizeof(T) * n). It's also safer, for two reasons. One, it catches multiplication overflowing size_t. Two, it returns T * rather than void *, which lets the

Re: [PATCH experiment 00/16] C++20 coroutine backend

2022-03-15 Thread Stefan Hajnoczi
On Mon, Mar 14, 2022 at 05:21:22PM +0100, Paolo Bonzini wrote: > On 3/14/22 15:07, Stefan Hajnoczi wrote: > > If we can reach a consensus about C++ language usage in QEMU then I'm in > > favor of using C++ coroutines. It's probably not realistic to think we > > can limit C++ language usage to just

Re: [PATCH 3/3] Use g_new() & friends where that makes obvious sense

2022-03-15 Thread Markus Armbruster
Eric Blake writes: > On Mon, Mar 14, 2022 at 05:01:08PM +0100, Markus Armbruster wrote: >> g_new(T, n) is neater than g_malloc(sizeof(T) * n). It's also safer, >> for two reasons. One, it catches multiplication overflowing size_t. >> Two, it returns T * rather than void *, which lets the

Re: [PATCH 3/3] Use g_new() & friends where that makes obvious sense

2022-03-15 Thread Markus Armbruster
Alex Bennée writes: > Markus Armbruster writes: > >> g_new(T, n) is neater than g_malloc(sizeof(T) * n). It's also safer, >> for two reasons. One, it catches multiplication overflowing size_t. >> Two, it returns T * rather than void *, which lets the compiler catch >> more type errors. >> >

Re: [PATCH 3/3] Use g_new() & friends where that makes obvious sense

2022-03-15 Thread Markus Armbruster
Alex Bennée writes: > Markus Armbruster writes: > >> g_new(T, n) is neater than g_malloc(sizeof(T) * n). It's also safer, >> for two reasons. One, it catches multiplication overflowing size_t. >> Two, it returns T * rather than void *, which lets the compiler catch >> more type errors. >> >>

Re: [PATCH v2 6/6] libvduse: Add support for reconnecting

2022-03-15 Thread Stefan Hajnoczi
On Tue, Feb 15, 2022 at 06:59:43PM +0800, Xie Yongji wrote: > +static int vduse_queue_inflight_get(VduseVirtq *vq, int desc_idx) > +{ > +vq->log->inflight.desc[desc_idx].counter = vq->counter++; > +vq->log->inflight.desc[desc_idx].inflight = 1; Is a barrier needed between these two lines

Re: [PATCH v2 5/6] vduse-blk: Add vduse-blk resize support

2022-03-15 Thread Stefan Hajnoczi
On Tue, Feb 15, 2022 at 06:59:42PM +0800, Xie Yongji wrote: > To support block resize, this uses vduse_dev_update_config() > to update the capacity field in configuration space and inject > config interrupt on the block resize callback. > > Signed-off-by: Xie Yongji > --- >

Re: [PATCH v3 3/3] nbd/server: Allow MULTI_CONN for shared writable exports

2022-03-15 Thread Richard W.M. Jones
The patches seem OK to me, but I don't really know enough about the internals of qemu-nbd to give a line-by-line review. I did however build and test qemu-nbd with the patches: $ ./build/qemu-nbd /var/tmp/test.qcow2 $ nbdinfo nbd://localhost ... can_multi_conn: false $

Re: [PATCH v7 06/22] hvf: Fix OOB write in RDTSCP instruction decode

2022-03-15 Thread Philippe Mathieu-Daudé
On 15/3/22 13:58, Peter Maydell wrote: On Wed, 9 Mar 2022 at 10:20, Philippe Mathieu-Daudé wrote: Hi Paolo, I forgot to Cc you. Could you Ack this patch? I had review comments on the version of this patch in v5 which still need to be addressed:

Re: [PATCH v7 06/22] hvf: Fix OOB write in RDTSCP instruction decode

2022-03-15 Thread Peter Maydell
On Wed, 9 Mar 2022 at 10:20, Philippe Mathieu-Daudé wrote: > > Hi Paolo, > > I forgot to Cc you. Could you Ack this patch? I had review comments on the version of this patch in v5 which still need to be addressed:

Re: [PATCH v7 00/22] host: Support macOS 12

2022-03-15 Thread Philippe Mathieu-Daudé
On 7/3/22 00:17, Philippe Mathieu-Daudé wrote: From: Philippe Mathieu-Daudé Few patches to be able to build QEMU on macOS 12 (Monterey). Missing review: 0006-hvf-Fix-OOB-write-in-RDTSCP-instruction-decode.patch 0013-osdep-Avoid-using-Clang-specific-__builtin_available.patch

Re: [PATCH v2 4/6] vduse-blk: implements vduse-blk export

2022-03-15 Thread Yongji Xie
On Tue, Mar 15, 2022 at 7:08 PM Stefan Hajnoczi wrote: > > On Tue, Feb 15, 2022 at 06:59:41PM +0800, Xie Yongji wrote: > > This implements a VDUSE block backends based on > > the libvduse library. We can use it to export the BDSs > > for both VM and container (host) usage. > > > > The new

Re: [PATCH v2 3/6] libvduse: Add VDUSE (vDPA Device in Userspace) library

2022-03-15 Thread Yongji Xie
On Tue, Mar 15, 2022 at 5:48 PM Stefan Hajnoczi wrote: > > On Tue, Feb 15, 2022 at 06:59:40PM +0800, Xie Yongji wrote: > > VDUSE [1] is a linux framework that makes it possible to implement > > software-emulated vDPA devices in userspace. This adds a library > > as a subproject to help

Re: [PATCH v2 4/6] vduse-blk: implements vduse-blk export

2022-03-15 Thread Stefan Hajnoczi
On Tue, Feb 15, 2022 at 06:59:41PM +0800, Xie Yongji wrote: > This implements a VDUSE block backends based on > the libvduse library. We can use it to export the BDSs > for both VM and container (host) usage. > > The new command-line syntax is: > > $ qemu-storage-daemon \ > --blockdev

Re: [PATCH 3/3] Use g_new() & friends where that makes obvious sense

2022-03-15 Thread Dr. David Alan Gilbert
* Markus Armbruster (arm...@redhat.com) wrote: > g_new(T, n) is neater than g_malloc(sizeof(T) * n). It's also safer, > for two reasons. One, it catches multiplication overflowing size_t. > Two, it returns T * rather than void *, which lets the compiler catch > more type errors. > > This commit

[PATCH v2] meson: Update to version 0.61.3

2022-03-15 Thread Thomas Huth
Meson 0.61.3 contains an important fix which helps to see the output of failed qemu-iotests on the console again: https://gitlab.com/qemu-project/meson/-/commit/7534cf34f83b9c43 Acked-by: Paolo Bonzini Signed-off-by: Thomas Huth --- v2: Update the version in the configure script, too (as

Re: [PATCH v2 3/6] libvduse: Add VDUSE (vDPA Device in Userspace) library

2022-03-15 Thread Stefan Hajnoczi
On Tue, Feb 15, 2022 at 06:59:40PM +0800, Xie Yongji wrote: > VDUSE [1] is a linux framework that makes it possible to implement > software-emulated vDPA devices in userspace. This adds a library > as a subproject to help implementing VDUSE backends in QEMU. > > [1]

Re: [PATCH experiment 00/16] C++20 coroutine backend

2022-03-15 Thread Daniel P . Berrangé
On Tue, Mar 15, 2022 at 10:05:32AM +0100, Paolo Bonzini wrote: > On 3/14/22 17:52, Daniel P. Berrangé wrote: > > RHEL-8: 10.0.1 > > openSUSE Leap 15.3: 9.0.1 > >Ubuntu LTS 18.04: 6.0.0 > > FreeBSD 12: 8.0.1 > > > > Ubuntu 18.04 drops off our list after

Re: [PATCH 3/3] Use g_new() & friends where that makes obvious sense

2022-03-15 Thread Eric Blake
On Mon, Mar 14, 2022 at 05:01:08PM +0100, Markus Armbruster wrote: > g_new(T, n) is neater than g_malloc(sizeof(T) * n). It's also safer, > for two reasons. One, it catches multiplication overflowing size_t. > Two, it returns T * rather than void *, which lets the compiler catch > more type

Re: [PATCH for-7.0?] meson: Update to version 0.61.3

2022-03-15 Thread Paolo Bonzini
On 3/15/22 09:35, Thomas Huth wrote: Meson 0.61.3 contains an important fix which helps to see the output of failed qemu-iotests on the console again: https://gitlab.com/qemu-project/meson/-/commit/7534cf34f83b9c43 Signed-off-by: Thomas Huth --- meson | 2 +- 1 file changed, 1 insertion(+),

Re: [PATCH experiment 00/16] C++20 coroutine backend

2022-03-15 Thread Paolo Bonzini
On 3/14/22 17:52, Daniel P. Berrangé wrote: RHEL-8: 10.0.1 openSUSE Leap 15.3: 9.0.1 Ubuntu LTS 18.04: 6.0.0 FreeBSD 12: 8.0.1 Ubuntu 18.04 drops off our list after 7.0 comes out OpenSUSE Leap 15.2 was EOL'd by SUSE themselves in Jan 2022, We use it as

Re: [PATCH v2 1/6] block: Support passing NULL ops to blk_set_dev_ops()

2022-03-15 Thread Stefan Hajnoczi
On Mon, Mar 14, 2022 at 03:09:35PM -0400, John Snow wrote: > On Mon, Mar 14, 2022 at 1:23 PM Stefan Hajnoczi wrote: > > > > On Tue, Feb 15, 2022 at 06:59:38PM +0800, Xie Yongji wrote: > > > This supports passing NULL ops to blk_set_dev_ops() > > > so that we can remove stale ops in some cases. >

[PATCH for-7.0?] meson: Update to version 0.61.3

2022-03-15 Thread Thomas Huth
Meson 0.61.3 contains an important fix which helps to see the output of failed qemu-iotests on the console again: https://gitlab.com/qemu-project/meson/-/commit/7534cf34f83b9c43 Signed-off-by: Thomas Huth --- meson | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson

Re: [PATCH 2/3] 9pfs: Use g_new() & friends where that makes obvious sense

2022-03-15 Thread Greg Kurz
On Mon, 14 Mar 2022 17:01:07 +0100 Markus Armbruster wrote: > g_new(T, n) is neater than g_malloc(sizeof(T) * n). It's also safer, > for two reasons. One, it catches multiplication overflowing size_t. > Two, it returns T * rather than void *, which lets the compiler catch > more type errors. >