Re: [PATCH 0/4] Introduce a battery, AC adapter, and lid button

2021-01-27 Thread Leonid Bloch
On Tue, Jan 26, 2021 at 4:40 PM Michael S. Tsirkin wrote: > > Poking at sysfs from QEMU poses a bunch of issues, for example, > security, migration, etc. Running timers on the host is also not nice > since it causes exits from VM ... > > So I agree, as a starting point let's just let user > contro

Re: [PATCH 0/4] Introduce a battery, AC adapter, and lid button

2021-01-20 Thread Leonid Bloch
Hi Phil, Thanks for your feedback! Please see below. On Wed, Jan 20, 2021 at 11:52 PM Philippe Mathieu-Daudé wrote: > > Hi Leonid, Marcel, > > On 1/20/21 9:54 PM, Leonid Bloch wrote: > > This series introduces the following ACPI devices: > > > > * Battery >

[PATCH 3/4] hw/acpi: Introduce the QEMU AC adapter

2021-01-20 Thread Leonid Bloch
ferent AC adapter needs to be probed, or even if a "fake" host AC adapter is to be provided, a 'sysfs_path' property allows to override the default one. Signed-off-by: Leonid Bloch --- MAINTAINERS | 5 + docs/specs/acad.txt | 24 ++

[PATCH 2/4] hw/acpi: Introduce the QEMU Battery

2021-01-20 Thread Leonid Bloch
y needs to be probed, or even if a "fake" host battery is to be provided, a 'sysfs_path' property allows to override the default one. Signed-off-by: Leonid Bloch Signed-off-by: Marcel Apfelbaum --- MAINTAINERS | 5 + docs/specs/battery.txt

[PATCH 4/4] hw/acpi: Introduce the QEMU lid button

2021-01-20 Thread Leonid Bloch
27;procfs_path' property allows to override the default path. Usage example (default values): '-device button' Is the same as: '-device button,procfs_path=/proc/acpi/button,probe_interval=2000' Signed-off-by: Leonid Bloch --- MAINTAINERS

[PATCH 1/4] hw/acpi: Increase the number of possible ACPI interrupts

2021-01-20 Thread Leonid Bloch
Increase the number of possible ACPI interrupts from 8, to the maximum available: 64 by default. Signed-off-by: Leonid Bloch --- hw/acpi/core.c | 17 +++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/hw/acpi/core.c b/hw/acpi/core.c index 7170bff657..71ba7c17b8

[PATCH 0/4] Introduce a battery, AC adapter, and lid button

2021-01-20 Thread Leonid Bloch
AC adapter plugging/unplugging behaves as expected. So is the laptop lid button. For the ease of review, these commits are also available here: https://github.com/blochl/qemu/pull/1/commits Thanks, Leonid. Leonid Bloch (4): hw/acpi: Increase the number of possible ACPI interrupts hw/acpi: Introd

[PATCH] configure: Do not ignore malloc value

2020-05-24 Thread Leonid Bloch
From: Leonid Bloch Not checking the value of malloc will cause a warning with GCC 10.1, which may result in configuration failure, with the following line in config.log: config-temp/qemu-conf.c:2:18: error: ignoring return value of ‘malloc’ declared with attribute ‘warn_unused_result’ [-Werror

Re: [Qemu-devel] [PATCH] qcow2: Fix the calculation of the maximum L2 cache size

2019-08-18 Thread Leonid Bloch
Thanks, Berto! On 8/16/19 3:17 PM, Alberto Garcia wrote: > The size of the qcow2 L2 cache defaults to 32 MB, which can be easily > larger than the maximum amount of L2 metadata that the image can have. > For example: with 64 KB clusters the user would need a qcow2 image > with a virtual size of 25

Re: [Qemu-devel] [PATCH 0/1] block: Eliminate the S_1KiB, S_2KiB, ... macros

2019-01-13 Thread Leonid Bloch
On 1/11/19 9:14 PM, Markus Armbruster wrote: > Back in September, Leonid Block added a whole bunch of macros (commit * Bloch. :) > 540b8492618) to improve readability of qcow2.h a bit (commit > b6a95c6d100). He later used them to fix the "vdi" driver's parameter > cluster_size's default value (c

Re: [Qemu-devel] [PATCH 1/1] block: Eliminate the S_1KiB, S_2KiB, ... macros

2019-01-13 Thread Leonid Bloch
Hi, On 1/11/19 9:14 PM, Markus Armbruster wrote: > We define 54 macros for the powers of two >= 1024. We use six, in six > macro definitions. Four of them could just as well use the common MiB > macro, so do that. The remaining two can't, because they get passed > to stringify. Replace the mac

Re: [Qemu-devel] [PATCH v3 1/6] qemu-option: Allow integer defaults

2019-01-11 Thread Leonid Bloch
On 1/11/19 6:23 PM, Eric Blake wrote: > On 1/11/19 8:14 AM, Leonid Bloch wrote: >> On 1/10/19 9:18 PM, Eric Blake wrote: >>> Set the framework up for declaring integer options with an integer >>> default, instead of our current insane approach of requiring the >>

Re: [Qemu-devel] [PATCH v3 1/6] qemu-option: Allow integer defaults

2019-01-11 Thread Leonid Bloch
On 1/10/19 9:18 PM, Eric Blake wrote: > Set the framework up for declaring integer options with an integer > default, instead of our current insane approach of requiring the > default value to be given as a string (which then has to be reparsed > at every use that wants a number). git grep '[^.]de

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 >>

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 fee

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 540b849

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 1/1] include: Auto-generate the sizes lookup table

2019-01-04 Thread Leonid Bloch
On 1/4/19 12:31 PM, Alberto Garcia wrote: > On Thu 03 Jan 2019 10:42:30 PM CET, Eric Blake wrote: > >> In my view, code generators make sense when used on code that is >> expected to change over time (a good example is QAPI because we add >> new commands every release; other places might be a gene

[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

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

2019-01-03 Thread Leonid Bloch
.h in the build directory. * The commit message mentions the commit which is partially reverted by the current commit. * Small changes in the comments of the generated header file. Leonid Bloch (1): include: Auto-generate the sizes lookup table .gitignore | 1 + Makefile

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

2019-01-03 Thread Leonid Bloch
Hi, On 1/4/19 12:04 AM, Eric Blake wrote: > On 1/3/19 2:57 PM, Leonid Bloch wrote: > >>> I have to say that I'm not very convinced of the benefits of replacing a >>> set of trivial numeric macros with a longer and harder to read shell >>> script acco

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

2019-01-03 Thread Leonid Bloch
Hi Phil, Thanks for your review! Very valid points. All taken, except the naming (I think "pow2_sizes.h" would be better than "lookup_table_sizes.h", no?) and the "generated" directory - I agree that it's a good idea, but I think it requires a separate patch which moves the generated files ther

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

2019-01-03 Thread Leonid Bloch
Hi Berto, On 1/3/19 12:19 PM, Alberto Garcia wrote: > On Wed 02 Jan 2019 12:09:05 PM CET, Leonid Bloch wrote: >> +print_sizes() { >> +local p=10 >> +while [ ${p} -lt 64 ] >> +do >> +local pad=' ' >> +local n=$((p %

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

2019-01-02 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. Signed-off-by: Leonid Bloch --- .gitignore | 1 + Makefile | 5 +++ block/qcow2.h| 2 +- block/vdi.c | 1 + include/qemu/units.h

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

2019-01-02 Thread Leonid Bloch
o Makefile here are "standard". Please correct me if that's not the case. Sorry it took so much time - I was busy with something completely different. Regards, Leonid. Leonid Bloch (1): include: Auto-generate the sizes lookup table .gitignore | 1 + Makefile

Re: [Qemu-devel] [PATCH v2 1/1] include: Add a comment to explain the origin of sizes' lookup table

2018-11-06 Thread Leonid Bloch
Hi Phil, Hi Eric, (Eric, for some reason you weren't CC'd to this thread - sorry.) On 11/5/18 5:58 PM, Philippe Mathieu-Daudé wrote: > Hi Leonid, > > On 4/11/18 19:07, Leonid Bloch wrote: >> The lookup table for power-of-two sizes was added in commit 540b8492618eb >

[Qemu-devel] [PATCH v2 1/1] vdi: Use a literal number of bytes for DEFAULT_CLUSTER_SIZE

2018-11-04 Thread Leonid Bloch
: Leonid Bloch --- block/vdi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/vdi.c b/block/vdi.c index 6555cffb88..d996793f1c 100644 --- a/block/vdi.c +++ b/block/vdi.c @@ -85,7 +85,7 @@ #define BLOCK_OPT_STATIC "static" #define SECTOR_SIZE 51

[Qemu-devel] [PATCH v2 0/1] vdi: Use a literal number of bytes for

2018-11-04 Thread Leonid Bloch
Please see the commit message for the rationale. Difference from v1: * Format string is fixed. Leonid Bloch (1): vdi: Use a literal number of bytes for DEFAULT_CLUSTER_SIZE block/vdi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.17.1

[Qemu-devel] [PATCH v2 1/1] include: Add a comment to explain the origin of sizes' lookup table

2018-11-04 Thread Leonid Bloch
t are correct (otherwise these values look as if they were typed manually). Signed-off-by: Leonid Bloch --- include/qemu/units.h | 18 ++ 1 file changed, 18 insertions(+) diff --git a/include/qemu/units.h b/include/qemu/units.h index 68a7758650..1c959d182e 100644 --- a/include/q

[Qemu-devel] [PATCH v2 0/1] include: Add a comment to explain the origin of

2018-11-04 Thread Leonid Bloch
Please see the commit message for the rationale. Difference from v1: * Tabs removed from the code indentation of the sample code in the comment, in order to pass checkpatch. Leonid Bloch (1): include: Add a comment to explain the origin of sizes' lookup table include/qemu/units.h

Re: [Qemu-devel] [PATCH] vdi: Use a literal number of bytes for DEFAULT_CLUSTER_SIZE

2018-11-04 Thread Leonid Bloch
> This changes the data type, so a fix is needed for a format string in > line 434. Yes, I saw, thanks! Will do. > > Regards > Stefan >

[Qemu-devel] [PATCH] vdi: Use a literal number of bytes for DEFAULT_CLUSTER_SIZE

2018-11-02 Thread Leonid Bloch
: Leonid Bloch --- block/vdi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/vdi.c b/block/vdi.c index 6555cffb88..25320eff47 100644 --- a/block/vdi.c +++ b/block/vdi.c @@ -85,7 +85,7 @@ #define BLOCK_OPT_STATIC "static" #define SECTOR_SIZE 51

[Qemu-devel] [PATCH] include: Add a comment to explain the origin of sizes' lookup table

2018-11-02 Thread Leonid Bloch
t are correct (otherwise these values look as if they were typed manually). Signed-off-by: Leonid Bloch --- include/qemu/units.h | 18 ++ 1 file changed, 18 insertions(+) diff --git a/include/qemu/units.h b/include/qemu/units.h index 68a7758650..051c274ca2 100644 --- a/include/q

Re: [Qemu-devel] [PATCH] qemu/units: Move out QCow2 specific definitions

2018-11-02 Thread Leonid Bloch
Hi, On 11/2/18 5:28 PM, Kevin Wolf wrote: > Am 02.11.2018 um 15:52 hat Eric Blake geschrieben: >> On 11/2/18 9:10 AM, Kevin Wolf wrote: >>> Am 02.11.2018 um 13:37 hat Philippe Mathieu-Daudé geschrieben: Hi Kevin, On 2/11/18 12:07, Kevin Wolf wrote: > Am 02.11.2018 um 09:58 hat P

Re: [Qemu-devel] [PATCH] qcow2: Fix cache-clean-interval documentation

2018-10-02 Thread Leonid Bloch
On 10/1/18 7:59 PM, Kevin Wolf wrote: > Am 01.10.2018 um 16:35 hat Eric Blake geschrieben: >> On 9/29/18 4:54 AM, Leonid Bloch wrote: >>> Fixing cache-clean-interval documentation following the recent change to >>> a default of 600 seconds on supported plar

[Qemu-devel] [PATCH] qcow2: Fix cache-clean-interval documentation

2018-09-29 Thread Leonid Bloch
Fixing cache-clean-interval documentation following the recent change to a default of 600 seconds on supported plarforms (only Linux currently). Signed-off-by: Leonid Bloch --- docs/qcow2-cache.txt | 19 +-- qapi/block-core.json | 3 ++- qemu-options.hx | 3 ++- 3 files

Re: [Qemu-devel] [PATCH v12 8/9] qcow2: Set the default cache-clean-interval to 10 minutes

2018-09-27 Thread Leonid Bloch
On September 27, 2018 5:53:34 PM CEST, Eric Blake wrote: >On 9/26/18 11:04 AM, Leonid Bloch wrote: >> The default cache-clean-interval is set to 10 minutes, in order to >lower >> the overhead of the qcow2 caches (before the default was 0, i.e. >> disabled). >> &g

[Qemu-devel] [PATCH v12 9/9] qcow2: Explicit number replaced by a constant

2018-09-26 Thread Leonid Bloch
Signed-off-by: Leonid Bloch Reviewed-by: Alberto Garcia Reviewed-by: Kevin Wolf --- block/qcow2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 95e1c98daa..7277feda13 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -1324,7 +1324,7

[Qemu-devel] [PATCH v12 5/9] qcow2: Assign the L2 cache relatively to the image size

2018-09-26 Thread Leonid Bloch
'l2-cache-size' option. This option was previously documented as the *maximum* L2 cache size, and this patch makes it behave as such, instead of as a constant size. Also, the existing option 'cache-size' can limit the sum of both L2 and refcount caches, as previously. Signed-off

[Qemu-devel] [PATCH v12 6/9] qcow2: Increase the default upper limit on the L2 cache size

2018-09-26 Thread Leonid Bloch
for images of up to 256 GB in size (was 8 GB). Note, that only the needed amount to cover the full image is allocated. The value which is changed here is just the upper limit on the L2 cache size, beyond which it will not grow, even if the size of the image will require it to. Signed-off-by: Leonid

[Qemu-devel] [PATCH v12 8/9] qcow2: Set the default cache-clean-interval to 10 minutes

2018-09-26 Thread Leonid Bloch
The default cache-clean-interval is set to 10 minutes, in order to lower the overhead of the qcow2 caches (before the default was 0, i.e. disabled). * For non-Linux platforms the default is kept at 0, because cache-clean-interval is not supported there yet. Signed-off-by: Leonid Bloch

[Qemu-devel] [PATCH v12 3/9] qcow2: Make sizes more humanly readable

2018-09-26 Thread Leonid Bloch
Signed-off-by: Leonid Bloch Reviewed-by: Alberto Garcia Reviewed-by: Kevin Wolf --- block/qcow2.c | 2 +- block/qcow2.h | 9 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index c13153735a..d2c07ce9fe 100644 --- a/block/qcow2.c +++ b

[Qemu-devel] [PATCH v12 4/9] qcow2: Avoid duplication in setting the refcount cache size

2018-09-26 Thread Leonid Bloch
The refcount cache size does not need to be set to its minimum value in read_cache_sizes(), as it is set to at least its minimum value in qcow2_update_options_prepare(). Signed-off-by: Leonid Bloch Reviewed-by: Alberto Garcia Reviewed-by: Kevin Wolf --- block/qcow2.c | 5 ++--- 1 file changed

[Qemu-devel] [PATCH v12 7/9] qcow2: Resize the cache upon image resizing

2018-09-26 Thread Leonid Bloch
The caches are now recalculated upon image resizing. This is done because the new default behavior of assigning L2 cache relatively to the image size, implies that the cache will be adapted accordingly after an image resize. Signed-off-by: Leonid Bloch Reviewed-by: Alberto Garcia --- block

[Qemu-devel] [PATCH v12 2/9] include: Add a lookup table of sizes

2018-09-26 Thread Leonid Bloch
*(i%10); pad=21-int(log(n)/log(10)); printf("#define S_%d%siB %*d\n", n, s, pad, val); } } Signed-off-by: Leonid Bloch Reviewed-by: Alberto Garcia Reviewed-by: Kevin Wolf --- include/qemu/units.h | 55 +++

[Qemu-devel] [PATCH v12 0/9] Take the image size into account when allocating the L2 cache

2018-09-26 Thread Leonid Bloch
t to 0 for non-Linux platforms in order to avoid an error, since the cache clean interval feature is currently available only on Linux. Differences from v10: * Rewording documentation. Differences from v11: * Memory leak fixed in "Resize the cache upon image resizing". Leonid Bl

[Qemu-devel] [PATCH v12 1/9] qcow2: Options' documentation fixes

2018-09-26 Thread Leonid Bloch
Signed-off-by: Leonid Bloch Reviewed-by: Alberto Garcia Reviewed-by: Kevin Wolf --- docs/qcow2-cache.txt | 21 ++--- qemu-options.hx | 9 ++--- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/docs/qcow2-cache.txt b/docs/qcow2-cache.txt index

Re: [Qemu-devel] [PATCH v11 7/9] qcow2: Resize the cache upon image resizing

2018-09-26 Thread Leonid Bloch
Oops, sorry. Would something like that be OK: On 9/26/18 1:55 PM, Alberto Garcia wrote: > On Wed 26 Sep 2018 12:43:03 PM CEST, Kevin Wolf wrote: >>> +/* Update cache sizes */ >>> +options = qdict_clone_shallow(bs->options); >>> +ret = qcow2_update_options(bs, options, s->flags, errp);

[Qemu-devel] [PATCH v11 0/9] Take the image size into account when allocating the L2 cache

2018-09-24 Thread Leonid Bloch
t to 0 for non-Linux platforms in order to avoid an error, since the cache clean interval feature is currently available only on Linux. Differences from v10: * Rewording documentation. Leonid Bloch (9): qcow2: Options' documentation fixes include: Add a lookup table of sizes qcow

Re: [Qemu-devel] [PATCH v10 1/9] qcow2: Options' documentation fixes

2018-09-24 Thread Leonid Bloch
On 9/24/18 10:34 PM, Max Reitz wrote: On 24.09.18 18:53, Leonid Bloch wrote: On 9/24/18 6:04 PM, Alberto Garcia wrote: On Fri 21 Sep 2018 07:23:02 PM CEST, Leonid Bloch wrote: Signed-off-by: Leonid Bloch --- docs/qcow2-cache.txt | 20 +--- qemu-options.hx | 9

[Qemu-devel] [PATCH v11 2/9] include: Add a lookup table of sizes

2018-09-24 Thread Leonid Bloch
*(i%10); pad=21-int(log(n)/log(10)); printf("#define S_%d%siB %*d\n", n, s, pad, val); } } Signed-off-by: Leonid Bloch Reviewed-by: Alberto Garcia --- include/qemu/units.h | 55 1 file changed, 55 i

[Qemu-devel] [PATCH v11 1/9] qcow2: Options' documentation fixes

2018-09-24 Thread Leonid Bloch
Signed-off-by: Leonid Bloch --- docs/qcow2-cache.txt | 21 ++--- qemu-options.hx | 9 ++--- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/docs/qcow2-cache.txt b/docs/qcow2-cache.txt index 8a09a5cc5f..7e28b41bd3 100644 --- a/docs/qcow2-cache.txt +++ b

[Qemu-devel] [PATCH v11 3/9] qcow2: Make sizes more humanly readable

2018-09-24 Thread Leonid Bloch
Signed-off-by: Leonid Bloch Reviewed-by: Alberto Garcia --- block/qcow2.c | 2 +- block/qcow2.h | 9 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index c13153735a..d2c07ce9fe 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -830,7

[Qemu-devel] [PATCH v11 4/9] qcow2: Avoid duplication in setting the refcount cache size

2018-09-24 Thread Leonid Bloch
The refcount cache size does not need to be set to its minimum value in read_cache_sizes(), as it is set to at least its minimum value in qcow2_update_options_prepare(). Signed-off-by: Leonid Bloch Reviewed-by: Alberto Garcia --- block/qcow2.c | 5 ++--- 1 file changed, 2 insertions(+), 3

[Qemu-devel] [PATCH v11 8/9] qcow2: Set the default cache-clean-interval to 10 minutes

2018-09-24 Thread Leonid Bloch
The default cache-clean-interval is set to 10 minutes, in order to lower the overhead of the qcow2 caches (before the default was 0, i.e. disabled). * For non-Linux platforms the default is kept at 0, because cache-clean-interval is not supported there yet. Signed-off-by: Leonid Bloch

[Qemu-devel] [PATCH v11 5/9] qcow2: Assign the L2 cache relatively to the image size

2018-09-24 Thread Leonid Bloch
'l2-cache-size' option. This option was previously documented as the *maximum* L2 cache size, and this patch makes it behave as such, instead of as a constant size. Also, the existing option 'cache-size' can limit the sum of both L2 and refcount caches, as previously. Signed-of

[Qemu-devel] [PATCH v11 6/9] qcow2: Increase the default upper limit on the L2 cache size

2018-09-24 Thread Leonid Bloch
for images of up to 256 GB in size (was 8 GB). Note, that only the needed amount to cover the full image is allocated. The value which is changed here is just the upper limit on the L2 cache size, beyond which it will not grow, even if the size of the image will require it to. Signed-off-by: Leonid

[Qemu-devel] [PATCH v11 9/9] qcow2: Explicit number replaced by a constant

2018-09-24 Thread Leonid Bloch
Signed-off-by: Leonid Bloch Reviewed-by: Alberto Garcia --- block/qcow2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 3c1859f9cc..983d4361d7 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -1324,7 +1324,7 @@ static int

[Qemu-devel] [PATCH v11 7/9] qcow2: Resize the cache upon image resizing

2018-09-24 Thread Leonid Bloch
The caches are now recalculated upon image resizing. This is done because the new default behavior of assigning L2 cache relatively to the image size, implies that the cache will be adapted accordingly after an image resize. Signed-off-by: Leonid Bloch Reviewed-by: Alberto Garcia --- block

Re: [Qemu-devel] [PATCH v10 3/9] qcow2: Make sizes more humanly readable

2018-09-24 Thread Leonid Bloch
On 9/24/18 7:59 PM, Eric Blake wrote: On 9/21/18 12:23 PM, Leonid Bloch wrote: Signed-off-by: Leonid Bloch Reviewed-by: Alberto Garcia ---   block/qcow2.c | 2 +-   block/qcow2.h | 9 +   2 files changed, 6 insertions(+), 5 deletions(-) +++ b/block/qcow2.h @@ -27,6 +27,7

Re: [Qemu-devel] [PATCH v10 1/9] qcow2: Options' documentation fixes

2018-09-24 Thread Leonid Bloch
On 9/24/18 6:04 PM, Alberto Garcia wrote: > On Fri 21 Sep 2018 07:23:02 PM CEST, Leonid Bloch wrote: >> Signed-off-by: Leonid Bloch >> --- >> docs/qcow2-cache.txt | 20 +--- >> qemu-options.hx | 9 ++--- >> 2 files change

Re: [Qemu-devel] [PATCH v10 2/9] include: Add a lookup table of sizes

2018-09-24 Thread Leonid Bloch
On 9/24/18 5:09 PM, Eric Blake wrote: > On 9/21/18 12:23 PM, Leonid Bloch wrote: >> Adding a lookup table for the powers of two, with the appropriate size >> prefixes. This is needed when a size has to be stringified, in which >> case something like '(1 * KiB)' w

[Qemu-devel] [PATCH v10 6/9] qcow2: Increase the default upper limit on the L2 cache size

2018-09-21 Thread Leonid Bloch
for images of up to 256 GB in size (was 8 GB). Note, that only the needed amount to cover the full image is allocated. The value which is changed here is just the upper limit on the L2 cache size, beyond which it will not grow, even if the size of the image will require it to. Signed-off-by: Leonid

[Qemu-devel] [PATCH v10 5/9] qcow2: Assign the L2 cache relatively to the image size

2018-09-21 Thread Leonid Bloch
'l2-cache-size' option. This option was previously documented as the *maximum* L2 cache size, and this patch makes it behave as such, instead of as a constant size. Also, the existing option 'cache-size' can limit the sum of both L2 and refcount caches, as previously. Signed-of

[Qemu-devel] [PATCH v10 4/9] qcow2: Avoid duplication in setting the refcount cache size

2018-09-21 Thread Leonid Bloch
The refcount cache size does not need to be set to its minimum value in read_cache_sizes(), as it is set to at least its minimum value in qcow2_update_options_prepare(). Signed-off-by: Leonid Bloch Reviewed-by: Alberto Garcia --- block/qcow2.c | 5 ++--- 1 file changed, 2 insertions(+), 3

[Qemu-devel] [PATCH v10 9/9] qcow2: Explicit number replaced by a constant

2018-09-21 Thread Leonid Bloch
Signed-off-by: Leonid Bloch Reviewed-by: Alberto Garcia --- block/qcow2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index f885afa0ed..ffb4a9e4a1 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -1324,7 +1324,7 @@ static int

[Qemu-devel] [PATCH v10 3/9] qcow2: Make sizes more humanly readable

2018-09-21 Thread Leonid Bloch
Signed-off-by: Leonid Bloch Reviewed-by: Alberto Garcia --- block/qcow2.c | 2 +- block/qcow2.h | 9 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index ec9e6238a0..67cc82f0b9 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -830,7

[Qemu-devel] [PATCH v10 1/9] qcow2: Options' documentation fixes

2018-09-21 Thread Leonid Bloch
Signed-off-by: Leonid Bloch --- docs/qcow2-cache.txt | 20 +--- qemu-options.hx | 9 ++--- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/docs/qcow2-cache.txt b/docs/qcow2-cache.txt index 8a09a5cc5f..013991e21c 100644 --- a/docs/qcow2-cache.txt +++ b

[Qemu-devel] [PATCH v10 8/9] qcow2: Set the default cache-clean-interval to 10 minutes

2018-09-21 Thread Leonid Bloch
The default cache-clean-interval is set to 10 minutes, in order to lower the overhead of the qcow2 caches (before the default was 0, i.e. disabled). * For non-Linux platforms the default is kept at 0, because cache-clean-interval is not supported there yet. Signed-off-by: Leonid Bloch

[Qemu-devel] [PATCH v10 2/9] include: Add a lookup table of sizes

2018-09-21 Thread Leonid Bloch
*(i%10); pad=21-int(log(n)/log(10)); printf("#define S_%d%siB %*d\n", n, s, pad, val); } } Signed-off-by: Leonid Bloch --- include/qemu/units.h | 55 1 file changed, 55 insertions(+) diff --git a/

[Qemu-devel] [PATCH v10 7/9] qcow2: Resize the cache upon image resizing

2018-09-21 Thread Leonid Bloch
The caches are now recalculated upon image resizing. This is done because the new default behavior of assigning L2 cache relatively to the image size, implies that the cache will be adapted accordingly after an image resize. Signed-off-by: Leonid Bloch Reviewed-by: Alberto Garcia --- block

[Qemu-devel] [PATCH v10 0/9] Take the image size into account when allocating the L2 cache

2018-09-21 Thread Leonid Bloch
t to 0 for non-Linux platforms in order to avoid an error, since the cache clean interval feature is currently available only on Linux. Leonid Bloch (9): qcow2: Options' documentation fixes include: Add a lookup table of sizes qcow2: Make sizes more humanly readable qcow2: Avoid

Re: [Qemu-devel] [PATCH v9 8/9] qcow2: Set the default cache-clean-interval to 10 minutes

2018-09-21 Thread Leonid Bloch
On 9/21/18 3:35 PM, Alberto Garcia wrote: On Tue 18 Sep 2018 05:29:22 PM CEST, Leonid Bloch wrote: /* New interval for cache cleanup timer */ r->cache_clean_interval = qemu_opt_get_number(opts, QCOW2_OPT_CACHE_CLEAN_INTERVAL, -

Re: [Qemu-devel] [PATCH v9 2/9] include: Add a lookup table of sizes

2018-09-21 Thread Leonid Bloch
On 9/21/18 3:17 PM, Alberto Garcia wrote: On Tue 18 Sep 2018 05:29:16 PM CEST, Leonid Bloch wrote: Adding a lookup table for the powers of two, with the appropriate size prefixes. This is needed when a size has to be stringified, in which case something like '(1 * KiB)' would become

[Qemu-devel] [PATCH v9 5/9] qcow2: Assign the L2 cache relatively to the image size

2018-09-18 Thread Leonid Bloch
'l2-cache-size' option. This option was previously documented as the *maximum* L2 cache size, and this patch makes it behave as such, instead of as a constant size. Also, the existing option 'cache-size' can limit the sum of both L2 and refcount caches, as previously. Signed-of

[Qemu-devel] [PATCH v9 3/9] qcow2: Make sizes more humanly readable

2018-09-18 Thread Leonid Bloch
Signed-off-by: Leonid Bloch Reviewed-by: Alberto Garcia --- block/qcow2.c | 2 +- block/qcow2.h | 9 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index ec9e6238a0..67cc82f0b9 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -830,7

[Qemu-devel] [PATCH v9 8/9] qcow2: Set the default cache-clean-interval to 10 minutes

2018-09-18 Thread Leonid Bloch
The default cache-clean-interval is set to 10 minutes, in order to lower the overhead of the qcow2 caches (before the default was 0, i.e. disabled). Signed-off-by: Leonid Bloch Reviewed-by: Alberto Garcia --- block/qcow2.c| 2 +- block/qcow2.h| 1 + docs/qcow2-cache.txt | 4

[Qemu-devel] [PATCH v9 4/9] qcow2: Avoid duplication in setting the refcount cache size

2018-09-18 Thread Leonid Bloch
The refcount cache size does not need to be set to its minimum value in read_cache_sizes(), as it is set to at least its minimum value in qcow2_update_options_prepare(). Signed-off-by: Leonid Bloch Reviewed-by: Alberto Garcia --- block/qcow2.c | 5 ++--- 1 file changed, 2 insertions(+), 3

[Qemu-devel] [PATCH v9 9/9] qcow2: Explicit number replaced by a constant

2018-09-18 Thread Leonid Bloch
Signed-off-by: Leonid Bloch Reviewed-by: Alberto Garcia --- block/qcow2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index f885afa0ed..ffb4a9e4a1 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -1324,7 +1324,7 @@ static int

[Qemu-devel] [PATCH v9 1/9] qcow2: Options' documentation fixes

2018-09-18 Thread Leonid Bloch
Signed-off-by: Leonid Bloch --- docs/qcow2-cache.txt | 20 +--- qemu-options.hx | 9 ++--- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/docs/qcow2-cache.txt b/docs/qcow2-cache.txt index 8a09a5cc5f..013991e21c 100644 --- a/docs/qcow2-cache.txt +++ b

[Qemu-devel] [PATCH v9 2/9] include: Add a lookup table of sizes

2018-09-18 Thread Leonid Bloch
*(i%10); pad=21-int(log(n)/log(10)); printf("#define S_%d%siB %*d\n", n, s, pad, val); } } Signed-off-by: Leonid Bloch --- include/qemu/units.h | 55 1 file changed, 55 insertions(+) diff --git a/

[Qemu-devel] [PATCH v9 6/9] qcow2: Increase the default upper limit on the L2 cache size

2018-09-18 Thread Leonid Bloch
for images of up to 256 GB in size (was 8 GB). Note, that only the needed amount to cover the full image is allocated. The value which is changed here is just the upper limit on the L2 cache size, beyond which it will not grow, even if the size of the image will require it to. Signed-off-by: Leonid

[Qemu-devel] [PATCH v9 7/9] qcow2: Resize the cache upon image resizing

2018-09-18 Thread Leonid Bloch
The caches are now recalculated upon image resizing. This is done because the new default behavior of assigning L2 cache relatively to the image size, implies that the cache will be adapted accordingly after an image resize. Signed-off-by: Leonid Bloch Reviewed-by: Alberto Garcia --- block

[Qemu-devel] [PATCH v9 0/9] Take the image size into account when allocating the L2 cache

2018-09-18 Thread Leonid Bloch
o large L2 cache size. * Minor documentation fixes. Leonid Bloch (9): qcow2: Options' documentation fixes include: Add a lookup table of sizes qcow2: Make sizes more humanly readable qcow2: Avoid duplication in setting the refcount cache size qcow2: Assign the L2 cache relatively to the image

Re: [Qemu-devel] [PATCH v8 0/8] Take the image size into account when allocating the L2 cache

2018-09-12 Thread Leonid Bloch
8 um 03:07 hat Leonid Bloch geschrieben: This series makes the qcow2 L2 cache assignment aware of the image size, with the intention for it to cover the entire image. The importance of this change is in noticeable performance improvement, especially with heavy random I/O. The memory overhead is not

Re: [Qemu-devel] [PATCH v7 6/9] qcow2: Increase the default upper limit on the L2 cache size

2018-08-14 Thread Leonid Bloch
On 8/14/18 2:44 PM, Kevin Wolf wrote: Am 14.08.2018 um 13:34 hat Leonid Bloch geschrieben: On 8/14/18 11:18 AM, Kevin Wolf wrote: Am 13.08.2018 um 18:42 hat Leonid Bloch geschrieben: I don't actually think it's so bad to keep the cache permanently allocated, but I wouldn't ob

Re: [Qemu-devel] [PATCH v7 6/9] qcow2: Increase the default upper limit on the L2 cache size

2018-08-14 Thread Leonid Bloch
On 8/14/18 11:18 AM, Kevin Wolf wrote: Am 13.08.2018 um 18:42 hat Leonid Bloch geschrieben: I don't actually think it's so bad to keep the cache permanently allocated, but I wouldn't object to a lower default for non-Linux hosts either. 1 MB may still be a little too low, 4 MB (

Re: [Qemu-devel] [PATCH v7 6/9] qcow2: Increase the default upper limit on the L2 cache size

2018-08-13 Thread Leonid Bloch
I don't actually think it's so bad to keep the cache permanently allocated, but I wouldn't object to a lower default for non-Linux hosts either. 1 MB may still be a little too low, 4 MB (covers up to 32 GB) might be more adequate. My typical desktop VMs are larger than 8 GB, but smaller than 32 GB

Re: [Qemu-devel] [PATCH v7 5/9] qcow2: Assign the L2 cache relatively to the image size

2018-08-13 Thread Leonid Bloch
On 8/13/18 2:33 PM, Kevin Wolf wrote: Am 11.08.2018 um 21:19 hat Leonid Bloch geschrieben: @item refcount-cache-size The maximum size of the refcount block cache in bytes diff --git a/tests/qemu-iotests/137 b/tests/qemu-iotests/137 index 87965625d8..e3fb078588 100755 --- a/tests/qemu

Re: [Qemu-devel] [PATCH v7 6/9] qcow2: Increase the default upper limit on the L2 cache size

2018-08-12 Thread Leonid Bloch
On August 13, 2018 4:39:35 AM EEST, Max Reitz wrote: >On 2018-08-10 14:00, Alberto Garcia wrote: >> On Fri 10 Aug 2018 08:26:44 AM CEST, Leonid Bloch wrote: >>> The upper limit on the L2 cache size is increased from 1 MB to 32 >MB. >>> This is done in order to al

[Qemu-devel] [PATCH v8 1/8] qcow2: Options' documentation fixes

2018-08-12 Thread Leonid Bloch
Signed-off-by: Leonid Bloch --- docs/qcow2-cache.txt | 20 +--- qemu-options.hx | 9 ++--- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/docs/qcow2-cache.txt b/docs/qcow2-cache.txt index 8a09a5cc5f..2326db01b9 100644 --- a/docs/qcow2-cache.txt +++ b

[Qemu-devel] [PATCH v8 7/8] qcow2: Set the default cache-clean-interval to 10 minutes

2018-08-12 Thread Leonid Bloch
The default cache-clean-interval is set to 10 minutes, in order to lower the overhead of the qcow2 caches (before the default was 0, i.e. disabled). Signed-off-by: Leonid Bloch Reviewed-by: Alberto Garcia --- block/qcow2.c| 2 +- block/qcow2.h| 1 + docs/qcow2-cache.txt | 4

[Qemu-devel] [PATCH v8 5/8] qcow2: Increase the default upper limit on the L2 cache size

2018-08-12 Thread Leonid Bloch
just the upper limit on the L2 cache size, beyond which it will not grow, even if the size of the image will require it to. Signed-off-by: Leonid Bloch Reviewed-by: Alberto Garcia --- block/qcow2.h| 2 +- docs/qcow2-cache.txt | 4 ++-- qemu-options.hx | 2 +- 3 files changed, 4

[Qemu-devel] [PATCH v8 2/8] qcow2: Make sizes more humanly readable

2018-08-12 Thread Leonid Bloch
Signed-off-by: Leonid Bloch Reviewed-by: Alberto Garcia --- block/qcow2.c | 2 +- block/qcow2.h | 9 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index ec9e6238a0..67cc82f0b9 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -830,7

[Qemu-devel] [PATCH v8 6/8] qcow2: Resize the cache upon image resizing

2018-08-12 Thread Leonid Bloch
The caches are now recalculated upon image resizing. This is done because the new default behavior of assigning L2 cache relatively to the image size, implies that the cache will be adapted accordingly after an image resize. Signed-off-by: Leonid Bloch Reviewed-by: Alberto Garcia --- block

[Qemu-devel] [PATCH v8 4/8] qcow2: Assign the L2 cache relatively to the image size

2018-08-12 Thread Leonid Bloch
'l2-cache-size' option. This option was previously documented as the *maximum* L2 cache size, and this patch makes it behave as such, instead of as a constant size. Also, the existing option 'cache-size' can limit the sum of both L2 and refcount caches, as previously. Signed-of

[Qemu-devel] [PATCH v8 0/8] Take the image size into account when allocating the L2 cache

2018-08-12 Thread Leonid Bloch
specified and is large enough, with the L2 and refcount caches not set, the L2 cache will be as large as needed to cover the entire image, and not as the default max. size. (Return to the previous behavior in this part, which was correct). * Cosmetic changes patch not used. Leon

[Qemu-devel] [PATCH v8 8/8] qcow2: Explicit number replaced by a constant

2018-08-12 Thread Leonid Bloch
Signed-off-by: Leonid Bloch Reviewed-by: Alberto Garcia --- block/qcow2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index f885afa0ed..ffb4a9e4a1 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -1324,7 +1324,7 @@ static int

[Qemu-devel] [PATCH v8 3/8] qcow2: Avoid duplication in setting the refcount cache size

2018-08-12 Thread Leonid Bloch
The refcount cache size does not need to be set to its minimum value in read_cache_sizes(), as it is set to at least its minimum value in qcow2_update_options_prepare(). Signed-off-by: Leonid Bloch --- block/qcow2.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/block

Re: [Qemu-devel] [PATCH v7 5/9] qcow2: Assign the L2 cache relatively to the image size

2018-08-11 Thread Leonid Bloch
On 8/10/18 5:39 PM, Alberto Garcia wrote: On Fri 10 Aug 2018 08:26:43 AM CEST, Leonid Bloch wrote: Previously, the L2 cache was allocated without considering the image size, and an option existed to manually determine its size. This is not quite correct: the L2 cache was set to the maximum

  1   2   3   4   >