Re: [sandbox PATCH v4 15/21] Image: Add network support

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

 



On Fri, Aug 28, 2015 at 01:47:43PM +0000, Eren Yagdiran wrote:
> Virt-sandbox-image will pass exact network arguments to virt-sandbox
> ---
>  virt-sandbox-image/virt-sandbox-image.py | 12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/virt-sandbox-image/virt-sandbox-image.py b/virt-sandbox-image/virt-sandbox-image.py
> index c182874..058738a 100755
> --- a/virt-sandbox-image/virt-sandbox-image.py
> +++ b/virt-sandbox-image/virt-sandbox-image.py
> @@ -145,9 +145,13 @@ def run(args):
>          if args.connect is not None:
>              cmd.append("-c")
>              cmd.append(args.connect)
> -        params = ['-m','host-image:/=%s,format=%s' %(diskfile,format),
> -               '--',
> -               commandToRun]
> +        params = ['-m','host-image:/=%s,format=%s' %(diskfile,format)]
> +        networkArgs = args.network
> +        if networkArgs is not None:
> +            params.append('-N')
> +            params.append(networkArgs)
> +        params.append('--')
> +        params.append(commandToRun)
>          cmd = cmd + params
>          subprocess.call(cmd)
>          subprocess.call(["rm", "-rf", diskfile])
> @@ -228,6 +232,8 @@ def gen_run_args(subparser):
>                          help=_("Template directory for saving templates"))
>      parser.add_argument("-i","--igniter",
>                          help=_("Igniter command for image"))
> +    parser.add_argument("-n","--network",
> +                        help=_("Network params for running template"))

We should use -N here to match virt-sandbox arg syntax, as
-n is used for shorthand of --name, which we also need to
support in virt-sandbox-image


Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]