libxl_set_memory_target: only remove videoram from absolute targets
PATCH 1/1 libxl_set_memory_target: only remove videoram from absolute targets
If the new target is relative to the current target, do not remove videoram again: it has already been removed from the current target.
---
Changes in v2:
- add videoram when setting maxmem.
--- tools/libxl/libxl.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
tools/libxl/libxl.c +6 -6
@@ -4764,13 +4764,17 @@ retry_transaction: goto out; } + videoram_s =libxl__xs_read (gc, t,libxl__sprintf (gc, +"%s/memory/videoram" , dompath)); + videoram = videoram_s ?atoi (videoram_s) :0 ; +if (relative) {if (target_memkb <0 &&abs (target_memkb) > current_target_memkb) new_target_memkb =0 ;else new_target_memkb = current_target_memkb + target_memkb; }else - new_target_memkb = target_memkb; + new_target_memkb = target_memkb - videoram;if (new_target_memkb > memorykb) {LIBXL__LOG (ctx,LIBXL__LOG_ERROR , "memory_dynamic_max must be less than or equal to"
@@ -4786,12 +4790,9 @@ retry_transaction: abort_transaction =1 ; goto out; } - videoram_s =libxl__xs_read (gc, t,libxl__sprintf (gc, -"%s/memory/videoram" , dompath)); - videoram = videoram_s ?atoi (videoram_s) :0 ;if (enforce) { - memorykb = new_target_memkb; + memorykb = new_target_memkb + videoram; rc =xc_domain_setmaxmem (ctx->xch, domid, memorykb +LIBXL_MAXMEM_CONSTANT );if (rc !=0 ) {
@@ -4803,7 +4804,6 @@ retry_transaction: } } - new_target_memkb -= videoram; rc =xc_domain_set_pod_target (ctx->xch, domid, new_target_memkb /4 ,NULL ,NULL ,NULL );if (rc !=0 ) {
Signature · 1 line
1.7.10.4
Quoted 4 lines · Stefano Stabellini
If the new target is relative to the current target, do not remove videoram again: it has already been removed from the current target.
Signed-off-by Stefano Stabellini <[email protected]>
How does this relate to "libxl_set_memory_target: retain the same maxmem offset on top of the current target"? Doesn't that also achieve the same aim, since maxmem accounts for vram but target doesn't?
Ian.
Quoted 9 lines · Ian Campbell
Quoted 4 lines · Stefano Stabellini
If the new target is relative to the current target, do not remove videoram again: it has already been removed from the current target.
Signed-off-by Stefano Stabellini <[email protected]>How does this relate to "
libxl_set_memory_target: retain the same maxmem offset on top of the current target"? Doesn't that also achieve the same aim, since maxmem accounts for vram but target doesn't?
The two patches are different: this one affects the memory target while the other one affects maxmem. The only relationship is that this issue was found out by looking at the other patch.
This patch didn't make it into 4.5 because although it is a bug fix, it doesn't fix a regression compared to 4.4.
Quoted 7 lines · Stefano Stabellini
Quoted 6 lines · Ian Campbell
Quoted 4 lines · Stefano Stabellini
If the new target is relative to the current target, do not remove videoram again: it has already been removed from the current target.
Signed-off-by Stefano Stabellini <[email protected]>
Quoted 7 lines
Quoted 3 lines
How does this relate to "
libxl_set_memory_target: retain the same maxmem offset on top of the current target"? Doesn't that also achieve the same aim, since maxmem accounts for vram but target doesn't?The two patches are different: this one affects the memory target while the other one affects maxmem. The only relationship is that this issue was found out by looking at the other patch.
Not even a textual relationship? (i.e. one needs to go first to avoid conflicts)
Quoted 2 lines
This patch didn't make it into 4.5 because although it is a bug fix, it doesn't fix a regression compared to 4.4.
Quoted 12 lines · Ian Campbell
Quoted 11 lines · Stefano Stabellini
Quoted 9 lines · Ian Campbell
Quoted 4 lines · Stefano Stabellini
If the new target is relative to the current target, do not remove videoram again: it has already been removed from the current target.
Signed-off-by Stefano Stabellini <[email protected]>How does this relate to "
libxl_set_memory_target: retain the same maxmem offset on top of the current target"? Doesn't that also achieve the same aim, since maxmem accounts for vram but target doesn't?
Quoted 6 lines
Quoted 3 lines
The two patches are different: this one affects the memory target while the other one affects maxmem. The only relationship is that this issue was found out by looking at the other patch.
Not even a textual relationship? (i.e. one needs to go first to avoid conflicts)
Yep, there is a textual relationship. Sorry I failed to mention it.
This one needs to go first.
Quoted 4 lines
Quoted 2 lines
This patch didn't make it into 4.5 because although it is a bug fix, it doesn't fix a regression compared to 4.4.
Quoted 17 lines · Stefano Stabellini
Quoted 16 lines · Ian Campbell
Quoted 14 lines · Stefano Stabellini
Quoted 9 lines · Ian Campbell
Quoted 4 lines · Stefano Stabellini
If the new target is relative to the current target, do not remove videoram again: it has already been removed from the current target.
Signed-off-by Stefano Stabellini <[email protected]>How does this relate to "
libxl_set_memory_target: retain the same maxmem offset on top of the current target"? Doesn't that also achieve the same aim, since maxmem accounts for vram but target doesn't?The two patches are different: this one affects the memory target while the other one affects maxmem. The only relationship is that this issue was found out by looking at the other patch.
Quoted 6 lines
Quoted 2 lines
Not even a textual relationship? (i.e. one needs to go first to avoid conflicts)
Yep, there is a textual relationship. Sorry I failed to mention it.
This one needs to go first.
Acked + applied then, thanks.