tools/helpers: make gen_stub_json_config accept an UUID argument

If that's set, the stub is going to contain that UUID.

No functional change.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
This commit is contained in:
Wei Liu committed 2018-11-20 14:43:39 +00:00
1 parent cb278ebdb8
commit 0a1eb2b438
4 files changed
+8 -4

No files matched your search

+4 -1
View File
@@ -7,7 +7,7 @@
#include <xenctrl.h>
#include <libxl.h>
int gen_stub_json_config(uint32_t domid)
int gen_stub_json_config(uint32_t domid, libxl_uuid *uuid)
{
int rc = 1;
xentoollog_logger_stdiostream *logger;
@@ -40,6 +40,9 @@ int gen_stub_json_config(uint32_t domid)
libxl_domain_build_info_init_type(&dom_config.b_info,
dom_config.c_info.type);
if (uuid && !libxl_uuid_is_nil(uuid))
libxl_uuid_copy(ctx, &dom_config.c_info.uuid, uuid);
json = libxl_domain_config_to_json(ctx, &dom_config);
/* libxl-json format requires the string ends with '\0'. Code
* snippet taken from libxl.
+2 -1
View File
@@ -1,10 +1,11 @@
#ifndef __INIT_DOM_JSON_H
#define __INIT_DOM_JSON_H
#include <libxl.h>
/*
* Generate a stub JSON config for a domain with the given domid.
*/
int gen_stub_json_config(uint32_t domid);
int gen_stub_json_config(uint32_t domid, libxl_uuid *uuid);
#endif
/*
+1 -1
View File
@@ -382,7 +382,7 @@ int main(int argc, char** argv)
if ( rv )
return 1;
rv = gen_stub_json_config(domid);
rv = gen_stub_json_config(domid, NULL);
if ( rv )
return 3;
+1 -1
View File
@@ -31,7 +31,7 @@ int main(int argc, char **argv)
goto out;
}
rc = gen_stub_json_config(0);
rc = gen_stub_json_config(0, NULL);
if (rc)
goto out;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.