qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL for-2.5 0/2] Block patches
@ 2015-11-24  8:04 Stefan Hajnoczi
  2015-11-24  8:04 ` [Qemu-devel] [PULL for-2.5 1/2] parallels: dirty BAT properly for continuous allocations Stefan Hajnoczi
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2015-11-24  8:04 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Stefan Hajnoczi

The following changes since commit 5522a841cab5f15ac0f8d207b320c21755a7a1a5:

  Merge remote-tracking branch 'remotes/ehabkost/tags/numa-pull-request' into staging (2015-11-23 16:07:49 +0000)

are available in the git repository at:

  git://github.com/stefanha/qemu.git tags/block-pull-request

for you to fetch changes up to 466138dc689b6b14f31d5d20316affb4b4efd177:

  virtio-blk: Move resetting of req->mr_next to virtio_blk_handle_rw_error (2015-11-24 09:27:49 +0800)

----------------------------------------------------------------

----------------------------------------------------------------

Fam Zheng (1):
  virtio-blk: Move resetting of req->mr_next to
    virtio_blk_handle_rw_error

Vladimir Sementsov-Ogievskiy (1):
  parallels: dirty BAT properly for continuous allocations

 block/parallels.c     | 2 +-
 hw/block/virtio-blk.c | 7 +++----
 2 files changed, 4 insertions(+), 5 deletions(-)

-- 
2.5.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PULL for-2.5 1/2] parallels: dirty BAT properly for continuous allocations
  2015-11-24  8:04 [Qemu-devel] [PULL for-2.5 0/2] Block patches Stefan Hajnoczi
@ 2015-11-24  8:04 ` Stefan Hajnoczi
  2015-11-24  8:04 ` [Qemu-devel] [PULL for-2.5 2/2] virtio-blk: Move resetting of req->mr_next to virtio_blk_handle_rw_error Stefan Hajnoczi
  2015-11-24 11:15 ` [Qemu-devel] [PULL for-2.5 0/2] Block patches Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2015-11-24  8:04 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Vladimir Sementsov-Ogievskiy, Stefan Hajnoczi,
	Denis V. Lunev

From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>

This patch marks part of the BAT dirty properly. There is a possibility that
multy-block allocation could have one block allocated on one BAT page and
next block on the next page. The code without the patch could not save
updated position to the file.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
Message-id: 1447779778-26062-1-git-send-email-den@openvz.org
CC: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 block/parallels.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/parallels.c b/block/parallels.c
index 4f79293..f689fde 100644
--- a/block/parallels.c
+++ b/block/parallels.c
@@ -220,7 +220,7 @@ static int64_t allocate_clusters(BlockDriverState *bs, int64_t sector_num,
         s->bat_bitmap[idx + i] = cpu_to_le32(s->data_end / s->off_multiplier);
         s->data_end += s->tracks;
         bitmap_set(s->bat_dirty_bmap,
-                   bat_entry_off(idx) / s->bat_dirty_block, 1);
+                   bat_entry_off(idx + i) / s->bat_dirty_block, 1);
     }
 
     return bat2sect(s, idx) + sector_num % s->tracks;
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PULL for-2.5 2/2] virtio-blk: Move resetting of req->mr_next to virtio_blk_handle_rw_error
  2015-11-24  8:04 [Qemu-devel] [PULL for-2.5 0/2] Block patches Stefan Hajnoczi
  2015-11-24  8:04 ` [Qemu-devel] [PULL for-2.5 1/2] parallels: dirty BAT properly for continuous allocations Stefan Hajnoczi
@ 2015-11-24  8:04 ` Stefan Hajnoczi
  2015-11-24 11:15 ` [Qemu-devel] [PULL for-2.5 0/2] Block patches Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2015-11-24  8:04 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Fam Zheng, Stefan Hajnoczi

From: Fam Zheng <famz@redhat.com>

"werror=report" would free the req in virtio_blk_handle_rw_error, we
mustn't write to it in that case.

Reported-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
Message-id: 1448239280-15025-1-git-send-email-famz@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 hw/block/virtio-blk.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index 848f3fe..756ae5c 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -72,6 +72,9 @@ static int virtio_blk_handle_rw_error(VirtIOBlockReq *req, int error,
     VirtIOBlock *s = req->dev;
 
     if (action == BLOCK_ERROR_ACTION_STOP) {
+        /* Break the link as the next request is going to be parsed from the
+         * ring again. Otherwise we may end up doing a double completion! */
+        req->mr_next = NULL;
         req->next = s->rq;
         s->rq = req;
     } else if (action == BLOCK_ERROR_ACTION_REPORT) {
@@ -112,10 +115,6 @@ static void virtio_blk_rw_complete(void *opaque, int ret)
              * happen on the other side of the migration).
              */
             if (virtio_blk_handle_rw_error(req, -ret, is_read)) {
-                /* Break the link in case the next request is added to the
-                 * restart queue and is going to be parsed from the ring again.
-                 */
-                req->mr_next = NULL;
                 continue;
             }
         }
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PULL for-2.5 0/2] Block patches
  2015-11-24  8:04 [Qemu-devel] [PULL for-2.5 0/2] Block patches Stefan Hajnoczi
  2015-11-24  8:04 ` [Qemu-devel] [PULL for-2.5 1/2] parallels: dirty BAT properly for continuous allocations Stefan Hajnoczi
  2015-11-24  8:04 ` [Qemu-devel] [PULL for-2.5 2/2] virtio-blk: Move resetting of req->mr_next to virtio_blk_handle_rw_error Stefan Hajnoczi
@ 2015-11-24 11:15 ` Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2015-11-24 11:15 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: QEMU Developers

On 24 November 2015 at 08:04, Stefan Hajnoczi <stefanha@redhat.com> wrote:
> The following changes since commit 5522a841cab5f15ac0f8d207b320c21755a7a1a5:
>
>   Merge remote-tracking branch 'remotes/ehabkost/tags/numa-pull-request' into staging (2015-11-23 16:07:49 +0000)
>
> are available in the git repository at:
>
>   git://github.com/stefanha/qemu.git tags/block-pull-request
>
> for you to fetch changes up to 466138dc689b6b14f31d5d20316affb4b4efd177:
>
>   virtio-blk: Move resetting of req->mr_next to virtio_blk_handle_rw_error (2015-11-24 09:27:49 +0800)
>
> ----------------------------------------------------------------
>
> ----------------------------------------------------------------
>
> Fam Zheng (1):
>   virtio-blk: Move resetting of req->mr_next to
>     virtio_blk_handle_rw_error
>
> Vladimir Sementsov-Ogievskiy (1):
>   parallels: dirty BAT properly for continuous allocations
>
>  block/parallels.c     | 2 +-
>  hw/block/virtio-blk.c | 7 +++----
>  2 files changed, 4 insertions(+), 5 deletions(-)


Applied, thanks.

-- PMM

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-11-24 11:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-24  8:04 [Qemu-devel] [PULL for-2.5 0/2] Block patches Stefan Hajnoczi
2015-11-24  8:04 ` [Qemu-devel] [PULL for-2.5 1/2] parallels: dirty BAT properly for continuous allocations Stefan Hajnoczi
2015-11-24  8:04 ` [Qemu-devel] [PULL for-2.5 2/2] virtio-blk: Move resetting of req->mr_next to virtio_blk_handle_rw_error Stefan Hajnoczi
2015-11-24 11:15 ` [Qemu-devel] [PULL for-2.5 0/2] Block patches Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).