[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Libguestfs] [PATCH 1/2] fish: Add --network option.



Hi Rich,

I'm checking this option, as i didn't find PATCH2/2 for this thread, i'm wondering how can i check the network
address of the appliance? i just found the following in libvirt xml file,

ue="/var/tmp"/>\n    <qemu:arg value="-netdev"/>\n    <qemu:arg value="user,id=usernet,net=169.254.0.0/16"/>\n    <qemu:arg value="-device"/>\n    <qemu:arg value="virtio-net-pci,netdev=

Regards,
Mohua Li

On Sat, Aug 04, 2012 at 02:38:55PM +0100, Richard W.M. Jones wrote:
> From: "Richard W.M. Jones" <rjones redhat com>
> 
> This enables the network.
> ---
>  fish/fish.c        |    6 +++++-
>  fish/guestfish.pod |   14 +++++++++-----
>  2 files changed, 14 insertions(+), 6 deletions(-)
> 
> diff --git a/fish/fish.c b/fish/fish.c
> index 9bb8c90..d0e2d8a 100644
> --- a/fish/fish.c
> +++ b/fish/fish.c
> @@ -125,8 +125,9 @@ usage (int status)
>               "  --listen             Listen for remote commands\n"
>               "  --live               Connect to a live virtual machine\n"
>               "  -m|--mount dev[:mnt[:opts]] Mount dev on mnt (if omitted, /)\n"
> -             "  -n|--no-sync         Don't autosync\n"
> +             "  --network            Enable network\n"
>               "  -N|--new type        Create prepared disk (test1.img, ...)\n"
> +             "  -n|--no-sync         Don't autosync\n"
>               "  --pipe-error         Pipe commands can detect write errors\n"
>               "  --progress-bars      Enable progress bars even when not interactive\n"
>               "  --no-progress-bars   Disable progress bars\n"
> @@ -190,6 +191,7 @@ main (int argc, char *argv[])
>      { "listen", 0, 0, 0 },
>      { "live", 0, 0, 0 },
>      { "mount", 1, 0, 'm' },
> +    { "network", 0, 0, 0 },
>      { "new", 1, 0, 'N' },
>      { "no-dest-paths", 0, 0, 'D' },
>      { "no-sync", 0, 0, 'n' },
> @@ -286,6 +288,8 @@ main (int argc, char *argv[])
>          live = 1;
>        } else if (STREQ (long_options[option_index].name, "pipe-error")) {
>          pipe_error = 1;
> +      } else if (STREQ (long_options[option_index].name, "network")) {
> +        guestfs_set_network (g, 1);
>        } else {
>          fprintf (stderr, _("%s: unknown long option: %s (%d)\n"),
>                   program_name, long_options[option_index].name, option_index);
> diff --git a/fish/guestfish.pod b/fish/guestfish.pod
> index 83b358b..01571ea 100644
> --- a/fish/guestfish.pod
> +++ b/fish/guestfish.pod
> @@ -332,12 +332,9 @@ filesystem can support them:
>  
>  Using this flag is equivalent to using the C<mount-options> command.
>  
> -=item B<-n>
> -
> -=item B<--no-sync>
> +=item B<--network>
>  
> -Disable autosync.  This is enabled by default.  See the discussion
> -of autosync in the L<guestfs(3)> manpage.
> +Enable QEMU user networking in the guest.
>  
>  =item B<-N type>
>  
> @@ -350,6 +347,13 @@ alternative to the I<-a> option: whereas I<-a> adds an existing disk,
>  I<-N> creates a preformatted disk with a filesystem and adds it.
>  See L</PREPARED DISK IMAGES> below.
>  
> +=item B<-n>
> +
> +=item B<--no-sync>
> +
> +Disable autosync.  This is enabled by default.  See the discussion
> +of autosync in the L<guestfs(3)> manpage.
> +
>  =item B<--pipe-error>
>  
>  If writes fail to pipe commands (see L</PIPES> below), then the
> -- 
> 1.7.10.4
> 
> _______________________________________________
> Libguestfs mailing list
> Libguestfs redhat com
> https://www.redhat.com/mailman/listinfo/libguestfs

-- 
我只担心一件事,我怕我配不上我所遭受的苦难

Attachment: signature.asc
Description: Digital signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]