summaryrefslogtreecommitdiff
path: root/tests/storagevolxml2xmlout
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2016-07-26 17:41:46 +0100
committerDaniel P. Berrange <berrange@redhat.com>2016-07-27 18:59:15 +0100
commita48c714115c3cfde1aac90b75152204f9a628209 (patch)
tree09a0e7e3c4281f49aa6b274fbe0b99dc573fc679 /tests/storagevolxml2xmlout
parent970f42ab42b6dee68917f3492f9378035c5505c0 (diff)
downloadlibvirt-a48c714115c3cfde1aac90b75152204f9a628209.tar.gz
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>
Diffstat (limited to 'tests/storagevolxml2xmlout')
-rw-r--r--tests/storagevolxml2xmlout/vol-luks-cipher.xml2
-rw-r--r--tests/storagevolxml2xmlout/vol-luks.xml2
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/storagevolxml2xmlout/vol-luks-cipher.xml b/tests/storagevolxml2xmlout/vol-luks-cipher.xml
index 1ac7424376..2b58850aaf 100644
--- a/tests/storagevolxml2xmlout/vol-luks-cipher.xml
+++ b/tests/storagevolxml2xmlout/vol-luks-cipher.xml
@@ -7,7 +7,7 @@
<allocation unit='bytes'>294912</allocation>
<target>
<path>/var/lib/libvirt/images/LuksDemo.img</path>
- <format type='luks'/>
+ <format type='raw'/>
<permissions>
<mode>0644</mode>
<owner>0</owner>
diff --git a/tests/storagevolxml2xmlout/vol-luks.xml b/tests/storagevolxml2xmlout/vol-luks.xml
index 7b82866c6f..599b3c5c4d 100644
--- a/tests/storagevolxml2xmlout/vol-luks.xml
+++ b/tests/storagevolxml2xmlout/vol-luks.xml
@@ -7,7 +7,7 @@
<allocation unit='bytes'>294912</allocation>
<target>
<path>/var/lib/libvirt/images/LuksDemo.img</path>
- <format type='luks'/>
+ <format type='raw'/>
<permissions>
<mode>0644</mode>
<owner>0</owner>