From f52d7dbe3442bf00cf01e98052871c6bfaed5953 Mon Sep 17 00:00:00 2001 From: Jaime Melis Date: Thu, 14 Feb 2013 18:53:49 +0100 Subject: [PATCH] Feature #1068: rbd names inside the name attribute of the disk's section in the libvirt domain file --- src/vmm/LibVirtDriverKVM.cc | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/vmm/LibVirtDriverKVM.cc b/src/vmm/LibVirtDriverKVM.cc index c538a63062..56872d9bdb 100644 --- a/src/vmm/LibVirtDriverKVM.cc +++ b/src/vmm/LibVirtDriverKVM.cc @@ -56,6 +56,9 @@ int LibVirtDriver::deployment_description_kvm( string ro = ""; string driver = ""; string cache = ""; + string source = ""; + string clone = ""; + int disk_id; string default_driver = ""; string default_driver_cache = ""; @@ -305,7 +308,7 @@ int LibVirtDriver::deployment_description_kvm( if ( disk == 0 ) { - continue; + continue; } type = disk->vector_value("TYPE"); @@ -313,6 +316,9 @@ int LibVirtDriver::deployment_description_kvm( ro = disk->vector_value("READONLY"); driver = disk->vector_value("DRIVER"); cache = disk->vector_value("CACHE"); + source = disk->vector_value("SOURCE"); + clone = disk->vector_value("CLONE"); + disk->vector_value_str("DISK_ID", disk_id); if (target.empty()) @@ -346,8 +352,14 @@ int LibVirtDriver::deployment_description_kvm( { file << "\t\t" << endl << "\t\t\t" << endl; + << source; + + if ( clone == "YES" ) + { + file << "-" << vm->get_oid() << "-" << disk_id; + } + + file << "'/>" << endl; } else if ( type == "CDROM" ) {