Skip to content

Commit

Permalink
If the LUKS_SECRET attribute exists for the image, insert it into
Browse files Browse the repository at this point in the history
the libvirt xml deployment
  • Loading branch information
laurencegill committed Oct 6, 2017
1 parent d9ecac7 commit fa44566
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/vmm/LibVirtDriverKVM.cc
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ int LibVirtDriver::deployment_description_kvm(
string sheepdog_host = "";
string gluster_host = "";
string gluster_volume = "";
string luks_secret = "";

string total_bytes_sec = "";
string read_bytes_sec = "";
Expand Down Expand Up @@ -456,6 +457,8 @@ int LibVirtDriver::deployment_description_kvm(
iscsi_usage = disk[i]->vector_value("ISCSI_USAGE");
iscsi_iqn = disk[i]->vector_value("ISCSI_IQN");

luks_secret = disk[i]->vector_value("LUKS_SECRET");

gluster_host = disk[i]->vector_value("GLUSTER_HOST");
gluster_volume = disk[i]->vector_value("GLUSTER_VOLUME");

Expand Down Expand Up @@ -686,6 +689,17 @@ int LibVirtDriver::deployment_description_kvm(

file << "\t\t\t<target dev=" << one_util::escape_xml_attr(target) << "/>\n";

// ---- luks secret for target ----

if ( !luks_secret.empty())
{
file << "\t\t\t<encryption format='luks'>\n"
<< "\t\t\t\t<secret type='passphrase' uuid="
<< one_util::escape_xml_attr(luks_secret) <<"/>\n"
<< "\t\t\t</encryption>\n";
}


// ---- boot order for this device ----

if ( disk[i]->vector_value("ORDER", order) == 0 )
Expand Down

0 comments on commit fa44566

Please sign in to comment.