qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [Qemu-devel] [PATCH] qemu/units: Move out QCow2 specifi


From: Eric Blake
Subject: Re: [Qemu-block] [Qemu-devel] [PATCH] qemu/units: Move out QCow2 specific definitions
Date: Fri, 2 Nov 2018 09:52:25 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1

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 Philippe Mathieu-Daudé geschrieben:
This definitions are QCow2 specific, there is no need to expose them
in the global namespace.

This partially reverts commit 540b8492618eb.

Signed-off-by: Philippe Mathieu-Daudé <address@hidden>

If we don't want this globally, I think we also don't want it in qcow2.

Agreed. I didn't want it in the first place, arguing that if we want stringification of defaults, it would be better to have a runtime function do that, rather than adding a set of near-duplicate macro names.


I only see this definitions used by block/qcow2.h (b6a95c6d1007).

Per 540b8492618eb description "This is needed when a size has to be
stringified" but I can't find other code requiring these definitions in the
codebase.

I guess the real question is: Is qcow2 the only place that needs
stringification of sizes?

Probably not. It seems like stringifying a default value is a common desire.


The only value where this actually seems to be used in qcow2 is for
DEFAULT_CLUSTER_SIZE, as the default value for QemuOpts. Other drivers
still use plain numbers, but this is less readable.

Then there is VDI which uses (1 * MiB), but that is compiled out and if
you enable it, it breaks. So it needs the same fix.

Are block drivers the only places where we stringify a size? I imagine
some device models might use something like it, too?

Indeed, I would prefer a patch that makes it possible for QemuOpts to pretty-print a default value using a generic runtime stringifier, rather than keeping these S_ macros around.


I don't mind too much which solution we end up using, but I'd prefer it
to be universal.

Agree.

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]