|
88 |
switch (unit) { |
88 |
switch (unit) { |
89 |
case 'P': case 'p': |
89 |
case 'P': case 'p': |
90 |
mem *= 1024; |
90 |
mem *= 1024; |
|
|
91 |
/* falls through */ |
91 |
case 'T': case 't': |
92 |
case 'T': case 't': |
92 |
mem *= 1024; |
93 |
mem *= 1024; |
|
|
94 |
/* falls through */ |
93 |
case 'G': case 'g': |
95 |
case 'G': case 'g': |
94 |
mem *= 1024; |
96 |
mem *= 1024; |
|
|
97 |
/* falls through */ |
95 |
case 'M': case 'm': |
98 |
case 'M': case 'm': |
96 |
mem *= 1024; |
99 |
mem *= 1024; |
|
|
100 |
/* falls through */ |
97 |
case 'K': case 'k': |
101 |
case 'K': case 'k': |
98 |
mem *= 1024; |
102 |
mem *= 1024; |
99 |
} |
103 |
} |
|
227 |
'writethrough': _('Read caching, forced sync (write-through)'), |
231 |
'writethrough': _('Read caching, forced sync (write-through)'), |
228 |
'writeback': _('Read/write caching, no forced sync (write-back)'), |
232 |
'writeback': _('Read/write caching, no forced sync (write-back)'), |
229 |
'directsync': _('No host caching, forced sync (direct-sync)'), |
233 |
'directsync': _('No host caching, forced sync (direct-sync)'), |
230 |
'unsafe': _('Read/write caching, sync filtered out (unsafe)'), |
234 |
'unsafe': _('Read/write caching, sync filtered out (unsafe)') |
231 |
}, |
235 |
}, |
232 |
POOLS_RW: { // storage pools which support creating new volumes |
236 |
POOLS_RW: { // storage pools which support creating new volumes |
233 |
dir: true, |
237 |
dir: true, |
|
284 |
return []; |
288 |
return []; |
285 |
}); |
289 |
}); |
286 |
}, |
290 |
}, |
|
|
291 |
ISO: {id: 'iso', label: _('ISO format (iso)')}, |
292 |
RAW: {id: 'raw', label: _('Simple format (raw)')}, |
293 |
QCOW2: {id: 'qcow2', label: _('Extended format (qcow2)'), preselected: true}, |
287 |
getImageFormat: function(options) { |
294 |
getImageFormat: function(options) { |
288 |
ISO = {id: 'iso', label: _('ISO format (iso)')}; |
|
|
289 |
RAW = {id: 'raw', label: _('Simple format (raw)')}; |
290 |
QCOW2 = {id: 'qcow2', label: _('Extended format (qcow2)'), preselected: true}; |
291 |
var list = []; |
295 |
var list = []; |
292 |
if (options.type == 'cdrom') { |
296 |
if (options.type == 'cdrom') { |
293 |
list.push(ISO); |
297 |
list.push(self.ISO); |
294 |
} else if (options.type == 'floppy') { |
298 |
} else if (options.type == 'floppy') { |
295 |
list.push(RAW); |
299 |
list.push(self.RAW); |
296 |
} else { |
300 |
} else { |
297 |
list.push(RAW); |
301 |
list.push(self.RAW); |
298 |
if (options.domain_type == 'kvm') { // TODO: Check self.POOLS_FILE |
302 |
if (options.domain_type == 'kvm') { // TODO: Check self.POOLS_FILE |
299 |
// add qcow2 as pre-selected item |
303 |
// add qcow2 as pre-selected item |
300 |
list.push(QCOW2); |
304 |
list.push(self.QCOW2); |
301 |
} |
305 |
} |
302 |
} |
306 |
} |
303 |
return list; |
307 |
return list; |