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" ) {