[sandbox PATCH v2 12/19] Image: Add network support

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

 



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 e20ce22..5fc7f44 100755
--- a/virt-sandbox-image/virt-sandbox-image.py
+++ b/virt-sandbox-image/virt-sandbox-image.py
@@ -116,9 +116,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)
 
@@ -187,6 +191,8 @@ def gen_run_args(subparser):
                         help=_("path for image"))
     parser.add_argument("-i","--igniter",
                         help=_("Igniter command for image"))
+    parser.add_argument("-n","--network",
+                        help=_("Network params for running template"))
     parser.set_defaults(func=run)
 
 if __name__ == '__main__':
-- 
2.1.0

--
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]