Am 14.08.2020 um 10:28 hat Philippe Mathieu-Daudé geschrieben: > As it is not obvious the default size for the null block driver > is 1 GiB, replace the obfuscated '1 << 30' magic value by a > definition using IEC binary prefixes. > > Signed-off-by: Philippe Mathieu-Daudé <f4...@amsat.org> > --- > block/null.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/block/null.c b/block/null.c > index 15e1d56746..8354def367 100644 > --- a/block/null.c > +++ b/block/null.c > @@ -11,6 +11,7 @@ > */ > > #include "qemu/osdep.h" > +#include "qemu/units.h" > #include "qapi/error.h" > #include "qapi/qmp/qdict.h" > #include "qapi/qmp/qstring.h" > @@ -21,6 +22,7 @@ > > #define NULL_OPT_LATENCY "latency-ns" > #define NULL_OPT_ZEROES "read-zeroes" > +#define NULL_OPT_SIZE (1 * GiB)
Let's use a different naming schema for option names and option default values, and an empty line between the definition for both. The way this patch has it, it looks like another option name until you look at the actual value. Kevin