From 1d1dda14572576a3242f113bc0d3a8c5f09b14fa Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Tue, 1 Nov 2011 19:46:17 -0700 Subject: [PATCH] allow build_libvirt.sh not to destroy/recreate net --- tools/build_libvirt.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/build_libvirt.sh b/tools/build_libvirt.sh index 48e285348d..fc281d3199 100755 --- a/tools/build_libvirt.sh +++ b/tools/build_libvirt.sh @@ -174,6 +174,7 @@ unmount_images # Network configuration variables GUEST_NETWORK=${GUEST_NETWORK:-1} +GUEST_RECREATE_NET=${GUEST_RECREATE_NET:-yes} GUEST_IP=${GUEST_IP:-192.168.$GUEST_NETWORK.50} GUEST_CIDR=${GUEST_CIDR:-$GUEST_IP/24} @@ -194,8 +195,10 @@ cat > $NET_XML < EOF -virsh net-destroy devstack-$GUEST_NETWORK || true -virsh net-create $VM_DIR/net.xml +if [[ "$GUEST_RECREATE_NET" == "yes" ]]; then + virsh net-destroy devstack-$GUEST_NETWORK || true + virsh net-create $VM_DIR/net.xml +fi # libvirt.xml configuration LIBVIRT_XML=$VM_DIR/libvirt.xml