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”
|
> 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))
|
- [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
|
### Packages to release
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ export async function set({
|
|||||||
mac,
|
mac,
|
||||||
currently_attached: attached,
|
currently_attached: attached,
|
||||||
ipv4_allowed: newIpAddresses,
|
ipv4_allowed: newIpAddresses,
|
||||||
locking_mode: lockingMode,
|
locking_mode: lockingMode ?? vif.lockingMode,
|
||||||
qos_algorithm_type: rateLimit != null ? 'ratelimit' : undefined,
|
qos_algorithm_type: rateLimit != null ? 'ratelimit' : undefined,
|
||||||
qos_algorithm_params:
|
qos_algorithm_params:
|
||||||
rateLimit != null ? { kbps: String(rateLimit) } : undefined,
|
rateLimit != null ? { kbps: String(rateLimit) } : undefined,
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
import { isEmpty } from '../../utils'
|
|
||||||
|
|
||||||
import { makeEditObject } from '../utils'
|
import { makeEditObject } from '../utils'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -26,38 +24,8 @@ export default {
|
|||||||
await this._disconnectVif(this.getObject(vifId))
|
await this._disconnectVif(this.getObject(vifId))
|
||||||
},
|
},
|
||||||
editVif: makeEditObject({
|
editVif: makeEditObject({
|
||||||
ipv4Allowed: {
|
ipv4Allowed: true,
|
||||||
get: true,
|
ipv6Allowed: 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)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
lockingMode: {
|
lockingMode: {
|
||||||
set: (value, vif) => vif.set_locking_mode(value),
|
set: (value, vif) => vif.set_locking_mode(value),
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user