2016-06-02 07:21:26 +08:00
|
|
|
<volume>
|
|
|
|
<name>LuksDemo.img</name>
|
|
|
|
<key>/var/lib/libvirt/images/LuksDemo.img</key>
|
|
|
|
<source>
|
|
|
|
</source>
|
|
|
|
<capacity unit="G">5</capacity>
|
|
|
|
<allocation>294912</allocation>
|
|
|
|
<target>
|
|
|
|
<path>/var/lib/libvirt/images/LuksDemo.img</path>
|
storage: remove "luks" storage volume type
The current LUKS support has a "luks" volume type which has
a "luks" encryption format.
This partially makes sense if you consider the QEMU shorthand
syntax only requires you to specify a format=luks, and it'll
automagically uses "raw" as the next level driver. QEMU will
however let you override the "raw" with any other driver it
supports (vmdk, qcow, rbd, iscsi, etc, etc)
IOW the intention though is that the "luks" encryption format
is applied to all disk formats (whether raw, qcow2, rbd, gluster
or whatever). As such it doesn't make much sense for libvirt
to say the volume type is "luks" - we should be saying that it
is a "raw" file, but with "luks" encryption applied.
IOW, when creating a storage volume we should use this XML
<volume>
<name>demo.raw</name>
<capacity>5368709120</capacity>
<target>
<format type='raw'/>
<encryption format='luks'>
<secret type='passphrase' uuid='0a81f5b2-8403-7b23-c8d6-21ccd2f80d6f'/>
</encryption>
</target>
</volume>
and when configuring a guest disk we should use
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/home/berrange/VirtualMachines/demo.raw'/>
<target dev='sda' bus='scsi'/>
<encryption format='luks'>
<secret type='passphrase' uuid='0a81f5b2-8403-7b23-c8d6-21ccd2f80d6f'/>
</encryption>
</disk>
This commit thus removes the "luks" storage volume type added
in
commit 318ebb36f1027b3357a32d6f781bd77d7a9043fd
Author: John Ferlan <jferlan@redhat.com>
Date: Tue Jun 21 12:59:54 2016 -0400
util: Add 'luks' to the FileTypeInfo
The storage file probing code is modified so that it can probe
the actual encryption formats explicitly, rather than merely
probing existance of encryption and letting the storage driver
guess the format.
The rest of the code is then adapted to deal with
VIR_STORAGE_FILE_RAW w/ VIR_STORAGE_ENCRYPTION_FORMAT_LUKS
instead of just VIR_STORAGE_FILE_LUKS.
The commit mentioned above was included in libvirt v2.0.0.
So when querying volume XML this will be a change in behaviour
vs the 2.0.0 release - it'll report 'raw' instead of 'luks'
for the volume format, but still report 'luks' for encryption
format. I think this change is OK because the storage driver
did not include any support for creating volumes, nor starting
guets with luks volumes in v2.0.0 - that only since then.
Clearly if we change this we must do it before v2.1.0 though.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2016-07-27 00:41:46 +08:00
|
|
|
<format type='raw'/>
|
2016-06-02 07:21:26 +08:00
|
|
|
<permissions>
|
|
|
|
<mode>0644</mode>
|
|
|
|
<owner>0</owner>
|
|
|
|
<group>0</group>
|
|
|
|
<label>unconfined_u:object_r:virt_image_t:s0</label>
|
|
|
|
</permissions>
|
|
|
|
<encryption format='luks'>
|
2016-07-11 19:50:57 +08:00
|
|
|
<secret type='passphrase' uuid='f52a81b2-424e-490c-823d-6bd4235bc572'/>
|
2016-06-02 07:21:26 +08:00
|
|
|
<cipher name='serpent' size='256' mode='cbc' hash='sha256'/>
|
|
|
|
<ivgen name='plain64' hash='sha256'/>
|
|
|
|
</encryption>
|
|
|
|
</target>
|
|
|
|
</volume>
|