mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-09 06:25:19 +00:00
qemu: update domain live xml for virsh memtune with --live flag
virsh subcommand memtune forgot updating domain live xml
after setting cgroup value.
(cherry picked from commit 0047d5d6e8
)
This commit is contained in:
parent
a462372cef
commit
2102e03dc7
@ -7303,11 +7303,13 @@ qemuDomainSetMemoryParameters(virDomainPtr dom,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (set_swap_hard_limit) {
|
if (set_swap_hard_limit) {
|
||||||
if (flags & VIR_DOMAIN_AFFECT_LIVE &&
|
if (flags & VIR_DOMAIN_AFFECT_LIVE) {
|
||||||
(rc = virCgroupSetMemSwapHardLimit(group, swap_hard_limit)) < 0) {
|
if ((rc = virCgroupSetMemSwapHardLimit(group, swap_hard_limit)) < 0) {
|
||||||
virReportSystemError(-rc, "%s",
|
virReportSystemError(-rc, "%s",
|
||||||
_("unable to set memory swap_hard_limit tunable"));
|
_("unable to set memory swap_hard_limit tunable"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
}
|
||||||
|
vm->def->mem.swap_hard_limit = swap_hard_limit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flags & VIR_DOMAIN_AFFECT_CONFIG)
|
if (flags & VIR_DOMAIN_AFFECT_CONFIG)
|
||||||
@ -7315,11 +7317,13 @@ qemuDomainSetMemoryParameters(virDomainPtr dom,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (set_memory_hard_limit) {
|
if (set_memory_hard_limit) {
|
||||||
if (flags & VIR_DOMAIN_AFFECT_LIVE &&
|
if (flags & VIR_DOMAIN_AFFECT_LIVE) {
|
||||||
(rc = virCgroupSetMemoryHardLimit(group, memory_hard_limit)) < 0) {
|
if ((rc = virCgroupSetMemoryHardLimit(group, memory_hard_limit)) < 0) {
|
||||||
virReportSystemError(-rc, "%s",
|
virReportSystemError(-rc, "%s",
|
||||||
_("unable to set memory hard_limit tunable"));
|
_("unable to set memory hard_limit tunable"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
}
|
||||||
|
vm->def->mem.hard_limit = memory_hard_limit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flags & VIR_DOMAIN_AFFECT_CONFIG)
|
if (flags & VIR_DOMAIN_AFFECT_CONFIG)
|
||||||
@ -7327,11 +7331,13 @@ qemuDomainSetMemoryParameters(virDomainPtr dom,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (set_memory_soft_limit) {
|
if (set_memory_soft_limit) {
|
||||||
if (flags & VIR_DOMAIN_AFFECT_LIVE &&
|
if (flags & VIR_DOMAIN_AFFECT_LIVE) {
|
||||||
(rc = virCgroupSetMemorySoftLimit(group, memory_soft_limit)) < 0) {
|
if ((rc = virCgroupSetMemorySoftLimit(group, memory_soft_limit)) < 0) {
|
||||||
virReportSystemError(-rc, "%s",
|
virReportSystemError(-rc, "%s",
|
||||||
_("unable to set memory soft_limit tunable"));
|
_("unable to set memory soft_limit tunable"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
}
|
||||||
|
vm->def->mem.soft_limit = memory_soft_limit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flags & VIR_DOMAIN_AFFECT_CONFIG)
|
if (flags & VIR_DOMAIN_AFFECT_CONFIG)
|
||||||
|
Loading…
Reference in New Issue
Block a user