git.annexia.org
/
libguestfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
New APIs: set-network and get-network to enable network support.
[libguestfs.git]
/
src
/
launch.c
diff --git
a/src/launch.c
b/src/launch.c
index
1e1ea8e
..
9262cc5
100644
(file)
--- a/
src/launch.c
+++ b/
src/launch.c
@@
-410,6
+410,14
@@
guestfs__launch (guestfs_h *g)
add_cmdline (g, "-device");
add_cmdline (g, "virtserialport,chardev=channel0,name=org.libguestfs.channel.0");
add_cmdline (g, "-device");
add_cmdline (g, "virtserialport,chardev=channel0,name=org.libguestfs.channel.0");
+ /* Enable user networking. */
+ if (g->enable_network) {
+ add_cmdline (g, "-netdev");
+ add_cmdline (g, "user,id=usernet");
+ add_cmdline (g, "-device");
+ add_cmdline (g, NET_IF ",netdev=usernet");
+ }
+
#define LINUX_CMDLINE \
"panic=1 " /* force kernel to panic if daemon exits */ \
"console=ttyS0 " /* serial console */ \
#define LINUX_CMDLINE \
"panic=1 " /* force kernel to panic if daemon exits */ \
"console=ttyS0 " /* serial console */ \