Merge branch 'prebeta2' of git.qubes-os.org:/var/lib/qubes/git/rafal/core

This commit is contained in:
Joanna Rutkowska 2011-08-01 15:41:56 +02:00
commit 7309cc2f04
3 changed files with 34 additions and 2 deletions

View File

@ -10,4 +10,14 @@ if [ x$ip != x ]; then
/sbin/route add default dev $INTERFACE /sbin/route add default dev $INTERFACE
echo "nameserver $gateway" > /etc/resolv.conf echo "nameserver $gateway" > /etc/resolv.conf
echo "nameserver $secondary_dns" >> /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 fi

View File

@ -121,7 +121,12 @@ def main():
files_to_backup += file_to_backup(vm.icon_path) files_to_backup += file_to_backup(vm.icon_path)
if vm.is_updateable(): if vm.is_updateable():
if os.path.exists(vm.dir_path + "/apps.templates"):
# template
files_to_backup += file_to_backup(vm.dir_path + "/apps.templates") files_to_backup += file_to_backup(vm.dir_path + "/apps.templates")
else:
# standaloneVM
files_to_backup += file_to_backup(vm.dir_path + "/apps")
if os.path.exists (vm.firewall_conf): if os.path.exists (vm.firewall_conf):
files_to_backup += file_to_backup(vm.firewall_conf) files_to_backup += file_to_backup(vm.firewall_conf)
if os.path.exists(vm.dir_path + '/whitelisted-appmenus.list'): if os.path.exists(vm.dir_path + '/whitelisted-appmenus.list'):

View File

@ -119,7 +119,24 @@ def set_netvm(vms, vm, args):
vm.uses_default_netvm = False vm.uses_default_netvm = False
vm.netvm_vm = netvm_vm vm.netvm_vm = netvm_vm
if not vm.is_running():
return
if not vm.netvm_vm.is_running():
subprocess.check_call(["qvm-start", vm.netvm_vm.name])
subprocess.check_call(["xl", "network-detach", vm.name, "0"])
domain_path="/local/domain/"+str(vm.get_xid())
subprocess.check_call(["xenstore-write",
domain_path+"/qubes_ip",
vm.ip])
subprocess.check_call(["xenstore-write",
domain_path+"/qubes_gateway",
vm.netvm_vm.gateway])
subprocess.check_call(["xenstore-write",
domain_path+"/qubes_secondary_dns",
vm.netvm_vm.secondary_dns])
subprocess.check_call(["xl", "network-attach", vm.name, "ip="+vm.ip,
"backend="+vm.netvm_vm.name,
"script=/etc/xen/scripts/vif-route-qubes"])
def set_updateable(vms, vm, args): def set_updateable(vms, vm, args):
if vm.is_updateable(): if vm.is_updateable():