mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
util: qemu: Allow for different approaches to format JSON arrays
For use with memory hotplug virQEMUBuildCommandLineJSONRecurse attempted to format JSON arrays as bitmap on the command line. Make the formatter function configurable so that it can be reused with different syntaxes of arrays such as numbered arrays for use with disk sources. This patch extracts the code and adds a parameter for the function that will allow to plug in different formatters.
This commit is contained in:
@@ -51,7 +51,8 @@ testQemuCommandBuildFromJSON(const void *opaque)
|
||||
virAsprintf(&expect, ",%s", data->expectprops) < 0)
|
||||
return -1;
|
||||
|
||||
if (virQEMUBuildCommandLineJSON(val, &buf) < 0) {
|
||||
if (virQEMUBuildCommandLineJSON(val, &buf,
|
||||
virQEMUBuildCommandLineJSONArrayBitmap) < 0) {
|
||||
fprintf(stderr,
|
||||
"\nvirQEMUBuildCommandlineJSON failed process JSON:\n%s\n",
|
||||
data->props);
|
||||
|
||||
Reference in New Issue
Block a user