X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=fish%2Foptions.h;h=9b9aee5e9916f37adb525660b5c857b5de259ffe;hp=728df04a9d594db44d9dac4e38827f490ffe5710;hb=b8e1dee73a1deef1bfd5937e2abfbe9afef7b1ef;hpb=70faafe8d4f0c06c3e62c1e1469289255ee30c53 diff --git a/fish/options.h b/fish/options.h index 728df04..9b9aee5 100644 --- a/fish/options.h +++ b/fish/options.h @@ -1,5 +1,5 @@ /* libguestfs - guestfish and guestmount shared option parsing - * Copyright (C) 2010 Red Hat Inc. + * Copyright (C) 2010-2011 Red Hat Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -67,6 +67,7 @@ /* 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; @@ -108,8 +109,12 @@ struct mp { struct mp *next; char *device; char *mountpoint; + char *options; }; +/* in config.c */ +extern void parse_config (void); + /* in inspect.c */ extern void inspect_mount (void); extern void print_inspect_prompt (void); @@ -172,12 +177,20 @@ extern int add_libvirt_drives (const char *guest); perror ("malloc"); \ exit (EXIT_FAILURE); \ } \ + mp->options = NULL; \ + mp->mountpoint = bad_cast ("/"); \ p = strchr (optarg, ':'); \ if (p) { \ *p = '\0'; \ - mp->mountpoint = p+1; \ - } else \ - mp->mountpoint = bad_cast ("/"); \ + p++; \ + mp->mountpoint = p; \ + p = strchr (p, ':'); \ + if (p) { \ + *p = '\0'; \ + p++; \ + mp->options = p; \ + } \ + } \ mp->device = optarg; \ mp->next = mps; \ mps = mp