Commit 42f1e0e49b9c162c211eba0115c5e7d1de861f44
1 parent
27c3f2cb
tun-fd option support for external tundev config (Rusty Russell)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@398 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
7 additions
and
1 deletions
vl.c
| @@ -3393,6 +3393,7 @@ void help(void) | @@ -3393,6 +3393,7 @@ void help(void) | ||
| 3393 | "-snapshot write to temporary files instead of disk image files\n" | 3393 | "-snapshot write to temporary files instead of disk image files\n" |
| 3394 | "-m megs set virtual RAM size to megs MB\n" | 3394 | "-m megs set virtual RAM size to megs MB\n" |
| 3395 | "-n script set network init script [default=%s]\n" | 3395 | "-n script set network init script [default=%s]\n" |
| 3396 | + "-tun-fd fd this fd talks to tap/tun, use it.\n" | ||
| 3396 | "-nographic disable graphical output\n" | 3397 | "-nographic disable graphical output\n" |
| 3397 | "\n" | 3398 | "\n" |
| 3398 | "Linux boot specific (does not require PC BIOS):\n" | 3399 | "Linux boot specific (does not require PC BIOS):\n" |
| @@ -3422,6 +3423,7 @@ struct option long_options[] = { | @@ -3422,6 +3423,7 @@ struct option long_options[] = { | ||
| 3422 | { "nographic", 0, NULL, 0, }, | 3423 | { "nographic", 0, NULL, 0, }, |
| 3423 | { "kernel", 1, NULL, 0, }, | 3424 | { "kernel", 1, NULL, 0, }, |
| 3424 | { "append", 1, NULL, 0, }, | 3425 | { "append", 1, NULL, 0, }, |
| 3426 | + { "tun-fd", 1, NULL, 0, }, | ||
| 3425 | { NULL, 0, NULL, 0 }, | 3427 | { NULL, 0, NULL, 0 }, |
| 3426 | }; | 3428 | }; |
| 3427 | 3429 | ||
| @@ -3514,6 +3516,9 @@ int main(int argc, char **argv) | @@ -3514,6 +3516,9 @@ int main(int argc, char **argv) | ||
| 3514 | case 7: | 3516 | case 7: |
| 3515 | kernel_cmdline = optarg; | 3517 | kernel_cmdline = optarg; |
| 3516 | break; | 3518 | break; |
| 3519 | + case 8: | ||
| 3520 | + net_fd = atoi(optarg); | ||
| 3521 | + break; | ||
| 3517 | } | 3522 | } |
| 3518 | break; | 3523 | break; |
| 3519 | case 'h': | 3524 | case 'h': |
| @@ -3568,7 +3573,8 @@ int main(int argc, char **argv) | @@ -3568,7 +3573,8 @@ int main(int argc, char **argv) | ||
| 3568 | } | 3573 | } |
| 3569 | 3574 | ||
| 3570 | /* init network tun interface */ | 3575 | /* init network tun interface */ |
| 3571 | - net_init(); | 3576 | + if (net_fd < 0) |
| 3577 | + net_init(); | ||
| 3572 | 3578 | ||
| 3573 | /* init the memory */ | 3579 | /* init the memory */ |
| 3574 | tmpdir = getenv("QEMU_TMPDIR"); | 3580 | tmpdir = getenv("QEMU_TMPDIR"); |