debuggers.hg

view tools/libxl/flexarray.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 03718b569d97
children
line source
1 /*
2 * Copyright (C) 2009 Citrix Ltd.
3 * Author Vincent Hanquez <vincent.hanquez@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 FLEXARRAY_H
17 #define FLEXARRAY_H
19 typedef struct flexarray {
20 int size;
21 int autogrow;
22 unsigned int count;
23 void **data; /* array of pointer */
24 } flexarray_t;
26 _hidden flexarray_t *flexarray_make(int size, int autogrow);
27 _hidden void flexarray_free(flexarray_t *array);
28 _hidden int flexarray_grow(flexarray_t *array, int extents);
29 _hidden int flexarray_set(flexarray_t *array, unsigned int index, void *ptr);
30 _hidden int flexarray_append(flexarray_t *array, void *ptr);
31 _hidden int flexarray_vappend(flexarray_t *array, ...);
32 _hidden int flexarray_get(flexarray_t *array, int index, void **ptr);
34 _hidden void **flexarray_contents(flexarray_t *array);
36 #endif