From: Euan Harris Date: Fri, 19 Jun 2015 10:42:26 +0000 (+0000) Subject: Remove xlu_test.c X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=1595cafe09c30a3a67f4291228cbade1630aedf9;p=people%2Fiwj%2Fring3-xl-test.git Remove xlu_test.c This was an experiment with the XLU config parsing routines Signed-off-by: Euan Harris --- diff --git a/xlu_test.c b/xlu_test.c deleted file mode 100644 index 5d7f991..0000000 --- a/xlu_test.c +++ /dev/null @@ -1,83 +0,0 @@ -/* -gcc -Wall -Werror -Wextra -pedantic -g -lxenlight -lxlutil xlu_test.c -o xlu_test -*/ - -#include -#include -#include -#include -#include - -#include -#include -#include - -#include - -#include -#include - -void disk_test(XLU_Config * config, const char *spec) -{ - libxl_device_disk disk; - libxl_device_disk_init(&disk); - xlu_disk_parse(config, 1, &spec, &disk); -} - -int main(int argc, char **argv) -{ - int err; - XLU_Config *config; - XLU_ConfigList *config_list; - int count; - - FILE *report; - char *report_filename = "/tmp/xlu.out"; - const char *response; - - if (argc != 2) { - fprintf(stderr, "%s: no config file provided\n", argv[0]); - exit(-1); - } - - report = fopen(report_filename, "w+"); - - config = xlu_cfg_init(report, report_filename); - if (!config) { - perror("xlu_cfg_init"); - exit(-1); - } - - err = xlu_cfg_readfile(config, argv[1]); - if (err != 0) { - perror("xlu_cfg_readfile"); - exit(-1); - } - - err = xlu_cfg_get_string(config, "name", &response, 1); - if (err != 0) { - perror("xlu_cfg_get_string"); - exit(-1); - } - printf("name: %s\n", response); - - err = xlu_cfg_get_string(config, "kernel", &response, 1); - if (err != 0) { - perror("xlu_cfg_get_string"); - exit(-1); - } - printf("kernel: %s\n", response); - - err = xlu_cfg_get_list(config, "disk", &config_list, &count, 1); - if (err != 0) { - perror("xlu_cfg_get_string"); - exit(-1); - } - printf("disk: %d items\n", count); - - disk_test(config, - "qcow2:/root/Fedora-Cloud-Base-22-20150521.x86_64.qcow2,xvda,w"); - disk_test(config, "file:/root/init.iso,xvdb:cdrom,r"); - xlu_cfg_destroy(config); - exit(0); -}