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:#define DEFAULT_L2_CACHE_MAX_SIZE S_8MiB >>> block/qcow2.h:#define DEFAULT_CLUSTER_SIZE S_64KiB >>> block/vdi.c:#define DEFAULT_CLUSTER_SIZE S_1MiB >>> >>> Which if them truly need stringify-able integers? >>> >> >> These two: >> >> block/qcow2.h:#define DEFAULT_CLUSTER_SIZE >> block/vdi.c:#define DEFAULT_CLUSTER_SIZE. > > Compared to the complexity visible in this thread, > > .def_value_str = "65536", /* must match DEFAULT_CLUSTER_SIZE */ > > looks attractively stupid to me then.
In general, .def_value_str = stringify(...) looks odd, compared to my v3 patch that lets us do .def_value_int = DEFAULT_CLUSTER_SIZE; my patch also has the benefit that if DEFAULT_CLUSTER_SIZE changes value, we don't have to remember to update the string. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature