Re: [PATCH 17/22] qemu: Use virTypedParamList in the bulk stats gathering functions

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

 



On Thu, Sep 19, 2019 at 07:13:20PM +0200, Peter Krempa wrote:
The bulk stats functions are specific as they pass around the list into
many sub-functions and also a substantial amount of the entries uses
formatted names for indexing purposes. This makes them ideal to be
converted to the new virTypedParamList helpers.

Unfortunately given how the functions are used this requires a big-bang
rewrite of all of the calls to add entries to the parameter list.

Given that a substantial simplification is achieved as well as a prety

pretty

significant change to the original code is required some macros which
were used only sporradically were replaced by inline calls rather than

sporadically

tweaking the macros first and deleting them later.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
src/qemu/qemu_driver.c | 472 ++++++++++++-----------------------------
1 file changed, 139 insertions(+), 333 deletions(-)


[...]

-#define QEMU_ADD_BLOCK_PARAM_UI(record, maxparams, num, name, value) \

Now I see where those short type names came from.

-    do { \
-        char param_name[VIR_TYPED_PARAM_FIELD_LENGTH]; \
-        snprintf(param_name, VIR_TYPED_PARAM_FIELD_LENGTH, \
-                 "block.%zu.%s", num, name); \
-        if (virTypedParamsAddUInt(&(record)->params, \
-                                  &(record)->nparams, \
-                                  maxparams, \
-                                  param_name, \
-                                  value) < 0) \
-            goto cleanup; \
-    } while (0)
-

Reviewed-by: Ján Tomko <jtomko@xxxxxxxxxx>

Jano

Attachment: signature.asc
Description: PGP signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux