[KVM-AUTOTEST PATCH 03/12] KVM test: add sample 'qemu-ifup' script

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

 



The script adds a requested interface to an existing bridge.  It is meant to be
used by qemu when running in TAP mode.

Note: the user is responsible for setting up the bridge before running any
tests.  This can be done with brctl or in any manner that is appropriate for
the host OS.  It can be done inside 'qemu-ifup' as well, but this sample script
doesn't do it.

Signed-off-by: Michael Goldish <mgoldish@xxxxxxxxxx>
---
 client/tests/kvm/qemu-ifup |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
 create mode 100644 client/tests/kvm/qemu-ifup

diff --git a/client/tests/kvm/qemu-ifup b/client/tests/kvm/qemu-ifup
new file mode 100644
index 0000000..bcd9a7a
--- /dev/null
+++ b/client/tests/kvm/qemu-ifup
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+# The following expression selects the first bridge listed by 'brctl show'.
+# Modify it to suit your needs.
+switch=$(/usr/sbin/brctl show | awk 'NR==2 { print $1 }')
+
+/sbin/ifconfig $1 0.0.0.0 up
+/usr/sbin/brctl addif ${switch} $1
-- 
1.5.4.1

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux