storage: actually use storage.root_img and such properties
Actual VM root disk used hardcoded image names, instead of properties set for that purpose...
This commit is contained in:
parent
b26f2a73b4
commit
fa196f1350
@ -65,31 +65,31 @@ class XenStorage(QubesVmStorage):
|
|||||||
self.volatile_img = os.path.join(vmdir, 'volatile.img')
|
self.volatile_img = os.path.join(vmdir, 'volatile.img')
|
||||||
|
|
||||||
def root_dev_config(self):
|
def root_dev_config(self):
|
||||||
if self.vm.is_template() and \
|
if self.vm.is_template() and self.rootcow_img:
|
||||||
os.path.exists(os.path.join(self.vmdir, "root-cow.img")):
|
|
||||||
return self.format_disk_dev(
|
return self.format_disk_dev(
|
||||||
"{dir}/root.img:{dir}/root-cow.img".format(
|
"{root}:{rootcow}".format(
|
||||||
dir=self.vmdir),
|
root=self.root_img, rootcow=self.rootcow_img),
|
||||||
"block-origin", self.root_dev, True)
|
"block-origin", self.root_dev, True)
|
||||||
elif self.vm.template and not self.vm.template.storage.rootcow_img:
|
elif self.vm.template and not self.vm.template.storage.rootcow_img:
|
||||||
# HVM template-based VM - template doesn't have own
|
# HVM template-based VM - template doesn't have own
|
||||||
# root-cow.img, only one device-mapper layer
|
# root-cow.img, only one device-mapper layer
|
||||||
return self.format_disk_dev(
|
return self.format_disk_dev(
|
||||||
"{tpldir}/root.img:{vmdir}/volatile.img".format(
|
"{root}:{volatile}".format(
|
||||||
tpldir=self.vm.template.dir_path,
|
root=self.vm.template.storage.root_img,
|
||||||
vmdir=self.vmdir),
|
volatile=self.volatile_img),
|
||||||
"block-snapshot", self.root_dev, True)
|
"block-snapshot", self.root_dev, True)
|
||||||
elif self.vm.template:
|
elif self.vm.template:
|
||||||
# any other template-based VM - two device-mapper layers: one
|
# any other template-based VM - two device-mapper layers: one
|
||||||
# in dom0 (here) from root+root-cow, and another one from
|
# in dom0 (here) from root+root-cow, and another one from
|
||||||
# this+volatile.img
|
# this+volatile.img
|
||||||
return self.format_disk_dev(
|
return self.format_disk_dev(
|
||||||
"{dir}/root.img:{dir}/root-cow.img".format(
|
"{root}:{rootcow}".format(
|
||||||
dir=self.vm.template.dir_path),
|
root=self.root_img,
|
||||||
|
rootcow=self.vm.template.storage.rootcow_img),
|
||||||
"block-snapshot", self.root_dev, False)
|
"block-snapshot", self.root_dev, False)
|
||||||
else:
|
else:
|
||||||
return self.format_disk_dev(
|
return self.format_disk_dev(
|
||||||
"{dir}/root.img".format(dir=self.vmdir),
|
"{root}".format(root=self.root_img),
|
||||||
None, self.root_dev, True)
|
None, self.root_dev, True)
|
||||||
|
|
||||||
def private_dev_config(self):
|
def private_dev_config(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user