Skip to contentSkip to conversation

tap: Add optional parameters to up/down script

PATCH In review Sasha Levin 2 participants 2 messages Sep 30, 2011 – Oct 6, 2011 Networking

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 tap: Add optional parameters to up/down script

This allows the user to add custom parameters to the up or down scripts.

Extra parameters are useful in more complex networking scenarios where we would like to configure network devices when starting or stopping the guest.

Cc Anthony Liguori <[email protected]>
---
 net.c     |    8 ++++++++
 net/tap.c |   45 ++++++++++++++++++++++++++++++++++++---------
 2 files changed, 44 insertions(+), 9 deletions(-)
net.c +8 -0
index d05930c..bb27598 100644
@@ -952,10 +952,18 @@ static const struct {
                 .type = QEMU_OPT_STRING,
                 .help = "script to initialize the interface",
             }, {
+                .name = "scriptparams",
+                .type = QEMU_OPT_STRING,
+                .help = "parameters for the initialization script",
+            }, {
                 .name = "downscript",
                 .type = QEMU_OPT_STRING,
                 .help = "script to shut down the interface",
             }, {
+                .name = "downscriptparams",
+                .type = QEMU_OPT_STRING,
+                .help = "parameters for the deinitialization script",
+            }, {
                 .name = "sndbuf",
                 .type = QEMU_OPT_SIZE,
                 .help = "send buffer limit"
net/tap.c +36 -9

123 lines not on this page · raw message

Signature · 1 line
1.7.6.1
#1 lore raw
Quoted 8 lines · Sasha Levin

Subject: [PATCH v2] tap: Add optional parameters to up/down script

This allows the user to add custom parameters to the up or down scripts.

Extra parameters are useful in more complex networking scenarios where we would like to configure network devices when starting or stopping the guest.

PATCH v2 isn't working for me. Neither the scriptparams nor the downscriptparams.
Usage was like:

	qemu-system-x86_64 -m 512 -net nic,macaddr=[...] -net

tap,script=/path/to/script,scriptparams="param1",
downscript=/path/to/downscript -drive.......

Greetings
Thomas