2 ===================================================================
3 --- new.orig/vma.c 2014-11-20 08:47:30.000000000 +0100
4 +++ new/vma.c 2014-11-20 08:47:47.000000000 +0100
6 "usage: vma command [command options]\n"
8 "vma list <filename>\n"
9 + "vma config <filename> [-c config]\n"
10 "vma create <filename> [-c config] <archive> pathname ...\n"
11 "vma extract <filename> [-r <fifo>] <targetdir>\n"
12 "vma verify <filename> [-v]\n"
17 +static int dump_config(int argc, char **argv)
20 + const char *filename;
21 + const char *config_name = "qemu-server.conf";
24 + c = getopt(argc, argv, "hc:");
34 + config_name = optarg;
41 + /* Get the filename */
42 + if ((optind + 1) != argc) {
45 + filename = argv[optind++];
48 + VmaReader *vmar = vma_reader_create(filename, &errp);
51 + g_error("%s", error_get_pretty(errp));
55 + GList *l = vma_reader_get_config_data(vmar);
56 + while (l && l->data) {
57 + VmaConfigData *cdata = (VmaConfigData *)l->data;
59 + if (strcmp(cdata->name, config_name) == 0) {
61 + fwrite(cdata->data, cdata->len, 1, stdout);
66 + vma_reader_destroy(vmar);
71 + fprintf(stderr, "unable to find configuration data '%s'\n", config_name);
78 int main(int argc, char **argv)
82 return extract_content(argc, argv);
83 } else if (!strcmp(cmdname, "verify")) {
84 return verify_content(argc, argv);
85 + } else if (!strcmp(cmdname, "config")) {
86 + return dump_config(argc, argv);