DVM: add --dvm option to qvm-start
Currently it only forces to use a fake IP address, which can be replaced during restore time.
This commit is contained in:
parent
1239643c73
commit
2dd9bab23a
@ -460,7 +460,7 @@ class QubesVm(object):
|
|||||||
ret = host_metrics_record["memory_free"]
|
ret = host_metrics_record["memory_free"]
|
||||||
return long(ret)
|
return long(ret)
|
||||||
|
|
||||||
def start(self, debug_console = False, verbose = False):
|
def start(self, debug_console = False, verbose = False, preparing_dvm = False):
|
||||||
if dry_run:
|
if dry_run:
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -500,8 +500,11 @@ class QubesVm(object):
|
|||||||
assert self.netvm_vm is not None
|
assert self.netvm_vm is not None
|
||||||
if verbose:
|
if verbose:
|
||||||
print "--> Attaching to the network backend (netvm={0})...".format(self.netvm_vm.name)
|
print "--> Attaching to the network backend (netvm={0})...".format(self.netvm_vm.name)
|
||||||
|
if preparing_dvm:
|
||||||
xm_cmdline = ["/usr/sbin/xm", "network-attach", self.name, "script=vif-route-qubes", "ip="+self.ip]
|
actual_ip = "254.254.254.254"
|
||||||
|
else:
|
||||||
|
actual_ip = self.ip
|
||||||
|
xm_cmdline = ["/usr/sbin/xm", "network-attach", self.name, "script=vif-route-qubes", "ip="+actual_ip]
|
||||||
if self.netvm_vm.qid != 0:
|
if self.netvm_vm.qid != 0:
|
||||||
if not self.netvm_vm.is_running():
|
if not self.netvm_vm.is_running():
|
||||||
print "ERROR: NetVM not running, please start it first"
|
print "ERROR: NetVM not running, please start it first"
|
||||||
|
@ -35,6 +35,8 @@ def main():
|
|||||||
help="Do not start the GUId")
|
help="Do not start the GUId")
|
||||||
parser.add_option ("--console", action="store_true", dest="debug_console", default=False,
|
parser.add_option ("--console", action="store_true", dest="debug_console", default=False,
|
||||||
help="Attach debugging console to the newly started VM")
|
help="Attach debugging console to the newly started VM")
|
||||||
|
parser.add_option ("--dvm", action="store_true", dest="preparing_dvm", default=False,
|
||||||
|
help="Do actions necessary when preparing DVM image")
|
||||||
|
|
||||||
(options, args) = parser.parse_args ()
|
(options, args) = parser.parse_args ()
|
||||||
if (len (args) != 1):
|
if (len (args) != 1):
|
||||||
@ -53,7 +55,7 @@ def main():
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
vm.verify_files()
|
vm.verify_files()
|
||||||
xid = vm.start(debug_console=options.debug_console, verbose=options.verbose)
|
xid = vm.start(debug_console=options.debug_console, verbose=options.verbose, preparing_dvm=options.preparing_dvm)
|
||||||
except (IOError, OSError, QubesException) as err:
|
except (IOError, OSError, QubesException) as err:
|
||||||
print "ERROR: {0}".format(err)
|
print "ERROR: {0}".format(err)
|
||||||
exit (1)
|
exit (1)
|
||||||
|
@ -21,7 +21,7 @@ if ! [ -d $VMDIR ] ; then
|
|||||||
echo $VMDIR does not exist ?
|
echo $VMDIR does not exist ?
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if ! qvm-start $1 --no-guid ; then
|
if ! qvm-start $1 --no-guid --dvm ; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user