core/storage: fix disk handling for HVM template

Currently HVM template do not have root-cow.img (also do not use 2-layer
device-mapper as PV VMs), so vm.is_template() check isn't enough.
This commit is contained in:
Marek Marczykowski-Górecki 2015-04-06 00:21:38 +02:00
parent 678ccdfaa0
commit dbb43f6035

View File

@ -70,7 +70,8 @@ class QubesXenVmStorage(QubesVmStorage):
params=params)
def _get_rootdev(self):
if self.vm.is_template():
if self.vm.is_template() and \
os.path.exists(os.path.join(self.vmdir, "root-cow.img")):
return self._format_disk_dev(
"{dir}/root.img:{dir}/root-cow.img".format(
dir=self.vmdir),