Re: [Qemu-devel] [PATCH v2 1/1] include: Auto-generate the sizes lookup table

2019-01-11 Thread Eric Blake
On 1/11/19 1:50 AM, Markus Armbruster wrote: >>> We have 54 of them. I count six uses: >>> >>> block/qcow2.h:#define QCOW_MAX_REFTABLE_SIZE S_8MiB >>> block/qcow2.h:#define QCOW_MAX_L1_SIZE S_32MiB >>> block/qcow2.h:#define DEFAULT_L2_CACHE_MAX_SIZE S_32MiB >>> block/qcow2.h:#

Re: [Qemu-devel] [PATCH v2 1/1] include: Auto-generate the sizes lookup table

2019-01-10 Thread Markus Armbruster
Leonid Bloch writes: > On 1/10/19 2:51 PM, wrote: >> Leonid Bloch writes: >> >>> Hi, >>> >>> On 1/8/19 2:20 PM, Kevin Wolf wrote: Am 03.01.2019 um 22:33 hat Leonid Bloch geschrieben: > The lookup table for power-of-two sizes is now auto-generated during the > build, and not hard-c

Re: [Qemu-devel] [PATCH v2 1/1] include: Auto-generate the sizes lookup table

2019-01-10 Thread Eric Blake
On 1/10/19 7:33 AM, Eric Blake wrote: >> Eric - thanks for the comment about 'local' - I will get rid of it if we >> decide to include this patch. > > I'm still not convinced we need it. I would much rather see a patch > that makes QemuOpt accept default integer values as integers rather than >

Re: [Qemu-devel] [PATCH v2 1/1] include: Auto-generate the sizes lookup table

2019-01-10 Thread Markus Armbruster
Leonid Bloch writes: > On 1/10/19 2:40 PM, Markus Armbruster wrote: >> Leonid Bloch writes: >> >>> Hi, >>> >>> On 1/8/19 11:31 AM, Markus Armbruster wrote: I'd leave it hard-coded. Replacing a few trivial defines by an arguably less trivial script doesn't feel like an improvement. I

Re: [Qemu-devel] [PATCH v2 1/1] include: Auto-generate the sizes lookup table

2019-01-10 Thread Leonid Bloch
On 1/10/19 2:51 PM, wrote: > Leonid Bloch writes: > >> Hi, >> >> On 1/8/19 2:20 PM, Kevin Wolf wrote: >>> Am 03.01.2019 um 22:33 hat Leonid Bloch geschrieben: The lookup table for power-of-two sizes is now auto-generated during the build, and not hard-coded into the units.h file.

Re: [Qemu-devel] [PATCH v2 1/1] include: Auto-generate the sizes lookup table

2019-01-10 Thread Leonid Bloch
On 1/10/19 2:40 PM, Markus Armbruster wrote: > Leonid Bloch writes: > >> Hi, >> >> On 1/8/19 11:31 AM, Markus Armbruster wrote: >>> I'd leave it hard-coded. Replacing a few trivial defines by an arguably >>> less trivial script doesn't feel like an improvement. In this case, it >>> doesn't even

Re: [Qemu-devel] [PATCH v2 1/1] include: Auto-generate the sizes lookup table

2019-01-10 Thread Eric Blake
On 1/10/19 3:42 AM, Leonid Bloch wrote: > If you've noticed, the original script was in AWK. But to be as generic > as possible, I didn't write the generation script in AWK because even > AWK is not guaranteed to be installed on the build system. The only > interpreted language that is guarante

Re: [Qemu-devel] [PATCH v2 1/1] include: Auto-generate the sizes lookup table

2019-01-10 Thread Alberto Garcia
On Tue 08 Jan 2019 01:20:21 PM CET, Kevin Wolf wrote: > During a downstream review, Max found a problem with the table that we > could fix while we're touching it: > > Upstream: All >= S_2GiB are not valid ints. (qemu assumes that > sizeof(int) == 4, right?) So S_2GiB should be 2147483648

Re: [Qemu-devel] [PATCH v2 1/1] include: Auto-generate the sizes lookup table

2019-01-10 Thread Markus Armbruster
Leonid Bloch writes: > Hi, > > On 1/8/19 2:20 PM, Kevin Wolf wrote: >> Am 03.01.2019 um 22:33 hat Leonid Bloch geschrieben: >>> The lookup table for power-of-two sizes is now auto-generated during the >>> build, and not hard-coded into the units.h file. >>> >>> This partially reverts commit 540b8

Re: [Qemu-devel] [PATCH v2 1/1] include: Auto-generate the sizes lookup table

2019-01-10 Thread Markus Armbruster
Leonid Bloch writes: > Hi, > > On 1/8/19 11:31 AM, Markus Armbruster wrote: >> I'd leave it hard-coded. Replacing a few trivial defines by an arguably >> less trivial script doesn't feel like an improvement. In this case, it >> doesn't even save lines. > > As I've said, I'm fine with that. The

Re: [Qemu-devel] [PATCH v2 1/1] include: Auto-generate the sizes lookup table

2019-01-10 Thread Leonid Bloch
Hi, On 1/8/19 2:20 PM, Kevin Wolf wrote: > Am 03.01.2019 um 22:33 hat Leonid Bloch geschrieben: >> The lookup table for power-of-two sizes is now auto-generated during the >> build, and not hard-coded into the units.h file. >> >> This partially reverts commit 540b8492618eb. >> >> Signed-off-by: Le

Re: [Qemu-devel] [PATCH v2 1/1] include: Auto-generate the sizes lookup table

2019-01-10 Thread Leonid Bloch
Hi, On 1/8/19 11:31 AM, Markus Armbruster wrote: > I'd leave it hard-coded. Replacing a few trivial defines by an arguably > less trivial script doesn't feel like an improvement. In this case, it > doesn't even save lines. As I've said, I'm fine with that. The autogeneration sounds the right t

Re: [Qemu-devel] [PATCH v2 1/1] include: Auto-generate the sizes lookup table

2019-01-08 Thread Eric Blake
On 1/8/19 3:31 AM, Markus Armbruster wrote: > Copying our resident shell script guru Eric. Who already expressed a desire to keep things hard-coded on v1 ;) And I've also already expressed a dislike for the entire S_XXXiB macro list, thinking that a nicer solution would instead be teaching QemuOp

Re: [Qemu-devel] [PATCH v2 1/1] include: Auto-generate the sizes lookup table

2019-01-08 Thread Kevin Wolf
Am 03.01.2019 um 22:33 hat Leonid Bloch geschrieben: > The lookup table for power-of-two sizes is now auto-generated during the > build, and not hard-coded into the units.h file. > > This partially reverts commit 540b8492618eb. > > Signed-off-by: Leonid Bloch During a downstream review, Max fou

Re: [Qemu-devel] [PATCH v2 1/1] include: Auto-generate the sizes lookup table

2019-01-08 Thread Markus Armbruster
Copying our resident shell script guru Eric. Leonid Bloch writes: > The lookup table for power-of-two sizes is now auto-generated during the > build, and not hard-coded into the units.h file. > > This partially reverts commit 540b8492618eb. > > Signed-off-by: Leonid Bloch > --- > .gitignore

[Qemu-devel] [PATCH v2 1/1] include: Auto-generate the sizes lookup table

2019-01-03 Thread Leonid Bloch
The lookup table for power-of-two sizes is now auto-generated during the build, and not hard-coded into the units.h file. This partially reverts commit 540b8492618eb. Signed-off-by: Leonid Bloch --- .gitignore | 1 + Makefile | 5 +++ block/qcow2.h| 2 +- block/