debuggers.hg

view tools/libxl/libxlu_internal.h @ 22855:1d1eec7e1fb4

xl: Perform minimal validation of virtual disk file while parsing config file

This patch performs some very basic validation on the virtual disk
file passed through the config file. This validation ensures that we
don't go too far with the initialization like spawn qemu and more
while there could be some potentially fundamental issues.

[ Patch fixed up to work with PHYSTYPE_EMPTY 22808:6ec61438713a -iwj ]

Signed-off-by: Kamala Narasimhan <kamala.narasimhan@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
author Kamala Narasimhan <kamala.narasimhan@gmail.com>
date Tue Jan 25 18:09:49 2011 +0000 (2011-01-25)
parents cb94dbe20f97
children
line source
1 /*
2 * Copyright (C) 2010 Citrix Ltd.
3 * Author Ian Jackson <ian.jackson@eu.citrix.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as published
7 * by the Free Software Foundation; version 2.1 only. with the special
8 * exception on linking described in file LICENSE.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 */
16 #ifndef LIBXLU_INTERNAL_H
17 #define LIBXLU_INTERNAL_H
19 #include <stdio.h>
20 #include <errno.h>
21 #include <string.h>
22 #include <assert.h>
24 #define XLU_ConfigList XLU_ConfigSetting
26 #include "libxlutil.h"
28 struct XLU_ConfigSetting { /* transparent */
29 struct XLU_ConfigSetting *next;
30 char *name;
31 int nvalues, avalues; /* lists have avalues>1 */
32 char **values;
33 int lineno;
34 };
36 struct XLU_Config {
37 XLU_ConfigSetting *settings;
38 FILE *report;
39 char *filename;
40 };
42 typedef struct {
43 XLU_Config *cfg;
44 int err, lexerrlineno, likely_python;
45 void *scanner;
46 } CfgParseContext;
48 #endif /*LIBXLU_INTERNAL_H*/