fix(xo-server/vif.set): don't change locking mode automatically (#5357)
See xoa-support#2929
This commit is contained in:
parent
a691e033eb
commit
7fcfc306f9
@ -15,6 +15,7 @@
|
||||
> Users must be able to say: “I had this issue, happy to know it's fixed”
|
||||
|
||||
- [Remotes/NFS] Only mount with `vers=3` when no other options [#4940](https://github.com/vatesfr/xen-orchestra/issues/4940) (PR [#5354](https://github.com/vatesfr/xen-orchestra/pull/5354))
|
||||
- [VM/network] Don't change VIF's locking mode automatically (PR [#5357](https://github.com/vatesfr/xen-orchestra/pull/5357))
|
||||
|
||||
### Packages to release
|
||||
|
||||
|
@ -119,7 +119,7 @@ export async function set({
|
||||
mac,
|
||||
currently_attached: attached,
|
||||
ipv4_allowed: newIpAddresses,
|
||||
locking_mode: lockingMode,
|
||||
locking_mode: lockingMode ?? vif.lockingMode,
|
||||
qos_algorithm_type: rateLimit != null ? 'ratelimit' : undefined,
|
||||
qos_algorithm_params:
|
||||
rateLimit != null ? { kbps: String(rateLimit) } : undefined,
|
||||
|
@ -1,5 +1,3 @@
|
||||
import { isEmpty } from '../../utils'
|
||||
|
||||
import { makeEditObject } from '../utils'
|
||||
|
||||
export default {
|
||||
@ -26,38 +24,8 @@ export default {
|
||||
await this._disconnectVif(this.getObject(vifId))
|
||||
},
|
||||
editVif: makeEditObject({
|
||||
ipv4Allowed: {
|
||||
get: true,
|
||||
set: [
|
||||
'ipv4Allowed',
|
||||
function (value, vif) {
|
||||
const lockingMode =
|
||||
isEmpty(value) && isEmpty(vif.ipv6_allowed)
|
||||
? 'network_default'
|
||||
: 'locked'
|
||||
|
||||
if (lockingMode !== vif.locking_mode) {
|
||||
return vif.set_locking_mode(lockingMode)
|
||||
}
|
||||
},
|
||||
],
|
||||
},
|
||||
ipv6Allowed: {
|
||||
get: true,
|
||||
set: [
|
||||
'ipv6Allowed',
|
||||
function (value, vif) {
|
||||
const lockingMode =
|
||||
isEmpty(value) && isEmpty(vif.ipv4_allowed)
|
||||
? 'network_default'
|
||||
: 'locked'
|
||||
|
||||
if (lockingMode !== vif.locking_mode) {
|
||||
return vif.set_locking_mode(lockingMode)
|
||||
}
|
||||
},
|
||||
],
|
||||
},
|
||||
ipv4Allowed: true,
|
||||
ipv6Allowed: true,
|
||||
lockingMode: {
|
||||
set: (value, vif) => vif.set_locking_mode(value),
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user