X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=fish%2Foptions.h;h=b755d9065f4d36398eb47a1ac7ecb1b73ae7c842;hb=c8faa5d0b0a17689d27bd33bc787ba0fe9a3f076;hp=b0bbdeb2883e260601338837be9eb651e3172cd7;hpb=c66d6f215e8303d4eaf8ccfdb6a58cff04ccc485;p=libguestfs.git diff --git a/fish/options.h b/fish/options.h index b0bbdeb..b755d90 100644 --- a/fish/options.h +++ b/fish/options.h @@ -67,14 +67,27 @@ /* Provided by guestfish or guestmount. */ extern guestfs_h *g; extern int read_only; +extern int live; extern int verbose; extern int inspector; +extern int keys_from_stdin; +extern int echo_keys; extern const char *libvirt_uri; extern const char *program_name; /* List of drives added via -a, -d or -N options. */ struct drv { struct drv *next; + + char *device; /* Device name inside the appliance (eg. /dev/sda). + * This is filled in when we add the drives in + * add_drives. Note that guests (-d option) may + * have multiple drives, in which case this is the + * first drive, and nr_drives is the number of + * drives used. + */ + int nr_drives; /* number of drives for this guest */ + enum { drv_a, drv_d, drv_N } type; union { struct { @@ -88,7 +101,6 @@ struct drv { char *filename; /* disk filename (testX.img) */ void *data; /* prepared type */ void (*data_free)(void*); /* function to free 'data' */ - char *device; /* device inside the appliance */ } N; }; }; @@ -102,6 +114,12 @@ struct mp { /* in inspect.c */ extern void inspect_mount (void); extern void print_inspect_prompt (void); +/* (low-level inspection functions, used by virt-inspector only) */ +extern void inspect_do_decrypt (void); +extern void inspect_mount_root (const char *root); + +/* in key.c */ +extern char *read_key (const char *param); /* in options.c */ extern char add_drives (struct drv *drv, char next_drive); @@ -123,6 +141,8 @@ extern int add_libvirt_drives (const char *guest); exit (EXIT_FAILURE); \ } \ drv->type = drv_a; \ + drv->device = NULL; \ + drv->nr_drives = -1; \ drv->a.filename = optarg; \ drv->a.format = format; \ drv->next = drvs; \ @@ -138,6 +158,8 @@ extern int add_libvirt_drives (const char *guest); exit (EXIT_FAILURE); \ } \ drv->type = drv_d; \ + drv->device = NULL; \ + drv->nr_drives = -1; \ drv->d.guest = optarg; \ drv->next = drvs; \ drvs = drv @@ -180,6 +202,13 @@ extern int add_libvirt_drives (const char *guest); exit (EXIT_SUCCESS); \ } +#define OPTION_w \ + if (read_only) { \ + fprintf (stderr, _("%s: cannot mix --ro and --rw options\n"), \ + program_name); \ + exit (EXIT_FAILURE); \ + } + #define OPTION_x \ guestfs_set_trace (g, 1)