From 968308c55f6753c98ebc66994c1f88c5bde081d0 Mon Sep 17 00:00:00 2001 From: Rafal Wojtczuk Date: Mon, 1 Aug 2011 15:06:01 +0200 Subject: [PATCH] qvm-prefs: allow on the fly netvm switch (#302) When changing netvm of a running vm, detach/attach eth0. Some functionality of qubes_core_netvm thus is duplicated in setup_ip. REQUIRES http://git.qubes-os.org/?p=rafal/xen.git;a=commit;h=42c72e6173586a807f8f153391e2e57352d362b1 --- common/setup_ip | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/common/setup_ip b/common/setup_ip index 61f197c..79f389a 100755 --- a/common/setup_ip +++ b/common/setup_ip @@ -10,4 +10,14 @@ if [ x$ip != x ]; then /sbin/route add default dev $INTERFACE echo "nameserver $gateway" > /etc/resolv.conf echo "nameserver $secondary_dns" >> /etc/resolv.conf + network=$(/usr/bin/xenstore-read qubes_netvm_network 2>/dev/null) + if [ "x$network" != "x" ]; then + gateway=$(/usr/bin/xenstore-read qubes_netvm_gateway) + netmask=$(/usr/bin/xenstore-read qubes_netvm_netmask) + secondary_dns=$(/usr/bin/xenstore-read qubes_netvm_secondary_dns) + echo "NS1=$gateway" > /var/run/qubes/qubes_ns + echo "NS2=$secondary_dns" >> /var/run/qubes/qubes_ns + /usr/lib/qubes/qubes_setup_dnat_to_ns + fi + fi