From 81ae4fafcf08eb10987acf16d5060cdd08060dc9 Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Wed, 8 Jun 2011 03:33:45 +0200 Subject: [PATCH] dom0: Use 10.138.x.y for DispVMs and fix gateway/DNS addresses --- dom0/restore/qubes_prepare_saved_domain.sh | 2 +- dom0/restore/qubes_restore.c | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/dom0/restore/qubes_prepare_saved_domain.sh b/dom0/restore/qubes_prepare_saved_domain.sh index ff37b829..2d17e1a5 100755 --- a/dom0/restore/qubes_prepare_saved_domain.sh +++ b/dom0/restore/qubes_prepare_saved_domain.sh @@ -44,7 +44,7 @@ fi xenstore-write /local/domain/$ID/qubes_save_request 1 xenstore-watch-qubes /local/domain/$ID/device/qubes_used_mem xenstore-read /local/domain/$ID/qubes_gateway | \ - cut -d . -f 2 | tr -d "\n" > $VMDIR/netvm_id.txt + cut -d . -f 3 | tr -d "\n" > $VMDIR/netvm_id.txt xl block-detach $1 /dev/xvdb MEM=$(xenstore-read /local/domain/$ID/device/qubes_used_mem) echo "DVM boot complete, memory used=$MEM. Saving image..." diff --git a/dom0/restore/qubes_restore.c b/dom0/restore/qubes_restore.c index dfe91880..15df3d5b 100644 --- a/dom0/restore/qubes_restore.c +++ b/dom0/restore/qubes_restore.c @@ -258,8 +258,7 @@ char *dispname_by_dispid(int dispid) char *build_dvm_ip(int netvm, int id) { static char buf[256]; - snprintf(buf, sizeof(buf), "10.%d.%d.%d", netvm, id / 254 + 200, - (id % 254) + 1); + snprintf(buf, sizeof(buf), "10.138.%d.%d", netvm, (id % 254) + 1); return buf; } @@ -385,9 +384,9 @@ void setup_xenstore(int netvm_id, int domid, int dvmid, char *name) write_xs_single(xs, domid, "qubes_ip", build_dvm_ip(netvm_id, dvmid)); write_xs_single(xs, domid, "qubes_netmask", "255.255.0.0"); - snprintf(val, sizeof(val), "10.%d.0.1", netvm_id); + snprintf(val, sizeof(val), "10.137.%d.1", netvm_id); write_xs_single(xs, domid, "qubes_gateway", val); - snprintf(val, sizeof(val), "10.%d.255.254", netvm_id); + snprintf(val, sizeof(val), "10.137.%d.254", netvm_id); write_xs_single(xs, domid, "qubes_secondary_dns", val); write_xs_single(xs, domid, "qubes_vm_type", "AppVM"); write_xs_single(xs, domid, "qubes_restore_complete", "True");