Patchwork [V3,5/5] xen: Set the vram dirty when an error occur.

login
register
mail settings
Submitter Anthony PERARD
Date Sept. 20, 2012, 11:12 a.m.
Message ID <1348139574-23324-6-git-send-email-anthony.perard@citrix.com>
Download mbox | patch
Permalink /patch/185378/
State New
Headers show

Comments

Anthony PERARD - Sept. 20, 2012, 11:12 a.m.
If the call to xc_hvm_track_dirty_vram() fails, then we set dirtybit on all the
video ram. This case happens during migration, but we don't need a special case
for live migration with patch.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 xen-all.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Stefano Stabellini - Sept. 20, 2012, 12:31 p.m.
On Thu, 20 Sep 2012, Anthony PERARD wrote:
> If the call to xc_hvm_track_dirty_vram() fails, then we set dirtybit on all the
> video ram. This case happens during migration, but we don't need a special case
> for live migration with patch.

Just as a reference, what is this special case for live migration that
you are talking about? A pointer to the qemu-xen-traditional code would
be welcomed here.



> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
> ---
>  xen-all.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/xen-all.c b/xen-all.c
> index 6250593..ab28261 100644
> --- a/xen-all.c
> +++ b/xen-all.c
> @@ -507,7 +507,8 @@ static void xen_sync_dirty_bitmap(XenIOState *state,
>                                   bitmap);
>      if (rc < 0) {
>          if (rc != -ENODATA) {
> -            fprintf(stderr, "xen: track_dirty_vram failed (0x" TARGET_FMT_plx
> +            memory_region_set_dirty(framebuffer, 0, size);
> +            DPRINTF("xen: track_dirty_vram failed (0x" TARGET_FMT_plx
>                      ", 0x" TARGET_FMT_plx "): %s\n",
>                      start_addr, start_addr + size, strerror(-rc));
>          }
> -- 
> Anthony PERARD
>
Anthony PERARD - Sept. 21, 2012, 2:33 p.m.
On Thu, Sep 20, 2012 at 1:31 PM, Stefano Stabellini
<stefano.stabellini@eu.citrix.com> wrote:
> On Thu, 20 Sep 2012, Anthony PERARD wrote:
>> If the call to xc_hvm_track_dirty_vram() fails, then we set dirtybit on all the
>> video ram. This case happens during migration, but we don't need a special case
>> for live migration with patch.
>
> Just as a reference, what is this special case for live migration that
> you are talking about? A pointer to the qemu-xen-traditional code would
> be welcomed here.

It was in the previous iteration of this patches series, qemu-trad
does not have a special case for migration, but a fail of the xc_ call
result in the vram to be marked as dirty.

Patch

diff --git a/xen-all.c b/xen-all.c
index 6250593..ab28261 100644
--- a/xen-all.c
+++ b/xen-all.c
@@ -507,7 +507,8 @@  static void xen_sync_dirty_bitmap(XenIOState *state,
                                  bitmap);
     if (rc < 0) {
         if (rc != -ENODATA) {
-            fprintf(stderr, "xen: track_dirty_vram failed (0x" TARGET_FMT_plx
+            memory_region_set_dirty(framebuffer, 0, size);
+            DPRINTF("xen: track_dirty_vram failed (0x" TARGET_FMT_plx
                     ", 0x" TARGET_FMT_plx "): %s\n",
                     start_addr, start_addr + size, strerror(-rc));
         }