Loop over QubesVM.block_devices in libvirt xml
This commit is contained in:
parent
2f99efa4b8
commit
cc7dd625d9
@ -331,6 +331,12 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
|
|||||||
raise
|
raise
|
||||||
return self._libvirt_domain
|
return self._libvirt_domain
|
||||||
|
|
||||||
|
@property
|
||||||
|
def block_devices(self):
|
||||||
|
return [self.storage.root_dev_config(),
|
||||||
|
self.storage.private_dev_config(),
|
||||||
|
self.storage.volatile_dev_config(),
|
||||||
|
self.storage.other_dev_config()]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def qdb(self):
|
def qdb(self):
|
||||||
|
@ -45,12 +45,27 @@
|
|||||||
<on_reboot>destroy</on_reboot>
|
<on_reboot>destroy</on_reboot>
|
||||||
<on_crash>destroy</on_crash>
|
<on_crash>destroy</on_crash>
|
||||||
<devices>
|
<devices>
|
||||||
{#
|
{% set i = 0 %}
|
||||||
{% for device in vm.storage %}
|
{# TODO Allow more volumes out of the box #}
|
||||||
<disk type="block" device="{{ device.type }}">
|
{% set dd = ['e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p',
|
||||||
|
'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y']
|
||||||
|
%}
|
||||||
|
{% for device in vm.block_devices %}
|
||||||
|
<disk type="block" device="{{ device.devtype }}">
|
||||||
<driver name="phy" />
|
<driver name="phy" />
|
||||||
<source dev="{{ device.path }}" />
|
<source dev="{{ device.path }}" />
|
||||||
<target dev="{{ device.vdev }}" />
|
{% if device.name == 'root' %}
|
||||||
|
<target dev="xvda" />
|
||||||
|
{% elif device.name == 'private' %}
|
||||||
|
<target dev="xvdb" />
|
||||||
|
{% elif device.name == 'volatile' %}
|
||||||
|
<target dev="xvdc" />
|
||||||
|
{% elif device.name == 'kernel' %}
|
||||||
|
<target dev="xvdd" />
|
||||||
|
{% else %}
|
||||||
|
<target dev="xvd{{dd[i]}}" />
|
||||||
|
{% set i = i + 1 %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if not device.rw %}
|
{% if not device.rw %}
|
||||||
<readonly />
|
<readonly />
|
||||||
@ -65,15 +80,6 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</disk>
|
</disk>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
#}
|
|
||||||
|
|
||||||
{{ vm.storage.root_dev_config() }}
|
|
||||||
{% if not prepare_dvm %}{{ vm.storage.private_dev_config() }}{% endif %}
|
|
||||||
{{ vm.storage.other_dev_config() }}
|
|
||||||
|
|
||||||
{% if not vm.hvm %}
|
|
||||||
{{ vm.storage.volatile_dev_config() }}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if vm.netvm %}
|
{% if vm.netvm %}
|
||||||
<interface type="ethernet">
|
<interface type="ethernet">
|
||||||
|
Loading…
Reference in New Issue
Block a user