feat(xo-server/vm.set): dont switch to DMC when changing memory
Fixes #4983
This commit is contained in:
@@ -9,6 +9,8 @@
|
||||
|
||||
[Host/Load-balancer] Add option to disable migration (PR [#5706](https://github.com/vatesfr/xen-orchestra/pull/5706))
|
||||
|
||||
- [VM] Don't switch a VM to use [DMC](https://docs.citrix.com/en-us/xencenter/7-1/dmc-about.html) when changing the memory [#4983](https://github.com/vatesfr/xen-orchestra/issues/4983)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
> Users must be able to say: “I had this issue, happy to know it's fixed”
|
||||
|
||||
@@ -340,7 +340,24 @@ export default {
|
||||
set: 'memory_dynamic_min',
|
||||
},
|
||||
|
||||
memory: 'memoryMax',
|
||||
_memory: {
|
||||
addToLimits: true,
|
||||
get: vm => +vm.memory_dynamic_max,
|
||||
preprocess: parseSize,
|
||||
set(memory, vm) {
|
||||
return vm.$call('set_memory_limits', vm.memory_static_min, memory, memory, memory)
|
||||
},
|
||||
},
|
||||
|
||||
memory: {
|
||||
dispatch(vm) {
|
||||
const dynamicMin = vm.memory_dynamic_min
|
||||
const useDmc = dynamicMin !== vm.memory_dynamic_max || dynamicMin !== vm.memory_static_max
|
||||
|
||||
return useDmc ? 'memoryMax' : '_memory'
|
||||
},
|
||||
},
|
||||
|
||||
memoryMax: {
|
||||
addToLimits: true,
|
||||
limitName: 'memory',
|
||||
|
||||
@@ -192,6 +192,10 @@ export const makeEditObject = specs => {
|
||||
}
|
||||
})
|
||||
|
||||
if ('dispatch' in spec) {
|
||||
return spec
|
||||
}
|
||||
|
||||
const { get } = spec
|
||||
if (get) {
|
||||
spec.get = normalizeGet(get, name)
|
||||
@@ -235,6 +239,11 @@ export const makeEditObject = specs => {
|
||||
return
|
||||
}
|
||||
|
||||
const { dispatch } = spec
|
||||
if (dispatch) {
|
||||
return set(value, dispatch(object))
|
||||
}
|
||||
|
||||
const { preprocess } = spec
|
||||
if (preprocess) {
|
||||
value = preprocess(value)
|
||||
|
||||
Reference in New Issue
Block a user