[libvirt] [PATCH sandbox v5 14/20] Image: Add network support

Cedric Bosdonnat cbosdonnat at suse.com
Wed Sep 9 12:08:43 UTC 2015


On Tue, 2015-09-08 at 17:29 +0100, Daniel P. Berrange wrote:
> From: Eren Yagdiran <erenyagdiran at gmail.com>
> 
> Virt-sandbox-image will pass exact network arguments to virt-sandbox
> 
> Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
> ---
>  libvirt-sandbox/image/cli.py | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/libvirt-sandbox/image/cli.py b/libvirt-sandbox/image/cli.py
> index a06eb9c..30e2558 100755
> --- a/libvirt-sandbox/image/cli.py
> +++ b/libvirt-sandbox/image/cli.py
> @@ -123,6 +123,12 @@ def run(args):
>              cmd.append("-c")
>              cmd.append(args.connect)
>          params = ['-m','host-image:/=%s,format=%s' %(diskfile,format)]
> +
> +        networkArgs = args.network
> +        if networkArgs is not None:
> +            params.append('-N')
> +            params.append(networkArgs)
> +
>          cmd = cmd + params + ['--'] + commandToRun
>          subprocess.call(cmd)
>          os.unlink(diskfile)
> @@ -214,6 +220,8 @@ def gen_run_args(subparser):
>      parser.add_argument("args",
>                          nargs=argparse.REMAINDER,
>                          help=_("command arguments to run"))
> +    parser.add_argument("-N","--network",
> +                        help=_("Network params for running template"))
>      parser.set_defaults(func=run)
>  
>  def main():

ACK

--
Cedric




More information about the libvir-list mailing list