[Kimchi-devel] [PATCH v2][Kimchi] Issue #931 Error when editing a template created using a disk image
Ramon Medeiros
ramonn at linux.vnet.ibm.com
Mon Apr 25 20:24:03 UTC 2016
UI wasn't passing path to image disk when updating it, so the backend
was losing the disk.
Signed-off-by: Ramon Medeiros <ramonn at linux.vnet.ibm.com>
---
Changes:
v2:
Put result from isImageBasedTemplate() in a variable, instead of pass the pointer to the function
ui/js/src/kimchi.template_edit_main.js | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/ui/js/src/kimchi.template_edit_main.js b/ui/js/src/kimchi.template_edit_main.js
index de72452..bc3c2ef 100644
--- a/ui/js/src/kimchi.template_edit_main.js
+++ b/ui/js/src/kimchi.template_edit_main.js
@@ -20,6 +20,7 @@ kimchi.template_edit_main = function() {
var origDisks;
var origNetworks;
var templateDiskSize;
+ var baseImageTemplate;
$('#template-name', templateEditMain).val(kimchi.selectedTemplate);
$('#edit-template-tabs a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
$('.tab-content').css('overflow','hidden');
@@ -89,6 +90,7 @@ kimchi.template_edit_main = function() {
}
return false;
}
+ baseImageTemplate = isImageBasedTemplate();
enableSpice();
$('#template-edit-graphics').selectpicker();
@@ -342,6 +344,11 @@ kimchi.template_edit_main = function() {
'format' : $(diskEntity).find('.template-storage-disk-format').val()
};
+ // image based template: add base to dictionary
+ if ((baseImageTemplate) && (index == 0)) {
+ newDisk["base"] = $('#template-edit-vmimage-textbox').val();
+ }
+
var storageType = $(diskEntity).find('.template-storage-type').val();
if(storageType === 'iscsi' || storageType === 'scsi') {
newDisk['volume'] = newDisk['pool']['name'].split('/').pop();
--
2.5.5
More information about the Kimchi-devel
mailing list