Re: [PATCH v3 07/10] qapi: implement conditional command arguments

2023-03-02 Thread Markus Armbruster
Markus Armbruster writes: [...] > I'd like to tighten the restriction instead: conditional arguments > require boxed. Less ugly and less awkward to document, I think. I had a look, and realized that doing it right will be a bit more involved than I thought, since a couple of test cases need fi

Re: [PATCH v3 07/10] qapi: implement conditional command arguments

2023-03-02 Thread Markus Armbruster
Daniel P. Berrangé writes: > On Thu, Mar 02, 2023 at 07:58:28AM +0100, Markus Armbruster wrote: >> Marc-André Lureau writes: >> >> > Hi >> > >> > On Wed, Mar 1, 2023 at 5:16 PM Markus Armbruster wrote: >> >> What about 3. have an additional command conditional on CONFIG_WIN32? >> >> Existing g

Re: [PATCH v3 07/10] qapi: implement conditional command arguments

2023-03-02 Thread Daniel P . Berrangé
On Thu, Mar 02, 2023 at 07:58:28AM +0100, Markus Armbruster wrote: > Marc-André Lureau writes: > > > Hi > > > > On Wed, Mar 1, 2023 at 5:16 PM Markus Armbruster wrote: > >> What about 3. have an additional command conditional on CONFIG_WIN32? > >> Existing getfd stays the same: always fails when

Re: [PATCH v3 07/10] qapi: implement conditional command arguments

2023-03-01 Thread Markus Armbruster
Marc-André Lureau writes: > Hi > > On Wed, Mar 1, 2023 at 5:16 PM Markus Armbruster wrote: >> What about 3. have an additional command conditional on CONFIG_WIN32? >> Existing getfd stays the same: always fails when QEMU runs on a Windows >> host. The new command exists only when QEMU runs on a

Re: [PATCH v3 07/10] qapi: implement conditional command arguments

2023-03-01 Thread Marc-André Lureau
Hi On Wed, Mar 1, 2023 at 5:16 PM Markus Armbruster wrote: > What about 3. have an additional command conditional on CONFIG_WIN32? > Existing getfd stays the same: always fails when QEMU runs on a Windows > host. The new command exists only when QEMU runs on a Windows host. This is what was sug

Re: [PATCH v3 07/10] qapi: implement conditional command arguments

2023-03-01 Thread Markus Armbruster
Daniel P. Berrangé writes: > On Tue, Feb 28, 2023 at 09:58:01AM -0600, Eric Blake wrote: >> On Wed, Feb 22, 2023 at 11:23:03AM +0100, Markus Armbruster wrote: >> > > However, I think it would be simpler, and better, if we piped the >> > > generated code to clang-format (when available). I made a

Re: [PATCH v3 07/10] qapi: implement conditional command arguments

2023-03-01 Thread Daniel P . Berrangé
On Tue, Feb 28, 2023 at 09:58:01AM -0600, Eric Blake wrote: > On Wed, Feb 22, 2023 at 11:23:03AM +0100, Markus Armbruster wrote: > > > However, I think it would be simpler, and better, if we piped the > > > generated code to clang-format (when available). I made a simple patch > > > for that too. >

Re: [PATCH v3 07/10] qapi: implement conditional command arguments

2023-02-28 Thread Marc-André Lureau
Hi On Tue, Feb 28, 2023 at 7:55 PM Eric Blake wrote: > On Tue, Feb 07, 2023 at 06:25:32PM +0400, marcandre.lur...@redhat.com > wrote: > > From: Marc-André Lureau > > > > The generated code doesn't quite handle the conditional arguments. > > For example, 'bar' in 'test-if-cmd' is not correctly s

Re: [PATCH v3 07/10] qapi: implement conditional command arguments

2023-02-28 Thread Eric Blake
On Wed, Feb 22, 2023 at 11:23:03AM +0100, Markus Armbruster wrote: > > However, I think it would be simpler, and better, if we piped the > > generated code to clang-format (when available). I made a simple patch > > for that too. > > Piping through indent or clang-format may well give us neater re

Re: [PATCH v3 07/10] qapi: implement conditional command arguments

2023-02-28 Thread Eric Blake
On Tue, Feb 07, 2023 at 06:25:32PM +0400, marcandre.lur...@redhat.com wrote: > From: Marc-André Lureau > > The generated code doesn't quite handle the conditional arguments. > For example, 'bar' in 'test-if-cmd' is not correctly surrounded by #if > conditions. See generated code in qmp_marshal_te

Re: [PATCH v3 07/10] qapi: implement conditional command arguments

2023-02-27 Thread Marc-André Lureau
Hi On Wed, Feb 22, 2023 at 2:29 PM Marc-André Lureau wrote: > > Hi > > On Wed, Feb 22, 2023 at 2:23 PM Markus Armbruster wrote: > > > Another option is to always pass a dummy last argument? :) > > > > > > void command(first, > > > #ifdef A > > > a, > > > #endif > > > #ifdef B > > > b, >

Re: [PATCH v3 07/10] qapi: implement conditional command arguments

2023-02-22 Thread Marc-André Lureau
Hi On Wed, Feb 22, 2023 at 2:23 PM Markus Armbruster wrote: > > Another option is to always pass a dummy last argument? :) > > > > void command(first, > > #ifdef A > > a, > > #endif > > #ifdef B > > b, > > #endif > > dummy) > > Yet another option: > > void command(first > #ifdef A

Re: [PATCH v3 07/10] qapi: implement conditional command arguments

2023-02-22 Thread Markus Armbruster
Marc-André Lureau writes: > Hi > > On Mon, Feb 20, 2023 at 12:10 PM Markus Armbruster wrote: >> >> Marc-André Lureau writes: >> >> > Hi Markus >> > >> > On Fri, Feb 17, 2023 at 12:28 PM Markus Armbruster >> > wrote: >> > >> >> marcandre.lur...@redhat.com writes: >> >> >> >> > From: Marc-André

Re: [PATCH v3 07/10] qapi: implement conditional command arguments

2023-02-22 Thread Marc-André Lureau
Hi On Mon, Feb 20, 2023 at 12:10 PM Markus Armbruster wrote: > > Marc-André Lureau writes: > > > Hi Markus > > > > On Fri, Feb 17, 2023 at 12:28 PM Markus Armbruster > > wrote: > > > >> marcandre.lur...@redhat.com writes: > >> > >> > From: Marc-André Lureau > >> > > >> > The generated code doe

Re: [PATCH v3 07/10] qapi: implement conditional command arguments

2023-02-20 Thread Markus Armbruster
Marc-André Lureau writes: > Hi Markus > > On Fri, Feb 17, 2023 at 12:28 PM Markus Armbruster > wrote: > >> marcandre.lur...@redhat.com writes: >> >> > From: Marc-André Lureau >> > >> > The generated code doesn't quite handle the conditional arguments. >> > For example, 'bar' in 'test-if-cmd' is

Re: [PATCH v3 07/10] qapi: implement conditional command arguments

2023-02-18 Thread Marc-André Lureau
Hi Markus On Fri, Feb 17, 2023 at 12:28 PM Markus Armbruster wrote: > marcandre.lur...@redhat.com writes: > > > From: Marc-André Lureau > > > > The generated code doesn't quite handle the conditional arguments. > > For example, 'bar' in 'test-if-cmd' is not correctly surrounded by #if > > condi

Re: [PATCH v3 07/10] qapi: implement conditional command arguments

2023-02-17 Thread Markus Armbruster
marcandre.lur...@redhat.com writes: > From: Marc-André Lureau > > The generated code doesn't quite handle the conditional arguments. > For example, 'bar' in 'test-if-cmd' is not correctly surrounded by #if > conditions. See generated code in qmp_marshal_test_if_cmd(). > > Note that if there are m

Re: [PATCH v3 07/10] qapi: implement conditional command arguments

2023-02-12 Thread Marc-André Lureau
Hi Markus On Thu, Feb 9, 2023 at 4:42 PM Markus Armbruster wrote: > marcandre.lur...@redhat.com writes: > > > From: Marc-André Lureau > > > > The generated code doesn't quite handle the conditional arguments. > > For example, 'bar' in 'test-if-cmd' is not correctly surrounded by #if > > conditi

Re: [PATCH v3 07/10] qapi: implement conditional command arguments

2023-02-09 Thread Markus Armbruster
marcandre.lur...@redhat.com writes: > From: Marc-André Lureau > > The generated code doesn't quite handle the conditional arguments. > For example, 'bar' in 'test-if-cmd' is not correctly surrounded by #if > conditions. See generated code in qmp_marshal_test_if_cmd(). > > Note that if there are m

[PATCH v3 07/10] qapi: implement conditional command arguments

2023-02-07 Thread marcandre . lureau
From: Marc-André Lureau The generated code doesn't quite handle the conditional arguments. For example, 'bar' in 'test-if-cmd' is not correctly surrounded by #if conditions. See generated code in qmp_marshal_test_if_cmd(). Note that if there are multiple optional arguments at the last position,