[Libguestfs] [PATCH] fish: Add --rw option (does nothing yet).
Matthew Booth
mbooth at redhat.com
Mon Nov 8 12:39:48 UTC 2010
On 11/08/2010 12:02 PM, Richard W.M. Jones wrote:
>> From 2c4a7ef92a4583a1217213573ad406eb5d745990 Mon Sep 17 00:00:00 2001
> From: Richard W.M. Jones<rjones at redhat.com>
> Date: Fri, 5 Nov 2010 18:36:02 +0000
> Subject: [PATCH] fish: Add --rw option (does nothing yet).
>
> This adds the guestfish --rw option, intended in future
> to be required for writing to disk images.
>
> At the moment this does not change the default and so does
> nothing. This patch is intended for backporting to the
> stable branches so that we can start to introduce scripts
> which use 'guestfish --rw'.
> ---
> fish/fish.c | 7 ++++++-
> fish/guestfish.pod | 46 ++++++++++++++++++++++++++++++++++++++++------
> fish/options.h | 7 +++++++
> fuse/guestmount.c | 7 ++++++-
> fuse/guestmount.pod | 7 +++++++
> 5 files changed, 66 insertions(+), 8 deletions(-)
>
> --- a/fish/options.h
> +++ b/fish/options.h
> @@ -185,6 +185,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); \
> + }
> +
This will display an error if the user does:
guestfish --ro --rw
but not:
guestfish --rw --ro
> #define OPTION_x \
> guestfs_set_trace (g, 1)
>
Otherwise, it looks fine.
Matt
--
Matthew Booth, RHCA, RHCSS
Red Hat Engineering, Virtualisation Team
GPG ID: D33C3490
GPG FPR: 3733 612D 2D05 5458 8A8A 1600 3441 EA19 D33C 3490
More information about the Libguestfs
mailing list