qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 00/12] Block patches
@ 2019-08-27 20:16 Stefan Hajnoczi
  2019-08-27 20:16 ` [Qemu-devel] [PULL 01/12] util/iov: introduce qemu_iovec_init_extended Stefan Hajnoczi
                   ` (12 more replies)
  0 siblings, 13 replies; 40+ messages in thread
From: Stefan Hajnoczi @ 2019-08-27 20:16 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Kevin Wolf, qemu-block, Peter Maydell, Max Reitz,
	Stefan Hajnoczi, John Snow

The following changes since commit dac03af5d5482ec7ee9c23db467bb7230b33c0d9:

  Merge remote-tracking branch 'remotes/rth/tags/pull-axp-20190825' into staging (2019-08-27 10:00:51 +0100)

are available in the Git repository at:

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

for you to fetch changes up to 5396234b96a2ac743f48644529771498e036e698:

  block/qcow2: implement .bdrv_co_pwritev(_compressed)_part (2019-08-27 14:58:42 +0100)

----------------------------------------------------------------
Pull request

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

Vladimir Sementsov-Ogievskiy (12):
  util/iov: introduce qemu_iovec_init_extended
  util/iov: improve qemu_iovec_is_zero
  block/io: refactor padding
  block: define .*_part io handlers in BlockDriver
  block/io: bdrv_co_do_copy_on_readv: use and support qiov_offset
  block/io: bdrv_co_do_copy_on_readv: lazy allocation
  block/io: bdrv_aligned_preadv: use and support qiov_offset
  block/io: bdrv_aligned_pwritev: use and support qiov_offset
  block/io: introduce bdrv_co_p{read, write}v_part
  block/qcow2: refactor qcow2_co_preadv to use buffer-based io
  block/qcow2: implement .bdrv_co_preadv_part
  block/qcow2: implement .bdrv_co_pwritev(_compressed)_part

 block/qcow2.h             |   1 +
 include/block/block_int.h |  21 ++
 include/qemu/iov.h        |  10 +-
 block/backup.c            |   2 +-
 block/io.c                | 541 +++++++++++++++++++++++---------------
 block/qcow2-cluster.c     |  14 +-
 block/qcow2.c             | 131 +++++----
 qemu-img.c                |   4 +-
 util/iov.c                | 153 +++++++++--
 9 files changed, 568 insertions(+), 309 deletions(-)

-- 
2.21.0



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

* [Qemu-devel] [PULL 01/12] util/iov: introduce qemu_iovec_init_extended
  2019-08-27 20:16 [Qemu-devel] [PULL 00/12] Block patches Stefan Hajnoczi
@ 2019-08-27 20:16 ` Stefan Hajnoczi
  2019-09-09 17:39   ` Peter Maydell
  2019-08-27 20:16 ` [Qemu-devel] [PULL 02/12] util/iov: improve qemu_iovec_is_zero Stefan Hajnoczi
                   ` (11 subsequent siblings)
  12 siblings, 1 reply; 40+ messages in thread
From: Stefan Hajnoczi @ 2019-08-27 20:16 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Kevin Wolf, Vladimir Sementsov-Ogievskiy, qemu-block,
	Peter Maydell, Max Reitz, Stefan Hajnoczi, John Snow

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

Introduce new initialization API, to create requests with padding. Will
be used in the following patch. New API uses qemu_iovec_init_buf if
resulting io vector has only one element, to avoid extra allocations.
So, we need to update qemu_iovec_destroy to support destroying such
QIOVs.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20190604161514.262241-2-vsementsov@virtuozzo.com
Message-Id: <20190604161514.262241-2-vsementsov@virtuozzo.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 include/qemu/iov.h |   7 +++
 util/iov.c         | 112 +++++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 114 insertions(+), 5 deletions(-)

diff --git a/include/qemu/iov.h b/include/qemu/iov.h
index 48b45987b7..f3787a0cf7 100644
--- a/include/qemu/iov.h
+++ b/include/qemu/iov.h
@@ -199,6 +199,13 @@ static inline void *qemu_iovec_buf(QEMUIOVector *qiov)
 
 void qemu_iovec_init(QEMUIOVector *qiov, int alloc_hint);
 void qemu_iovec_init_external(QEMUIOVector *qiov, struct iovec *iov, int niov);
+void qemu_iovec_init_extended(
+        QEMUIOVector *qiov,
+        void *head_buf, size_t head_len,
+        QEMUIOVector *mid_qiov, size_t mid_offset, size_t mid_len,
+        void *tail_buf, size_t tail_len);
+void qemu_iovec_init_slice(QEMUIOVector *qiov, QEMUIOVector *source,
+                           size_t offset, size_t len);
 void qemu_iovec_add(QEMUIOVector *qiov, void *base, size_t len);
 void qemu_iovec_concat(QEMUIOVector *dst,
                        QEMUIOVector *src, size_t soffset, size_t sbytes);
diff --git a/util/iov.c b/util/iov.c
index 74e6ca8ed7..366ff9cdd1 100644
--- a/util/iov.c
+++ b/util/iov.c
@@ -353,6 +353,103 @@ void qemu_iovec_concat(QEMUIOVector *dst,
     qemu_iovec_concat_iov(dst, src->iov, src->niov, soffset, sbytes);
 }
 
+/*
+ * qiov_find_iov
+ *
+ * Return pointer to iovec structure, where byte at @offset in original vector
+ * @iov exactly is.
+ * Set @remaining_offset to be offset inside that iovec to the same byte.
+ */
+static struct iovec *iov_skip_offset(struct iovec *iov, size_t offset,
+                                     size_t *remaining_offset)
+{
+    while (offset > 0 && offset >= iov->iov_len) {
+        offset -= iov->iov_len;
+        iov++;
+    }
+    *remaining_offset = offset;
+
+    return iov;
+}
+
+/*
+ * qiov_slice
+ *
+ * Find subarray of iovec's, containing requested range. @head would
+ * be offset in first iov (returned by the function), @tail would be
+ * count of extra bytes in last iovec (returned iov + @niov - 1).
+ */
+static struct iovec *qiov_slice(QEMUIOVector *qiov,
+                                size_t offset, size_t len,
+                                size_t *head, size_t *tail, int *niov)
+{
+    struct iovec *iov, *end_iov;
+
+    assert(offset + len <= qiov->size);
+
+    iov = iov_skip_offset(qiov->iov, offset, head);
+    end_iov = iov_skip_offset(iov, *head + len, tail);
+
+    if (*tail > 0) {
+        assert(*tail < end_iov->iov_len);
+        *tail = end_iov->iov_len - *tail;
+        end_iov++;
+    }
+
+    *niov = end_iov - iov;
+
+    return iov;
+}
+
+/*
+ * Compile new iovec, combining @head_buf buffer, sub-qiov of @mid_qiov,
+ * and @tail_buf buffer into new qiov.
+ */
+void qemu_iovec_init_extended(
+        QEMUIOVector *qiov,
+        void *head_buf, size_t head_len,
+        QEMUIOVector *mid_qiov, size_t mid_offset, size_t mid_len,
+        void *tail_buf, size_t tail_len)
+{
+    size_t mid_head, mid_tail;
+    int total_niov, mid_niov = 0;
+    struct iovec *p, *mid_iov;
+
+    if (mid_len) {
+        mid_iov = qiov_slice(mid_qiov, mid_offset, mid_len,
+                             &mid_head, &mid_tail, &mid_niov);
+    }
+
+    total_niov = !!head_len + mid_niov + !!tail_len;
+    if (total_niov == 1) {
+        qemu_iovec_init_buf(qiov, NULL, 0);
+        p = &qiov->local_iov;
+    } else {
+        qiov->niov = qiov->nalloc = total_niov;
+        qiov->size = head_len + mid_len + tail_len;
+        p = qiov->iov = g_new(struct iovec, qiov->niov);
+    }
+
+    if (head_len) {
+        p->iov_base = head_buf;
+        p->iov_len = head_len;
+        p++;
+    }
+
+    if (mid_len) {
+        memcpy(p, mid_iov, mid_niov * sizeof(*p));
+        p[0].iov_base = (uint8_t *)p[0].iov_base + mid_head;
+        p[0].iov_len -= mid_head;
+        p[mid_niov - 1].iov_len -= mid_tail;
+        p += mid_niov;
+    }
+
+    if (tail_len) {
+        p->iov_base = tail_buf;
+        p->iov_len = tail_len;
+    }
+}
+
 /*
  * Check if the contents of the iovecs are all zero
  */
@@ -374,14 +471,19 @@ bool qemu_iovec_is_zero(QEMUIOVector *qiov)
     return true;
 }
 
+void qemu_iovec_init_slice(QEMUIOVector *qiov, QEMUIOVector *source,
+                           size_t offset, size_t len)
+{
+    qemu_iovec_init_extended(qiov, NULL, 0, source, offset, len, NULL, 0);
+}
+
 void qemu_iovec_destroy(QEMUIOVector *qiov)
 {
-    assert(qiov->nalloc != -1);
+    if (qiov->nalloc != -1) {
+        g_free(qiov->iov);
+    }
 
-    qemu_iovec_reset(qiov);
-    g_free(qiov->iov);
-    qiov->nalloc = 0;
-    qiov->iov = NULL;
+    memset(qiov, 0, sizeof(*qiov));
 }
 
 void qemu_iovec_reset(QEMUIOVector *qiov)
-- 
2.21.0



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

* [Qemu-devel] [PULL 02/12] util/iov: improve qemu_iovec_is_zero
  2019-08-27 20:16 [Qemu-devel] [PULL 00/12] Block patches Stefan Hajnoczi
  2019-08-27 20:16 ` [Qemu-devel] [PULL 01/12] util/iov: introduce qemu_iovec_init_extended Stefan Hajnoczi
@ 2019-08-27 20:16 ` Stefan Hajnoczi
  2019-08-27 20:16 ` [Qemu-devel] [PULL 03/12] block/io: refactor padding Stefan Hajnoczi
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 40+ messages in thread
From: Stefan Hajnoczi @ 2019-08-27 20:16 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Kevin Wolf, Vladimir Sementsov-Ogievskiy, qemu-block,
	Peter Maydell, Max Reitz, Stefan Hajnoczi, John Snow

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

We'll need to check a part of qiov soon, so implement it now.

Optimization with align down to 4 * sizeof(long) is dropped due to:
1. It is strange: it aligns length of the buffer, but where is a
   guarantee that buffer pointer is aligned itself?
2. buffer_is_zero() is a better place for optimizations and it has
   them.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20190604161514.262241-3-vsementsov@virtuozzo.com
Message-Id: <20190604161514.262241-3-vsementsov@virtuozzo.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 include/qemu/iov.h |  2 +-
 block/io.c         |  2 +-
 util/iov.c         | 31 +++++++++++++++++++------------
 3 files changed, 21 insertions(+), 14 deletions(-)

diff --git a/include/qemu/iov.h b/include/qemu/iov.h
index f3787a0cf7..29957c8a72 100644
--- a/include/qemu/iov.h
+++ b/include/qemu/iov.h
@@ -212,7 +212,7 @@ void qemu_iovec_concat(QEMUIOVector *dst,
 size_t qemu_iovec_concat_iov(QEMUIOVector *dst,
                              struct iovec *src_iov, unsigned int src_cnt,
                              size_t soffset, size_t sbytes);
-bool qemu_iovec_is_zero(QEMUIOVector *qiov);
+bool qemu_iovec_is_zero(QEMUIOVector *qiov, size_t qiov_offeset, size_t bytes);
 void qemu_iovec_destroy(QEMUIOVector *qiov);
 void qemu_iovec_reset(QEMUIOVector *qiov);
 size_t qemu_iovec_to_buf(QEMUIOVector *qiov, size_t offset,
diff --git a/block/io.c b/block/io.c
index 56bbf195bb..f656fb2dce 100644
--- a/block/io.c
+++ b/block/io.c
@@ -1722,7 +1722,7 @@ static int coroutine_fn bdrv_aligned_pwritev(BdrvChild *child,
 
     if (!ret && bs->detect_zeroes != BLOCKDEV_DETECT_ZEROES_OPTIONS_OFF &&
         !(flags & BDRV_REQ_ZERO_WRITE) && drv->bdrv_co_pwrite_zeroes &&
-        qemu_iovec_is_zero(qiov)) {
+        qemu_iovec_is_zero(qiov, 0, qiov->size)) {
         flags |= BDRV_REQ_ZERO_WRITE;
         if (bs->detect_zeroes == BLOCKDEV_DETECT_ZEROES_OPTIONS_UNMAP) {
             flags |= BDRV_REQ_MAY_UNMAP;
diff --git a/util/iov.c b/util/iov.c
index 366ff9cdd1..9ac0261853 100644
--- a/util/iov.c
+++ b/util/iov.c
@@ -451,23 +451,30 @@ void qemu_iovec_init_extended(
 }
 
 /*
- * Check if the contents of the iovecs are all zero
+ * Check if the contents of subrange of qiov data is all zeroes.
  */
-bool qemu_iovec_is_zero(QEMUIOVector *qiov)
+bool qemu_iovec_is_zero(QEMUIOVector *qiov, size_t offset, size_t bytes)
 {
-    int i;
-    for (i = 0; i < qiov->niov; i++) {
-        size_t offs = QEMU_ALIGN_DOWN(qiov->iov[i].iov_len, 4 * sizeof(long));
-        uint8_t *ptr = qiov->iov[i].iov_base;
-        if (offs && !buffer_is_zero(qiov->iov[i].iov_base, offs)) {
+    struct iovec *iov;
+    size_t current_offset;
+
+    assert(offset + bytes <= qiov->size);
+
+    iov = iov_skip_offset(qiov->iov, offset, &current_offset);
+
+    while (bytes) {
+        uint8_t *base = (uint8_t *)iov->iov_base + current_offset;
+        size_t len = MIN(iov->iov_len - current_offset, bytes);
+
+        if (!buffer_is_zero(base, len)) {
             return false;
         }
-        for (; offs < qiov->iov[i].iov_len; offs++) {
-            if (ptr[offs]) {
-                return false;
-            }
-        }
+
+        current_offset = 0;
+        bytes -= len;
+        iov++;
     }
+
     return true;
 }
 
-- 
2.21.0



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

* [Qemu-devel] [PULL 03/12] block/io: refactor padding
  2019-08-27 20:16 [Qemu-devel] [PULL 00/12] Block patches Stefan Hajnoczi
  2019-08-27 20:16 ` [Qemu-devel] [PULL 01/12] util/iov: introduce qemu_iovec_init_extended Stefan Hajnoczi
  2019-08-27 20:16 ` [Qemu-devel] [PULL 02/12] util/iov: improve qemu_iovec_is_zero Stefan Hajnoczi
@ 2019-08-27 20:16 ` Stefan Hajnoczi
  2019-08-27 20:16 ` [Qemu-devel] [PULL 04/12] block: define .*_part io handlers in BlockDriver Stefan Hajnoczi
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 40+ messages in thread
From: Stefan Hajnoczi @ 2019-08-27 20:16 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Kevin Wolf, Vladimir Sementsov-Ogievskiy, qemu-block,
	Peter Maydell, Max Reitz, Stefan Hajnoczi, John Snow

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

We have similar padding code in bdrv_co_pwritev,
bdrv_co_do_pwrite_zeroes and bdrv_co_preadv. Let's combine and unify
it.

[Squashed in Vladimir's qemu-iotests 077 fix
--Stefan]

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20190604161514.262241-4-vsementsov@virtuozzo.com
Message-Id: <20190604161514.262241-4-vsementsov@virtuozzo.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 block/io.c | 365 +++++++++++++++++++++++++++++------------------------
 1 file changed, 200 insertions(+), 165 deletions(-)

diff --git a/block/io.c b/block/io.c
index f656fb2dce..04e69400d8 100644
--- a/block/io.c
+++ b/block/io.c
@@ -1415,28 +1415,177 @@ out:
 }
 
 /*
- * Handle a read request in coroutine context
+ * Request padding
+ *
+ *  |<---- align ----->|                     |<----- align ---->|
+ *  |<- head ->|<------------- bytes ------------->|<-- tail -->|
+ *  |          |       |                     |     |            |
+ * -*----------$-------*-------- ... --------*-----$------------*---
+ *  |          |       |                     |     |            |
+ *  |          offset  |                     |     end          |
+ *  ALIGN_DOWN(offset) ALIGN_UP(offset)      ALIGN_DOWN(end)   ALIGN_UP(end)
+ *  [buf   ... )                             [tail_buf          )
+ *
+ * @buf is an aligned allocation needed to store @head and @tail paddings. @head
+ * is placed at the beginning of @buf and @tail at the @end.
+ *
+ * @tail_buf is a pointer to sub-buffer, corresponding to align-sized chunk
+ * around tail, if tail exists.
+ *
+ * @merge_reads is true for small requests,
+ * if @buf_len == @head + bytes + @tail. In this case it is possible that both
+ * head and tail exist but @buf_len == align and @tail_buf == @buf.
  */
+typedef struct BdrvRequestPadding {
+    uint8_t *buf;
+    size_t buf_len;
+    uint8_t *tail_buf;
+    size_t head;
+    size_t tail;
+    bool merge_reads;
+    QEMUIOVector local_qiov;
+} BdrvRequestPadding;
+
+static bool bdrv_init_padding(BlockDriverState *bs,
+                              int64_t offset, int64_t bytes,
+                              BdrvRequestPadding *pad)
+{
+    uint64_t align = bs->bl.request_alignment;
+    size_t sum;
+
+    memset(pad, 0, sizeof(*pad));
+
+    pad->head = offset & (align - 1);
+    pad->tail = ((offset + bytes) & (align - 1));
+    if (pad->tail) {
+        pad->tail = align - pad->tail;
+    }
+
+    if ((!pad->head && !pad->tail) || !bytes) {
+        return false;
+    }
+
+    sum = pad->head + bytes + pad->tail;
+    pad->buf_len = (sum > align && pad->head && pad->tail) ? 2 * align : align;
+    pad->buf = qemu_blockalign(bs, pad->buf_len);
+    pad->merge_reads = sum == pad->buf_len;
+    if (pad->tail) {
+        pad->tail_buf = pad->buf + pad->buf_len - align;
+    }
+
+    return true;
+}
+
+static int bdrv_padding_rmw_read(BdrvChild *child,
+                                 BdrvTrackedRequest *req,
+                                 BdrvRequestPadding *pad,
+                                 bool zero_middle)
+{
+    QEMUIOVector local_qiov;
+    BlockDriverState *bs = child->bs;
+    uint64_t align = bs->bl.request_alignment;
+    int ret;
+
+    assert(req->serialising && pad->buf);
+
+    if (pad->head || pad->merge_reads) {
+        uint64_t bytes = pad->merge_reads ? pad->buf_len : align;
+
+        qemu_iovec_init_buf(&local_qiov, pad->buf, bytes);
+
+        if (pad->head) {
+            bdrv_debug_event(bs, BLKDBG_PWRITEV_RMW_HEAD);
+        }
+        if (pad->merge_reads && pad->tail) {
+            bdrv_debug_event(bs, BLKDBG_PWRITEV_RMW_TAIL);
+        }
+        ret = bdrv_aligned_preadv(child, req, req->overlap_offset, bytes,
+                                  align, &local_qiov, 0);
+        if (ret < 0) {
+            return ret;
+        }
+        if (pad->head) {
+            bdrv_debug_event(bs, BLKDBG_PWRITEV_RMW_AFTER_HEAD);
+        }
+        if (pad->merge_reads && pad->tail) {
+            bdrv_debug_event(bs, BLKDBG_PWRITEV_RMW_AFTER_TAIL);
+        }
+
+        if (pad->merge_reads) {
+            goto zero_mem;
+        }
+    }
+
+    if (pad->tail) {
+        qemu_iovec_init_buf(&local_qiov, pad->tail_buf, align);
+
+        bdrv_debug_event(bs, BLKDBG_PWRITEV_RMW_TAIL);
+        ret = bdrv_aligned_preadv(
+                child, req,
+                req->overlap_offset + req->overlap_bytes - align,
+                align, align, &local_qiov, 0);
+        if (ret < 0) {
+            return ret;
+        }
+        bdrv_debug_event(bs, BLKDBG_PWRITEV_RMW_AFTER_TAIL);
+    }
+
+zero_mem:
+    if (zero_middle) {
+        memset(pad->buf + pad->head, 0, pad->buf_len - pad->head - pad->tail);
+    }
+
+    return 0;
+}
+
+static void bdrv_padding_destroy(BdrvRequestPadding *pad)
+{
+    if (pad->buf) {
+        qemu_vfree(pad->buf);
+        qemu_iovec_destroy(&pad->local_qiov);
+    }
+}
+
+/*
+ * bdrv_pad_request
+ *
+ * Exchange request parameters with padded request if needed. Don't include RMW
+ * read of padding, bdrv_padding_rmw_read() should be called separately if
+ * needed.
+ *
+ * All parameters except @bs are in-out: they represent original request at
+ * function call and padded (if padding needed) at function finish.
+ *
+ * Function always succeeds.
+ */
+static bool bdrv_pad_request(BlockDriverState *bs, QEMUIOVector **qiov,
+                             int64_t *offset, unsigned int *bytes,
+                             BdrvRequestPadding *pad)
+{
+    if (!bdrv_init_padding(bs, *offset, *bytes, pad)) {
+        return false;
+    }
+
+    qemu_iovec_init_extended(&pad->local_qiov, pad->buf, pad->head,
+                             *qiov, 0, *bytes,
+                             pad->buf + pad->buf_len - pad->tail, pad->tail);
+    *bytes += pad->head + pad->tail;
+    *offset -= pad->head;
+    *qiov = &pad->local_qiov;
+
+    return true;
+}
+
 int coroutine_fn bdrv_co_preadv(BdrvChild *child,
     int64_t offset, unsigned int bytes, QEMUIOVector *qiov,
     BdrvRequestFlags flags)
 {
     BlockDriverState *bs = child->bs;
-    BlockDriver *drv = bs->drv;
     BdrvTrackedRequest req;
-
-    uint64_t align = bs->bl.request_alignment;
-    uint8_t *head_buf = NULL;
-    uint8_t *tail_buf = NULL;
-    QEMUIOVector local_qiov;
-    bool use_local_qiov = false;
+    BdrvRequestPadding pad;
     int ret;
 
-    trace_bdrv_co_preadv(child->bs, offset, bytes, flags);
-
-    if (!drv) {
-        return -ENOMEDIUM;
-    }
+    trace_bdrv_co_preadv(bs, offset, bytes, flags);
 
     ret = bdrv_check_byte_request(bs, offset, bytes);
     if (ret < 0) {
@@ -1450,43 +1599,16 @@ int coroutine_fn bdrv_co_preadv(BdrvChild *child,
         flags |= BDRV_REQ_COPY_ON_READ;
     }
 
-    /* Align read if necessary by padding qiov */
-    if (offset & (align - 1)) {
-        head_buf = qemu_blockalign(bs, align);
-        qemu_iovec_init(&local_qiov, qiov->niov + 2);
-        qemu_iovec_add(&local_qiov, head_buf, offset & (align - 1));
-        qemu_iovec_concat(&local_qiov, qiov, 0, qiov->size);
-        use_local_qiov = true;
-
-        bytes += offset & (align - 1);
-        offset = offset & ~(align - 1);
-    }
-
-    if ((offset + bytes) & (align - 1)) {
-        if (!use_local_qiov) {
-            qemu_iovec_init(&local_qiov, qiov->niov + 1);
-            qemu_iovec_concat(&local_qiov, qiov, 0, qiov->size);
-            use_local_qiov = true;
-        }
-        tail_buf = qemu_blockalign(bs, align);
-        qemu_iovec_add(&local_qiov, tail_buf,
-                       align - ((offset + bytes) & (align - 1)));
-
-        bytes = ROUND_UP(bytes, align);
-    }
+    bdrv_pad_request(bs, &qiov, &offset, &bytes, &pad);
 
     tracked_request_begin(&req, bs, offset, bytes, BDRV_TRACKED_READ);
-    ret = bdrv_aligned_preadv(child, &req, offset, bytes, align,
-                              use_local_qiov ? &local_qiov : qiov,
-                              flags);
+    ret = bdrv_aligned_preadv(child, &req, offset, bytes,
+                              bs->bl.request_alignment,
+                              qiov, flags);
     tracked_request_end(&req);
     bdrv_dec_in_flight(bs);
 
-    if (use_local_qiov) {
-        qemu_iovec_destroy(&local_qiov);
-        qemu_vfree(head_buf);
-        qemu_vfree(tail_buf);
-    }
+    bdrv_padding_destroy(&pad);
 
     return ret;
 }
@@ -1782,44 +1904,34 @@ static int coroutine_fn bdrv_co_do_zero_pwritev(BdrvChild *child,
                                                 BdrvTrackedRequest *req)
 {
     BlockDriverState *bs = child->bs;
-    uint8_t *buf = NULL;
     QEMUIOVector local_qiov;
     uint64_t align = bs->bl.request_alignment;
-    unsigned int head_padding_bytes, tail_padding_bytes;
     int ret = 0;
+    bool padding;
+    BdrvRequestPadding pad;
 
-    head_padding_bytes = offset & (align - 1);
-    tail_padding_bytes = (align - (offset + bytes)) & (align - 1);
-
-
-    assert(flags & BDRV_REQ_ZERO_WRITE);
-    if (head_padding_bytes || tail_padding_bytes) {
-        buf = qemu_blockalign(bs, align);
-        qemu_iovec_init_buf(&local_qiov, buf, align);
-    }
-    if (head_padding_bytes) {
-        uint64_t zero_bytes = MIN(bytes, align - head_padding_bytes);
-
-        /* RMW the unaligned part before head. */
+    padding = bdrv_init_padding(bs, offset, bytes, &pad);
+    if (padding) {
         mark_request_serialising(req, align);
         wait_serialising_requests(req);
-        bdrv_debug_event(bs, BLKDBG_PWRITEV_RMW_HEAD);
-        ret = bdrv_aligned_preadv(child, req, offset & ~(align - 1), align,
-                                  align, &local_qiov, 0);
-        if (ret < 0) {
-            goto fail;
-        }
-        bdrv_debug_event(bs, BLKDBG_PWRITEV_RMW_AFTER_HEAD);
 
-        memset(buf + head_padding_bytes, 0, zero_bytes);
-        ret = bdrv_aligned_pwritev(child, req, offset & ~(align - 1), align,
-                                   align, &local_qiov,
-                                   flags & ~BDRV_REQ_ZERO_WRITE);
-        if (ret < 0) {
-            goto fail;
+        bdrv_padding_rmw_read(child, req, &pad, true);
+
+        if (pad.head || pad.merge_reads) {
+            int64_t aligned_offset = offset & ~(align - 1);
+            int64_t write_bytes = pad.merge_reads ? pad.buf_len : align;
+
+            qemu_iovec_init_buf(&local_qiov, pad.buf, write_bytes);
+            ret = bdrv_aligned_pwritev(child, req, aligned_offset, write_bytes,
+                                       align, &local_qiov,
+                                       flags & ~BDRV_REQ_ZERO_WRITE);
+            if (ret < 0 || pad.merge_reads) {
+                /* Error or all work is done */
+                goto out;
+            }
+            offset += write_bytes - pad.head;
+            bytes -= write_bytes - pad.head;
         }
-        offset += zero_bytes;
-        bytes -= zero_bytes;
     }
 
     assert(!bytes || (offset & (align - 1)) == 0);
@@ -1829,7 +1941,7 @@ static int coroutine_fn bdrv_co_do_zero_pwritev(BdrvChild *child,
         ret = bdrv_aligned_pwritev(child, req, offset, aligned_bytes, align,
                                    NULL, flags);
         if (ret < 0) {
-            goto fail;
+            goto out;
         }
         bytes -= aligned_bytes;
         offset += aligned_bytes;
@@ -1837,26 +1949,17 @@ static int coroutine_fn bdrv_co_do_zero_pwritev(BdrvChild *child,
 
     assert(!bytes || (offset & (align - 1)) == 0);
     if (bytes) {
-        assert(align == tail_padding_bytes + bytes);
-        /* RMW the unaligned part after tail. */
-        mark_request_serialising(req, align);
-        wait_serialising_requests(req);
-        bdrv_debug_event(bs, BLKDBG_PWRITEV_RMW_TAIL);
-        ret = bdrv_aligned_preadv(child, req, offset, align,
-                                  align, &local_qiov, 0);
-        if (ret < 0) {
-            goto fail;
-        }
-        bdrv_debug_event(bs, BLKDBG_PWRITEV_RMW_AFTER_TAIL);
+        assert(align == pad.tail + bytes);
 
-        memset(buf, 0, bytes);
+        qemu_iovec_init_buf(&local_qiov, pad.tail_buf, align);
         ret = bdrv_aligned_pwritev(child, req, offset, align, align,
                                    &local_qiov, flags & ~BDRV_REQ_ZERO_WRITE);
     }
-fail:
-    qemu_vfree(buf);
+
+out:
+    bdrv_padding_destroy(&pad);
+
     return ret;
-
 }
 
 /*
@@ -1869,10 +1972,7 @@ int coroutine_fn bdrv_co_pwritev(BdrvChild *child,
     BlockDriverState *bs = child->bs;
     BdrvTrackedRequest req;
     uint64_t align = bs->bl.request_alignment;
-    uint8_t *head_buf = NULL;
-    uint8_t *tail_buf = NULL;
-    QEMUIOVector local_qiov;
-    bool use_local_qiov = false;
+    BdrvRequestPadding pad;
     int ret;
 
     trace_bdrv_co_pwritev(child->bs, offset, bytes, flags);
@@ -1899,86 +1999,21 @@ int coroutine_fn bdrv_co_pwritev(BdrvChild *child,
         goto out;
     }
 
-    if (offset & (align - 1)) {
-        QEMUIOVector head_qiov;
-
+    if (bdrv_pad_request(bs, &qiov, &offset, &bytes, &pad)) {
         mark_request_serialising(&req, align);
         wait_serialising_requests(&req);
-
-        head_buf = qemu_blockalign(bs, align);
-        qemu_iovec_init_buf(&head_qiov, head_buf, align);
-
-        bdrv_debug_event(bs, BLKDBG_PWRITEV_RMW_HEAD);
-        ret = bdrv_aligned_preadv(child, &req, offset & ~(align - 1), align,
-                                  align, &head_qiov, 0);
-        if (ret < 0) {
-            goto fail;
-        }
-        bdrv_debug_event(bs, BLKDBG_PWRITEV_RMW_AFTER_HEAD);
-
-        qemu_iovec_init(&local_qiov, qiov->niov + 2);
-        qemu_iovec_add(&local_qiov, head_buf, offset & (align - 1));
-        qemu_iovec_concat(&local_qiov, qiov, 0, qiov->size);
-        use_local_qiov = true;
-
-        bytes += offset & (align - 1);
-        offset = offset & ~(align - 1);
-
-        /* We have read the tail already if the request is smaller
-         * than one aligned block.
-         */
-        if (bytes < align) {
-            qemu_iovec_add(&local_qiov, head_buf + bytes, align - bytes);
-            bytes = align;
-        }
-    }
-
-    if ((offset + bytes) & (align - 1)) {
-        QEMUIOVector tail_qiov;
-        size_t tail_bytes;
-        bool waited;
-
-        mark_request_serialising(&req, align);
-        waited = wait_serialising_requests(&req);
-        assert(!waited || !use_local_qiov);
-
-        tail_buf = qemu_blockalign(bs, align);
-        qemu_iovec_init_buf(&tail_qiov, tail_buf, align);
-
-        bdrv_debug_event(bs, BLKDBG_PWRITEV_RMW_TAIL);
-        ret = bdrv_aligned_preadv(child, &req, (offset + bytes) & ~(align - 1),
-                                  align, align, &tail_qiov, 0);
-        if (ret < 0) {
-            goto fail;
-        }
-        bdrv_debug_event(bs, BLKDBG_PWRITEV_RMW_AFTER_TAIL);
-
-        if (!use_local_qiov) {
-            qemu_iovec_init(&local_qiov, qiov->niov + 1);
-            qemu_iovec_concat(&local_qiov, qiov, 0, qiov->size);
-            use_local_qiov = true;
-        }
-
-        tail_bytes = (offset + bytes) & (align - 1);
-        qemu_iovec_add(&local_qiov, tail_buf + tail_bytes, align - tail_bytes);
-
-        bytes = ROUND_UP(bytes, align);
+        bdrv_padding_rmw_read(child, &req, &pad, false);
     }
 
     ret = bdrv_aligned_pwritev(child, &req, offset, bytes, align,
-                               use_local_qiov ? &local_qiov : qiov,
-                               flags);
+                               qiov, flags);
 
-fail:
+    bdrv_padding_destroy(&pad);
 
-    if (use_local_qiov) {
-        qemu_iovec_destroy(&local_qiov);
-    }
-    qemu_vfree(head_buf);
-    qemu_vfree(tail_buf);
 out:
     tracked_request_end(&req);
     bdrv_dec_in_flight(bs);
+
     return ret;
 }
 
-- 
2.21.0



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

* [Qemu-devel] [PULL 04/12] block: define .*_part io handlers in BlockDriver
  2019-08-27 20:16 [Qemu-devel] [PULL 00/12] Block patches Stefan Hajnoczi
                   ` (2 preceding siblings ...)
  2019-08-27 20:16 ` [Qemu-devel] [PULL 03/12] block/io: refactor padding Stefan Hajnoczi
@ 2019-08-27 20:16 ` Stefan Hajnoczi
  2019-08-27 20:16 ` [Qemu-devel] [PULL 05/12] block/io: bdrv_co_do_copy_on_readv: use and support qiov_offset Stefan Hajnoczi
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 40+ messages in thread
From: Stefan Hajnoczi @ 2019-08-27 20:16 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Kevin Wolf, Vladimir Sementsov-Ogievskiy, qemu-block,
	Peter Maydell, Max Reitz, Stefan Hajnoczi, John Snow

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

Add handlers supporting qiov_offset parameter:
    bdrv_co_preadv_part
    bdrv_co_pwritev_part
    bdrv_co_pwritev_compressed_part
This is used to reduce need of defining local_qiovs and hd_qiovs in all
corners of block layer code. The following patches will increase usage
of this new API part by part.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20190604161514.262241-5-vsementsov@virtuozzo.com
Message-Id: <20190604161514.262241-5-vsementsov@virtuozzo.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 include/block/block_int.h | 15 ++++++
 block/backup.c            |  2 +-
 block/io.c                | 96 +++++++++++++++++++++++++++++++--------
 qemu-img.c                |  4 +-
 4 files changed, 95 insertions(+), 22 deletions(-)

diff --git a/include/block/block_int.h b/include/block/block_int.h
index ceec8c2f56..79a1fdb258 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -210,6 +210,9 @@ struct BlockDriver {
      */
     int coroutine_fn (*bdrv_co_preadv)(BlockDriverState *bs,
         uint64_t offset, uint64_t bytes, QEMUIOVector *qiov, int flags);
+    int coroutine_fn (*bdrv_co_preadv_part)(BlockDriverState *bs,
+        uint64_t offset, uint64_t bytes,
+        QEMUIOVector *qiov, size_t qiov_offset, int flags);
     int coroutine_fn (*bdrv_co_writev)(BlockDriverState *bs,
         int64_t sector_num, int nb_sectors, QEMUIOVector *qiov, int flags);
     /**
@@ -229,6 +232,9 @@ struct BlockDriver {
      */
     int coroutine_fn (*bdrv_co_pwritev)(BlockDriverState *bs,
         uint64_t offset, uint64_t bytes, QEMUIOVector *qiov, int flags);
+    int coroutine_fn (*bdrv_co_pwritev_part)(BlockDriverState *bs,
+        uint64_t offset, uint64_t bytes,
+        QEMUIOVector *qiov, size_t qiov_offset, int flags);
 
     /*
      * Efficiently zero a region of the disk image.  Typically an image format
@@ -339,6 +345,9 @@ struct BlockDriver {
 
     int coroutine_fn (*bdrv_co_pwritev_compressed)(BlockDriverState *bs,
         uint64_t offset, uint64_t bytes, QEMUIOVector *qiov);
+    int coroutine_fn (*bdrv_co_pwritev_compressed_part)(BlockDriverState *bs,
+        uint64_t offset, uint64_t bytes, QEMUIOVector *qiov,
+        size_t qiov_offset);
 
     int (*bdrv_snapshot_create)(BlockDriverState *bs,
                                 QEMUSnapshotInfo *sn_info);
@@ -570,6 +579,12 @@ struct BlockDriver {
     const char *const *strong_runtime_opts;
 };
 
+static inline bool block_driver_can_compress(BlockDriver *drv)
+{
+    return drv->bdrv_co_pwritev_compressed ||
+           drv->bdrv_co_pwritev_compressed_part;
+}
+
 typedef struct BlockLimits {
     /* Alignment requirement, in bytes, for offset/length of I/O
      * requests. Must be a power of 2 less than INT_MAX; defaults to
diff --git a/block/backup.c b/block/backup.c
index 2baf7bed65..03637aeb11 100644
--- a/block/backup.c
+++ b/block/backup.c
@@ -674,7 +674,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
         return NULL;
     }
 
-    if (compress && target->drv->bdrv_co_pwritev_compressed == NULL) {
+    if (compress && !block_driver_can_compress(target->drv)) {
         error_setg(errp, "Compression is not supported for this drive %s",
                    bdrv_get_device_name(target));
         return NULL;
diff --git a/block/io.c b/block/io.c
index 04e69400d8..fd2fc7d5ff 100644
--- a/block/io.c
+++ b/block/io.c
@@ -146,7 +146,8 @@ void bdrv_refresh_limits(BlockDriverState *bs, Error **errp)
 
     /* Default alignment based on whether driver has byte interface */
     bs->bl.request_alignment = (drv->bdrv_co_preadv ||
-                                drv->bdrv_aio_preadv) ? 1 : 512;
+                                drv->bdrv_aio_preadv ||
+                                drv->bdrv_co_preadv_part) ? 1 : 512;
 
     /* Take some limits from the children as a default */
     if (bs->file) {
@@ -1044,11 +1045,14 @@ static void bdrv_co_io_em_complete(void *opaque, int ret)
 
 static int coroutine_fn bdrv_driver_preadv(BlockDriverState *bs,
                                            uint64_t offset, uint64_t bytes,
-                                           QEMUIOVector *qiov, int flags)
+                                           QEMUIOVector *qiov,
+                                           size_t qiov_offset, int flags)
 {
     BlockDriver *drv = bs->drv;
     int64_t sector_num;
     unsigned int nb_sectors;
+    QEMUIOVector local_qiov;
+    int ret;
 
     assert(!(flags & ~BDRV_REQ_MASK));
     assert(!(flags & BDRV_REQ_NO_FALLBACK));
@@ -1057,8 +1061,19 @@ static int coroutine_fn bdrv_driver_preadv(BlockDriverState *bs,
         return -ENOMEDIUM;
     }
 
+    if (drv->bdrv_co_preadv_part) {
+        return drv->bdrv_co_preadv_part(bs, offset, bytes, qiov, qiov_offset,
+                                        flags);
+    }
+
+    if (qiov_offset > 0 || bytes != qiov->size) {
+        qemu_iovec_init_slice(&local_qiov, qiov, qiov_offset, bytes);
+        qiov = &local_qiov;
+    }
+
     if (drv->bdrv_co_preadv) {
-        return drv->bdrv_co_preadv(bs, offset, bytes, qiov, flags);
+        ret = drv->bdrv_co_preadv(bs, offset, bytes, qiov, flags);
+        goto out;
     }
 
     if (drv->bdrv_aio_preadv) {
@@ -1070,10 +1085,12 @@ static int coroutine_fn bdrv_driver_preadv(BlockDriverState *bs,
         acb = drv->bdrv_aio_preadv(bs, offset, bytes, qiov, flags,
                                    bdrv_co_io_em_complete, &co);
         if (acb == NULL) {
-            return -EIO;
+            ret = -EIO;
+            goto out;
         } else {
             qemu_coroutine_yield();
-            return co.ret;
+            ret = co.ret;
+            goto out;
         }
     }
 
@@ -1085,16 +1102,25 @@ static int coroutine_fn bdrv_driver_preadv(BlockDriverState *bs,
     assert(bytes <= BDRV_REQUEST_MAX_BYTES);
     assert(drv->bdrv_co_readv);
 
-    return drv->bdrv_co_readv(bs, sector_num, nb_sectors, qiov);
+    ret = drv->bdrv_co_readv(bs, sector_num, nb_sectors, qiov);
+
+out:
+    if (qiov == &local_qiov) {
+        qemu_iovec_destroy(&local_qiov);
+    }
+
+    return ret;
 }
 
 static int coroutine_fn bdrv_driver_pwritev(BlockDriverState *bs,
                                             uint64_t offset, uint64_t bytes,
-                                            QEMUIOVector *qiov, int flags)
+                                            QEMUIOVector *qiov,
+                                            size_t qiov_offset, int flags)
 {
     BlockDriver *drv = bs->drv;
     int64_t sector_num;
     unsigned int nb_sectors;
+    QEMUIOVector local_qiov;
     int ret;
 
     assert(!(flags & ~BDRV_REQ_MASK));
@@ -1104,6 +1130,18 @@ static int coroutine_fn bdrv_driver_pwritev(BlockDriverState *bs,
         return -ENOMEDIUM;
     }
 
+    if (drv->bdrv_co_pwritev_part) {
+        ret = drv->bdrv_co_pwritev_part(bs, offset, bytes, qiov, qiov_offset,
+                                        flags & bs->supported_write_flags);
+        flags &= ~bs->supported_write_flags;
+        goto emulate_flags;
+    }
+
+    if (qiov_offset > 0 || bytes != qiov->size) {
+        qemu_iovec_init_slice(&local_qiov, qiov, qiov_offset, bytes);
+        qiov = &local_qiov;
+    }
+
     if (drv->bdrv_co_pwritev) {
         ret = drv->bdrv_co_pwritev(bs, offset, bytes, qiov,
                                    flags & bs->supported_write_flags);
@@ -1147,24 +1185,44 @@ emulate_flags:
         ret = bdrv_co_flush(bs);
     }
 
+    if (qiov == &local_qiov) {
+        qemu_iovec_destroy(&local_qiov);
+    }
+
     return ret;
 }
 
 static int coroutine_fn
 bdrv_driver_pwritev_compressed(BlockDriverState *bs, uint64_t offset,
-                               uint64_t bytes, QEMUIOVector *qiov)
+                               uint64_t bytes, QEMUIOVector *qiov,
+                               size_t qiov_offset)
 {
     BlockDriver *drv = bs->drv;
+    QEMUIOVector local_qiov;
+    int ret;
 
     if (!drv) {
         return -ENOMEDIUM;
     }
 
-    if (!drv->bdrv_co_pwritev_compressed) {
+    if (!block_driver_can_compress(drv)) {
         return -ENOTSUP;
     }
 
-    return drv->bdrv_co_pwritev_compressed(bs, offset, bytes, qiov);
+    if (drv->bdrv_co_pwritev_compressed_part) {
+        return drv->bdrv_co_pwritev_compressed_part(bs, offset, bytes,
+                                                    qiov, qiov_offset);
+    }
+
+    if (qiov_offset == 0) {
+        return drv->bdrv_co_pwritev_compressed(bs, offset, bytes, qiov);
+    }
+
+    qemu_iovec_init_slice(&local_qiov, qiov, qiov_offset, bytes);
+    ret = drv->bdrv_co_pwritev_compressed(bs, offset, bytes, &local_qiov);
+    qemu_iovec_destroy(&local_qiov);
+
+    return ret;
 }
 
 static int coroutine_fn bdrv_co_do_copy_on_readv(BdrvChild *child,
@@ -1249,7 +1307,7 @@ static int coroutine_fn bdrv_co_do_copy_on_readv(BdrvChild *child,
             qemu_iovec_init_buf(&local_qiov, bounce_buffer, pnum);
 
             ret = bdrv_driver_preadv(bs, cluster_offset, pnum,
-                                     &local_qiov, 0);
+                                     &local_qiov, 0, 0);
             if (ret < 0) {
                 goto err;
             }
@@ -1267,7 +1325,7 @@ static int coroutine_fn bdrv_co_do_copy_on_readv(BdrvChild *child,
                  * necessary to flush even in cache=writethrough mode.
                  */
                 ret = bdrv_driver_pwritev(bs, cluster_offset, pnum,
-                                          &local_qiov,
+                                          &local_qiov, 0,
                                           BDRV_REQ_WRITE_UNCHANGED);
             }
 
@@ -1289,7 +1347,7 @@ static int coroutine_fn bdrv_co_do_copy_on_readv(BdrvChild *child,
             qemu_iovec_init(&local_qiov, qiov->niov);
             qemu_iovec_concat(&local_qiov, qiov, progress, pnum - skip_bytes);
             ret = bdrv_driver_preadv(bs, offset + progress, local_qiov.size,
-                                     &local_qiov, 0);
+                                     &local_qiov, 0, 0);
             qemu_iovec_destroy(&local_qiov);
             if (ret < 0) {
                 goto err;
@@ -1380,7 +1438,7 @@ static int coroutine_fn bdrv_aligned_preadv(BdrvChild *child,
 
     max_bytes = ROUND_UP(MAX(0, total_bytes - offset), align);
     if (bytes <= max_bytes && bytes <= max_transfer) {
-        ret = bdrv_driver_preadv(bs, offset, bytes, qiov, 0);
+        ret = bdrv_driver_preadv(bs, offset, bytes, qiov, 0, 0);
         goto out;
     }
 
@@ -1396,7 +1454,7 @@ static int coroutine_fn bdrv_aligned_preadv(BdrvChild *child,
             qemu_iovec_concat(&local_qiov, qiov, bytes - bytes_remaining, num);
 
             ret = bdrv_driver_preadv(bs, offset + bytes - bytes_remaining,
-                                     num, &local_qiov, 0);
+                                     num, &local_qiov, 0, 0);
             max_bytes -= num;
             qemu_iovec_destroy(&local_qiov);
         } else {
@@ -1701,7 +1759,7 @@ static int coroutine_fn bdrv_co_do_pwrite_zeroes(BlockDriverState *bs,
             }
             qemu_iovec_init_buf(&qiov, buf, num);
 
-            ret = bdrv_driver_pwritev(bs, offset, num, &qiov, write_flags);
+            ret = bdrv_driver_pwritev(bs, offset, num, &qiov, 0, write_flags);
 
             /* Keep bounce buffer around if it is big enough for all
              * all future requests.
@@ -1857,10 +1915,10 @@ static int coroutine_fn bdrv_aligned_pwritev(BdrvChild *child,
         bdrv_debug_event(bs, BLKDBG_PWRITEV_ZERO);
         ret = bdrv_co_do_pwrite_zeroes(bs, offset, bytes, flags);
     } else if (flags & BDRV_REQ_WRITE_COMPRESSED) {
-        ret = bdrv_driver_pwritev_compressed(bs, offset, bytes, qiov);
+        ret = bdrv_driver_pwritev_compressed(bs, offset, bytes, qiov, 0);
     } else if (bytes <= max_transfer) {
         bdrv_debug_event(bs, BLKDBG_PWRITEV);
-        ret = bdrv_driver_pwritev(bs, offset, bytes, qiov, flags);
+        ret = bdrv_driver_pwritev(bs, offset, bytes, qiov, 0, flags);
     } else {
         bdrv_debug_event(bs, BLKDBG_PWRITEV);
         while (bytes_remaining) {
@@ -1879,7 +1937,7 @@ static int coroutine_fn bdrv_aligned_pwritev(BdrvChild *child,
             qemu_iovec_concat(&local_qiov, qiov, bytes - bytes_remaining, num);
 
             ret = bdrv_driver_pwritev(bs, offset + bytes - bytes_remaining,
-                                      num, &local_qiov, local_flags);
+                                      num, &local_qiov, 0, local_flags);
             qemu_iovec_destroy(&local_qiov);
             if (ret < 0) {
                 break;
diff --git a/qemu-img.c b/qemu-img.c
index 7daa05e51a..4ee436fc94 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -2388,7 +2388,7 @@ static int img_convert(int argc, char **argv)
         const char *preallocation =
             qemu_opt_get(opts, BLOCK_OPT_PREALLOC);
 
-        if (drv && !drv->bdrv_co_pwritev_compressed) {
+        if (drv && !block_driver_can_compress(drv)) {
             error_report("Compression not supported for this file format");
             ret = -1;
             goto out;
@@ -2459,7 +2459,7 @@ static int img_convert(int argc, char **argv)
     }
     out_bs = blk_bs(s.target);
 
-    if (s.compressed && !out_bs->drv->bdrv_co_pwritev_compressed) {
+    if (s.compressed && !block_driver_can_compress(out_bs->drv)) {
         error_report("Compression not supported for this file format");
         ret = -1;
         goto out;
-- 
2.21.0



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

* [Qemu-devel] [PULL 05/12] block/io: bdrv_co_do_copy_on_readv: use and support qiov_offset
  2019-08-27 20:16 [Qemu-devel] [PULL 00/12] Block patches Stefan Hajnoczi
                   ` (3 preceding siblings ...)
  2019-08-27 20:16 ` [Qemu-devel] [PULL 04/12] block: define .*_part io handlers in BlockDriver Stefan Hajnoczi
@ 2019-08-27 20:16 ` Stefan Hajnoczi
  2019-08-27 20:16 ` [Qemu-devel] [PULL 06/12] block/io: bdrv_co_do_copy_on_readv: lazy allocation Stefan Hajnoczi
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 40+ messages in thread
From: Stefan Hajnoczi @ 2019-08-27 20:16 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Kevin Wolf, Vladimir Sementsov-Ogievskiy, qemu-block,
	Peter Maydell, Max Reitz, Stefan Hajnoczi, John Snow

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

Use and support new API in bdrv_co_do_copy_on_readv. Note that in case
of allocated-in-top we need to shrink read size to MIN(..) by hand, as
pre-patch this was actually done implicitly by qemu_iovec_concat (and
we used local_qiov.size).

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20190604161514.262241-6-vsementsov@virtuozzo.com
Message-Id: <20190604161514.262241-6-vsementsov@virtuozzo.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 block/io.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/block/io.c b/block/io.c
index fd2fc7d5ff..5817bb9405 100644
--- a/block/io.c
+++ b/block/io.c
@@ -1227,7 +1227,7 @@ bdrv_driver_pwritev_compressed(BlockDriverState *bs, uint64_t offset,
 
 static int coroutine_fn bdrv_co_do_copy_on_readv(BdrvChild *child,
         int64_t offset, unsigned int bytes, QEMUIOVector *qiov,
-        int flags)
+        size_t qiov_offset, int flags)
 {
     BlockDriverState *bs = child->bs;
 
@@ -1239,7 +1239,6 @@ static int coroutine_fn bdrv_co_do_copy_on_readv(BdrvChild *child,
     void *bounce_buffer;
 
     BlockDriver *drv = bs->drv;
-    QEMUIOVector local_qiov;
     int64_t cluster_offset;
     int64_t cluster_bytes;
     size_t skip_bytes;
@@ -1302,6 +1301,8 @@ static int coroutine_fn bdrv_co_do_copy_on_readv(BdrvChild *child,
         assert(skip_bytes < pnum);
 
         if (ret <= 0) {
+            QEMUIOVector local_qiov;
+
             /* Must copy-on-read; use the bounce buffer */
             pnum = MIN(pnum, MAX_BOUNCE_BUFFER);
             qemu_iovec_init_buf(&local_qiov, bounce_buffer, pnum);
@@ -1339,16 +1340,15 @@ static int coroutine_fn bdrv_co_do_copy_on_readv(BdrvChild *child,
             }
 
             if (!(flags & BDRV_REQ_PREFETCH)) {
-                qemu_iovec_from_buf(qiov, progress, bounce_buffer + skip_bytes,
+                qemu_iovec_from_buf(qiov, qiov_offset + progress,
+                                    bounce_buffer + skip_bytes,
                                     pnum - skip_bytes);
             }
         } else if (!(flags & BDRV_REQ_PREFETCH)) {
             /* Read directly into the destination */
-            qemu_iovec_init(&local_qiov, qiov->niov);
-            qemu_iovec_concat(&local_qiov, qiov, progress, pnum - skip_bytes);
-            ret = bdrv_driver_preadv(bs, offset + progress, local_qiov.size,
-                                     &local_qiov, 0, 0);
-            qemu_iovec_destroy(&local_qiov);
+            ret = bdrv_driver_preadv(bs, offset + progress,
+                                     MIN(pnum - skip_bytes, bytes - progress),
+                                     qiov, qiov_offset + progress, 0);
             if (ret < 0) {
                 goto err;
             }
@@ -1422,7 +1422,7 @@ static int coroutine_fn bdrv_aligned_preadv(BdrvChild *child,
         }
 
         if (!ret || pnum != bytes) {
-            ret = bdrv_co_do_copy_on_readv(child, offset, bytes, qiov, flags);
+            ret = bdrv_co_do_copy_on_readv(child, offset, bytes, qiov, 0, flags);
             goto out;
         } else if (flags & BDRV_REQ_PREFETCH) {
             goto out;
-- 
2.21.0



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

* [Qemu-devel] [PULL 06/12] block/io: bdrv_co_do_copy_on_readv: lazy allocation
  2019-08-27 20:16 [Qemu-devel] [PULL 00/12] Block patches Stefan Hajnoczi
                   ` (4 preceding siblings ...)
  2019-08-27 20:16 ` [Qemu-devel] [PULL 05/12] block/io: bdrv_co_do_copy_on_readv: use and support qiov_offset Stefan Hajnoczi
@ 2019-08-27 20:16 ` Stefan Hajnoczi
  2019-08-27 20:16 ` [Qemu-devel] [PULL 07/12] block/io: bdrv_aligned_preadv: use and support qiov_offset Stefan Hajnoczi
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 40+ messages in thread
From: Stefan Hajnoczi @ 2019-08-27 20:16 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Kevin Wolf, Vladimir Sementsov-Ogievskiy, qemu-block,
	Peter Maydell, Max Reitz, Stefan Hajnoczi, John Snow

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

Allocate bounce_buffer only if it is really needed. Also, sub-optimize
allocation size (why not?).

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20190604161514.262241-7-vsementsov@virtuozzo.com
Message-Id: <20190604161514.262241-7-vsementsov@virtuozzo.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 block/io.c | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/block/io.c b/block/io.c
index 5817bb9405..4c7a7ac7b1 100644
--- a/block/io.c
+++ b/block/io.c
@@ -1236,7 +1236,7 @@ static int coroutine_fn bdrv_co_do_copy_on_readv(BdrvChild *child,
      * modifying the image file.  This is critical for zero-copy guest I/O
      * where anything might happen inside guest memory.
      */
-    void *bounce_buffer;
+    void *bounce_buffer = NULL;
 
     BlockDriver *drv = bs->drv;
     int64_t cluster_offset;
@@ -1271,14 +1271,6 @@ static int coroutine_fn bdrv_co_do_copy_on_readv(BdrvChild *child,
     trace_bdrv_co_do_copy_on_readv(bs, offset, bytes,
                                    cluster_offset, cluster_bytes);
 
-    bounce_buffer = qemu_try_blockalign(bs,
-                                        MIN(MIN(max_transfer, cluster_bytes),
-                                            MAX_BOUNCE_BUFFER));
-    if (bounce_buffer == NULL) {
-        ret = -ENOMEM;
-        goto err;
-    }
-
     while (cluster_bytes) {
         int64_t pnum;
 
@@ -1305,6 +1297,17 @@ static int coroutine_fn bdrv_co_do_copy_on_readv(BdrvChild *child,
 
             /* Must copy-on-read; use the bounce buffer */
             pnum = MIN(pnum, MAX_BOUNCE_BUFFER);
+            if (!bounce_buffer) {
+                int64_t max_we_need = MAX(pnum, cluster_bytes - pnum);
+                int64_t max_allowed = MIN(max_transfer, MAX_BOUNCE_BUFFER);
+                int64_t bounce_buffer_len = MIN(max_we_need, max_allowed);
+
+                bounce_buffer = qemu_try_blockalign(bs, bounce_buffer_len);
+                if (!bounce_buffer) {
+                    ret = -ENOMEM;
+                    goto err;
+                }
+            }
             qemu_iovec_init_buf(&local_qiov, bounce_buffer, pnum);
 
             ret = bdrv_driver_preadv(bs, cluster_offset, pnum,
-- 
2.21.0



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

* [Qemu-devel] [PULL 07/12] block/io: bdrv_aligned_preadv: use and support qiov_offset
  2019-08-27 20:16 [Qemu-devel] [PULL 00/12] Block patches Stefan Hajnoczi
                   ` (5 preceding siblings ...)
  2019-08-27 20:16 ` [Qemu-devel] [PULL 06/12] block/io: bdrv_co_do_copy_on_readv: lazy allocation Stefan Hajnoczi
@ 2019-08-27 20:16 ` Stefan Hajnoczi
  2019-08-27 20:16 ` [Qemu-devel] [PULL 08/12] block/io: bdrv_aligned_pwritev: " Stefan Hajnoczi
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 40+ messages in thread
From: Stefan Hajnoczi @ 2019-08-27 20:16 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Kevin Wolf, Vladimir Sementsov-Ogievskiy, qemu-block,
	Peter Maydell, Max Reitz, Stefan Hajnoczi, John Snow

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

Use and support new API in bdrv_co_do_copy_on_readv.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20190604161514.262241-8-vsementsov@virtuozzo.com
Message-Id: <20190604161514.262241-8-vsementsov@virtuozzo.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 block/io.c | 21 ++++++++-------------
 1 file changed, 8 insertions(+), 13 deletions(-)

diff --git a/block/io.c b/block/io.c
index 4c7a7ac7b1..f191a3fa1e 100644
--- a/block/io.c
+++ b/block/io.c
@@ -1376,7 +1376,7 @@ err:
  */
 static int coroutine_fn bdrv_aligned_preadv(BdrvChild *child,
     BdrvTrackedRequest *req, int64_t offset, unsigned int bytes,
-    int64_t align, QEMUIOVector *qiov, int flags)
+    int64_t align, QEMUIOVector *qiov, size_t qiov_offset, int flags)
 {
     BlockDriverState *bs = child->bs;
     int64_t total_bytes, max_bytes;
@@ -1387,7 +1387,6 @@ static int coroutine_fn bdrv_aligned_preadv(BdrvChild *child,
     assert(is_power_of_2(align));
     assert((offset & (align - 1)) == 0);
     assert((bytes & (align - 1)) == 0);
-    assert(!qiov || bytes == qiov->size);
     assert((bs->open_flags & BDRV_O_NO_IO) == 0);
     max_transfer = QEMU_ALIGN_DOWN(MIN_NON_ZERO(bs->bl.max_transfer, INT_MAX),
                                    align);
@@ -1425,7 +1424,8 @@ static int coroutine_fn bdrv_aligned_preadv(BdrvChild *child,
         }
 
         if (!ret || pnum != bytes) {
-            ret = bdrv_co_do_copy_on_readv(child, offset, bytes, qiov, 0, flags);
+            ret = bdrv_co_do_copy_on_readv(child, offset, bytes,
+                                           qiov, qiov_offset, flags);
             goto out;
         } else if (flags & BDRV_REQ_PREFETCH) {
             goto out;
@@ -1441,7 +1441,7 @@ static int coroutine_fn bdrv_aligned_preadv(BdrvChild *child,
 
     max_bytes = ROUND_UP(MAX(0, total_bytes - offset), align);
     if (bytes <= max_bytes && bytes <= max_transfer) {
-        ret = bdrv_driver_preadv(bs, offset, bytes, qiov, 0, 0);
+        ret = bdrv_driver_preadv(bs, offset, bytes, qiov, qiov_offset, 0);
         goto out;
     }
 
@@ -1449,17 +1449,12 @@ static int coroutine_fn bdrv_aligned_preadv(BdrvChild *child,
         int num;
 
         if (max_bytes) {
-            QEMUIOVector local_qiov;
-
             num = MIN(bytes_remaining, MIN(max_bytes, max_transfer));
             assert(num);
-            qemu_iovec_init(&local_qiov, qiov->niov);
-            qemu_iovec_concat(&local_qiov, qiov, bytes - bytes_remaining, num);
 
             ret = bdrv_driver_preadv(bs, offset + bytes - bytes_remaining,
-                                     num, &local_qiov, 0, 0);
+                                     num, qiov, bytes - bytes_remaining, 0);
             max_bytes -= num;
-            qemu_iovec_destroy(&local_qiov);
         } else {
             num = bytes_remaining;
             ret = qemu_iovec_memset(qiov, bytes - bytes_remaining, 0,
@@ -1561,7 +1556,7 @@ static int bdrv_padding_rmw_read(BdrvChild *child,
             bdrv_debug_event(bs, BLKDBG_PWRITEV_RMW_TAIL);
         }
         ret = bdrv_aligned_preadv(child, req, req->overlap_offset, bytes,
-                                  align, &local_qiov, 0);
+                                  align, &local_qiov, 0, 0);
         if (ret < 0) {
             return ret;
         }
@@ -1584,7 +1579,7 @@ static int bdrv_padding_rmw_read(BdrvChild *child,
         ret = bdrv_aligned_preadv(
                 child, req,
                 req->overlap_offset + req->overlap_bytes - align,
-                align, align, &local_qiov, 0);
+                align, align, &local_qiov, 0, 0);
         if (ret < 0) {
             return ret;
         }
@@ -1665,7 +1660,7 @@ int coroutine_fn bdrv_co_preadv(BdrvChild *child,
     tracked_request_begin(&req, bs, offset, bytes, BDRV_TRACKED_READ);
     ret = bdrv_aligned_preadv(child, &req, offset, bytes,
                               bs->bl.request_alignment,
-                              qiov, flags);
+                              qiov, 0, flags);
     tracked_request_end(&req);
     bdrv_dec_in_flight(bs);
 
-- 
2.21.0



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

* [Qemu-devel] [PULL 08/12] block/io: bdrv_aligned_pwritev: use and support qiov_offset
  2019-08-27 20:16 [Qemu-devel] [PULL 00/12] Block patches Stefan Hajnoczi
                   ` (6 preceding siblings ...)
  2019-08-27 20:16 ` [Qemu-devel] [PULL 07/12] block/io: bdrv_aligned_preadv: use and support qiov_offset Stefan Hajnoczi
@ 2019-08-27 20:16 ` Stefan Hajnoczi
  2019-08-27 20:16 ` [Qemu-devel] [PULL 09/12] block/io: introduce bdrv_co_p{read, write}v_part Stefan Hajnoczi
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 40+ messages in thread
From: Stefan Hajnoczi @ 2019-08-27 20:16 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Kevin Wolf, Vladimir Sementsov-Ogievskiy, qemu-block,
	Peter Maydell, Max Reitz, Stefan Hajnoczi, John Snow

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

Use and support new API in bdrv_aligned_pwritev.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20190604161514.262241-9-vsementsov@virtuozzo.com
Message-Id: <20190604161514.262241-9-vsementsov@virtuozzo.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 block/io.c | 27 +++++++++++++--------------
 1 file changed, 13 insertions(+), 14 deletions(-)

diff --git a/block/io.c b/block/io.c
index f191a3fa1e..237d7f40f5 100644
--- a/block/io.c
+++ b/block/io.c
@@ -1872,7 +1872,7 @@ bdrv_co_write_req_finish(BdrvChild *child, int64_t offset, uint64_t bytes,
  */
 static int coroutine_fn bdrv_aligned_pwritev(BdrvChild *child,
     BdrvTrackedRequest *req, int64_t offset, unsigned int bytes,
-    int64_t align, QEMUIOVector *qiov, int flags)
+    int64_t align, QEMUIOVector *qiov, size_t qiov_offset, int flags)
 {
     BlockDriverState *bs = child->bs;
     BlockDriver *drv = bs->drv;
@@ -1892,7 +1892,7 @@ static int coroutine_fn bdrv_aligned_pwritev(BdrvChild *child,
     assert(is_power_of_2(align));
     assert((offset & (align - 1)) == 0);
     assert((bytes & (align - 1)) == 0);
-    assert(!qiov || bytes == qiov->size);
+    assert(!qiov || qiov_offset + bytes <= qiov->size);
     max_transfer = QEMU_ALIGN_DOWN(MIN_NON_ZERO(bs->bl.max_transfer, INT_MAX),
                                    align);
 
@@ -1900,7 +1900,7 @@ static int coroutine_fn bdrv_aligned_pwritev(BdrvChild *child,
 
     if (!ret && bs->detect_zeroes != BLOCKDEV_DETECT_ZEROES_OPTIONS_OFF &&
         !(flags & BDRV_REQ_ZERO_WRITE) && drv->bdrv_co_pwrite_zeroes &&
-        qemu_iovec_is_zero(qiov, 0, qiov->size)) {
+        qemu_iovec_is_zero(qiov, qiov_offset, bytes)) {
         flags |= BDRV_REQ_ZERO_WRITE;
         if (bs->detect_zeroes == BLOCKDEV_DETECT_ZEROES_OPTIONS_UNMAP) {
             flags |= BDRV_REQ_MAY_UNMAP;
@@ -1913,15 +1913,15 @@ static int coroutine_fn bdrv_aligned_pwritev(BdrvChild *child,
         bdrv_debug_event(bs, BLKDBG_PWRITEV_ZERO);
         ret = bdrv_co_do_pwrite_zeroes(bs, offset, bytes, flags);
     } else if (flags & BDRV_REQ_WRITE_COMPRESSED) {
-        ret = bdrv_driver_pwritev_compressed(bs, offset, bytes, qiov, 0);
+        ret = bdrv_driver_pwritev_compressed(bs, offset, bytes,
+                                             qiov, qiov_offset);
     } else if (bytes <= max_transfer) {
         bdrv_debug_event(bs, BLKDBG_PWRITEV);
-        ret = bdrv_driver_pwritev(bs, offset, bytes, qiov, 0, flags);
+        ret = bdrv_driver_pwritev(bs, offset, bytes, qiov, qiov_offset, flags);
     } else {
         bdrv_debug_event(bs, BLKDBG_PWRITEV);
         while (bytes_remaining) {
             int num = MIN(bytes_remaining, max_transfer);
-            QEMUIOVector local_qiov;
             int local_flags = flags;
 
             assert(num);
@@ -1931,12 +1931,10 @@ static int coroutine_fn bdrv_aligned_pwritev(BdrvChild *child,
                  * need to flush on the last iteration */
                 local_flags &= ~BDRV_REQ_FUA;
             }
-            qemu_iovec_init(&local_qiov, qiov->niov);
-            qemu_iovec_concat(&local_qiov, qiov, bytes - bytes_remaining, num);
 
             ret = bdrv_driver_pwritev(bs, offset + bytes - bytes_remaining,
-                                      num, &local_qiov, 0, local_flags);
-            qemu_iovec_destroy(&local_qiov);
+                                      num, qiov, bytes - bytes_remaining,
+                                      local_flags);
             if (ret < 0) {
                 break;
             }
@@ -1979,7 +1977,7 @@ static int coroutine_fn bdrv_co_do_zero_pwritev(BdrvChild *child,
 
             qemu_iovec_init_buf(&local_qiov, pad.buf, write_bytes);
             ret = bdrv_aligned_pwritev(child, req, aligned_offset, write_bytes,
-                                       align, &local_qiov,
+                                       align, &local_qiov, 0,
                                        flags & ~BDRV_REQ_ZERO_WRITE);
             if (ret < 0 || pad.merge_reads) {
                 /* Error or all work is done */
@@ -1995,7 +1993,7 @@ static int coroutine_fn bdrv_co_do_zero_pwritev(BdrvChild *child,
         /* Write the aligned part in the middle. */
         uint64_t aligned_bytes = bytes & ~(align - 1);
         ret = bdrv_aligned_pwritev(child, req, offset, aligned_bytes, align,
-                                   NULL, flags);
+                                   NULL, 0, flags);
         if (ret < 0) {
             goto out;
         }
@@ -2009,7 +2007,8 @@ static int coroutine_fn bdrv_co_do_zero_pwritev(BdrvChild *child,
 
         qemu_iovec_init_buf(&local_qiov, pad.tail_buf, align);
         ret = bdrv_aligned_pwritev(child, req, offset, align, align,
-                                   &local_qiov, flags & ~BDRV_REQ_ZERO_WRITE);
+                                   &local_qiov, 0,
+                                   flags & ~BDRV_REQ_ZERO_WRITE);
     }
 
 out:
@@ -2062,7 +2061,7 @@ int coroutine_fn bdrv_co_pwritev(BdrvChild *child,
     }
 
     ret = bdrv_aligned_pwritev(child, &req, offset, bytes, align,
-                               qiov, flags);
+                               qiov, 0, flags);
 
     bdrv_padding_destroy(&pad);
 
-- 
2.21.0



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

* [Qemu-devel] [PULL 09/12] block/io: introduce bdrv_co_p{read, write}v_part
  2019-08-27 20:16 [Qemu-devel] [PULL 00/12] Block patches Stefan Hajnoczi
                   ` (7 preceding siblings ...)
  2019-08-27 20:16 ` [Qemu-devel] [PULL 08/12] block/io: bdrv_aligned_pwritev: " Stefan Hajnoczi
@ 2019-08-27 20:16 ` Stefan Hajnoczi
  2019-08-27 20:16 ` [Qemu-devel] [PULL 10/12] block/qcow2: refactor qcow2_co_preadv to use buffer-based io Stefan Hajnoczi
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 40+ messages in thread
From: Stefan Hajnoczi @ 2019-08-27 20:16 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Kevin Wolf, Vladimir Sementsov-Ogievskiy, qemu-block,
	Peter Maydell, Max Reitz, Stefan Hajnoczi, John Snow

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

Introduce extended variants of bdrv_co_preadv and bdrv_co_pwritev
with qiov_offset parameter.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20190604161514.262241-10-vsementsov@virtuozzo.com
Message-Id: <20190604161514.262241-10-vsementsov@virtuozzo.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 include/block/block_int.h |  6 ++++++
 block/io.c                | 29 +++++++++++++++++++++++------
 2 files changed, 29 insertions(+), 6 deletions(-)

diff --git a/include/block/block_int.h b/include/block/block_int.h
index 79a1fdb258..0422acdf1c 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -959,9 +959,15 @@ extern BlockDriver bdrv_qcow2;
 int coroutine_fn bdrv_co_preadv(BdrvChild *child,
     int64_t offset, unsigned int bytes, QEMUIOVector *qiov,
     BdrvRequestFlags flags);
+int coroutine_fn bdrv_co_preadv_part(BdrvChild *child,
+    int64_t offset, unsigned int bytes,
+    QEMUIOVector *qiov, size_t qiov_offset, BdrvRequestFlags flags);
 int coroutine_fn bdrv_co_pwritev(BdrvChild *child,
     int64_t offset, unsigned int bytes, QEMUIOVector *qiov,
     BdrvRequestFlags flags);
+int coroutine_fn bdrv_co_pwritev_part(BdrvChild *child,
+    int64_t offset, unsigned int bytes,
+    QEMUIOVector *qiov, size_t qiov_offset, BdrvRequestFlags flags);
 
 static inline int coroutine_fn bdrv_co_pread(BdrvChild *child,
     int64_t offset, unsigned int bytes, void *buf, BdrvRequestFlags flags)
diff --git a/block/io.c b/block/io.c
index 237d7f40f5..0fa10831ed 100644
--- a/block/io.c
+++ b/block/io.c
@@ -1614,7 +1614,8 @@ static void bdrv_padding_destroy(BdrvRequestPadding *pad)
  *
  * Function always succeeds.
  */
-static bool bdrv_pad_request(BlockDriverState *bs, QEMUIOVector **qiov,
+static bool bdrv_pad_request(BlockDriverState *bs,
+                             QEMUIOVector **qiov, size_t *qiov_offset,
                              int64_t *offset, unsigned int *bytes,
                              BdrvRequestPadding *pad)
 {
@@ -1623,11 +1624,12 @@ static bool bdrv_pad_request(BlockDriverState *bs, QEMUIOVector **qiov,
     }
 
     qemu_iovec_init_extended(&pad->local_qiov, pad->buf, pad->head,
-                             *qiov, 0, *bytes,
+                             *qiov, *qiov_offset, *bytes,
                              pad->buf + pad->buf_len - pad->tail, pad->tail);
     *bytes += pad->head + pad->tail;
     *offset -= pad->head;
     *qiov = &pad->local_qiov;
+    *qiov_offset = 0;
 
     return true;
 }
@@ -1635,6 +1637,14 @@ static bool bdrv_pad_request(BlockDriverState *bs, QEMUIOVector **qiov,
 int coroutine_fn bdrv_co_preadv(BdrvChild *child,
     int64_t offset, unsigned int bytes, QEMUIOVector *qiov,
     BdrvRequestFlags flags)
+{
+    return bdrv_co_preadv_part(child, offset, bytes, qiov, 0, flags);
+}
+
+int coroutine_fn bdrv_co_preadv_part(BdrvChild *child,
+    int64_t offset, unsigned int bytes,
+    QEMUIOVector *qiov, size_t qiov_offset,
+    BdrvRequestFlags flags)
 {
     BlockDriverState *bs = child->bs;
     BdrvTrackedRequest req;
@@ -1655,12 +1665,12 @@ int coroutine_fn bdrv_co_preadv(BdrvChild *child,
         flags |= BDRV_REQ_COPY_ON_READ;
     }
 
-    bdrv_pad_request(bs, &qiov, &offset, &bytes, &pad);
+    bdrv_pad_request(bs, &qiov, &qiov_offset, &offset, &bytes, &pad);
 
     tracked_request_begin(&req, bs, offset, bytes, BDRV_TRACKED_READ);
     ret = bdrv_aligned_preadv(child, &req, offset, bytes,
                               bs->bl.request_alignment,
-                              qiov, 0, flags);
+                              qiov, qiov_offset, flags);
     tracked_request_end(&req);
     bdrv_dec_in_flight(bs);
 
@@ -2023,6 +2033,13 @@ out:
 int coroutine_fn bdrv_co_pwritev(BdrvChild *child,
     int64_t offset, unsigned int bytes, QEMUIOVector *qiov,
     BdrvRequestFlags flags)
+{
+    return bdrv_co_pwritev_part(child, offset, bytes, qiov, 0, flags);
+}
+
+int coroutine_fn bdrv_co_pwritev_part(BdrvChild *child,
+    int64_t offset, unsigned int bytes, QEMUIOVector *qiov, size_t qiov_offset,
+    BdrvRequestFlags flags)
 {
     BlockDriverState *bs = child->bs;
     BdrvTrackedRequest req;
@@ -2054,14 +2071,14 @@ int coroutine_fn bdrv_co_pwritev(BdrvChild *child,
         goto out;
     }
 
-    if (bdrv_pad_request(bs, &qiov, &offset, &bytes, &pad)) {
+    if (bdrv_pad_request(bs, &qiov, &qiov_offset, &offset, &bytes, &pad)) {
         mark_request_serialising(&req, align);
         wait_serialising_requests(&req);
         bdrv_padding_rmw_read(child, &req, &pad, false);
     }
 
     ret = bdrv_aligned_pwritev(child, &req, offset, bytes, align,
-                               qiov, 0, flags);
+                               qiov, qiov_offset, flags);
 
     bdrv_padding_destroy(&pad);
 
-- 
2.21.0



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

* [Qemu-devel] [PULL 10/12] block/qcow2: refactor qcow2_co_preadv to use buffer-based io
  2019-08-27 20:16 [Qemu-devel] [PULL 00/12] Block patches Stefan Hajnoczi
                   ` (8 preceding siblings ...)
  2019-08-27 20:16 ` [Qemu-devel] [PULL 09/12] block/io: introduce bdrv_co_p{read, write}v_part Stefan Hajnoczi
@ 2019-08-27 20:16 ` Stefan Hajnoczi
  2019-08-27 20:16 ` [Qemu-devel] [PULL 11/12] block/qcow2: implement .bdrv_co_preadv_part Stefan Hajnoczi
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 40+ messages in thread
From: Stefan Hajnoczi @ 2019-08-27 20:16 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Kevin Wolf, Vladimir Sementsov-Ogievskiy, qemu-block,
	Peter Maydell, Max Reitz, Stefan Hajnoczi, John Snow

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

Use buffer based io in encrypted case.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20190604161514.262241-11-vsementsov@virtuozzo.com
Message-Id: <20190604161514.262241-11-vsementsov@virtuozzo.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 block/qcow2.c | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/block/qcow2.c b/block/qcow2.c
index 7c5a4859f7..b2b87d1a8d 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -2059,19 +2059,15 @@ static coroutine_fn int qcow2_co_preadv(BlockDriverState *bs, uint64_t offset,
                 }
 
                 assert(cur_bytes <= QCOW_MAX_CRYPT_CLUSTERS * s->cluster_size);
-                qemu_iovec_reset(&hd_qiov);
-                qemu_iovec_add(&hd_qiov, cluster_data, cur_bytes);
-            }
 
-            BLKDBG_EVENT(bs->file, BLKDBG_READ_AIO);
-            ret = bdrv_co_preadv(s->data_file,
-                                 cluster_offset + offset_in_cluster,
-                                 cur_bytes, &hd_qiov, 0);
-            if (ret < 0) {
-                goto fail;
-            }
-            if (bs->encrypted) {
-                assert(s->crypto);
+                BLKDBG_EVENT(bs->file, BLKDBG_READ_AIO);
+                ret = bdrv_co_pread(s->data_file,
+                                    cluster_offset + offset_in_cluster,
+                                    cur_bytes, cluster_data, 0);
+                if (ret < 0) {
+                    goto fail;
+                }
+
                 assert((offset & (BDRV_SECTOR_SIZE - 1)) == 0);
                 assert((cur_bytes & (BDRV_SECTOR_SIZE - 1)) == 0);
                 if (qcow2_co_decrypt(bs, cluster_offset, offset,
@@ -2080,6 +2076,14 @@ static coroutine_fn int qcow2_co_preadv(BlockDriverState *bs, uint64_t offset,
                     goto fail;
                 }
                 qemu_iovec_from_buf(qiov, bytes_done, cluster_data, cur_bytes);
+            } else {
+                BLKDBG_EVENT(bs->file, BLKDBG_READ_AIO);
+                ret = bdrv_co_preadv(s->data_file,
+                                     cluster_offset + offset_in_cluster,
+                                     cur_bytes, &hd_qiov, 0);
+                if (ret < 0) {
+                    goto fail;
+                }
             }
             break;
 
-- 
2.21.0



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

* [Qemu-devel] [PULL 11/12] block/qcow2: implement .bdrv_co_preadv_part
  2019-08-27 20:16 [Qemu-devel] [PULL 00/12] Block patches Stefan Hajnoczi
                   ` (9 preceding siblings ...)
  2019-08-27 20:16 ` [Qemu-devel] [PULL 10/12] block/qcow2: refactor qcow2_co_preadv to use buffer-based io Stefan Hajnoczi
@ 2019-08-27 20:16 ` Stefan Hajnoczi
  2019-08-27 20:16 ` [Qemu-devel] [PULL 12/12] block/qcow2: implement .bdrv_co_pwritev(_compressed)_part Stefan Hajnoczi
  2019-09-03 10:05 ` [Qemu-devel] [PULL 00/12] Block patches Peter Maydell
  12 siblings, 0 replies; 40+ messages in thread
From: Stefan Hajnoczi @ 2019-08-27 20:16 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Kevin Wolf, Vladimir Sementsov-Ogievskiy, qemu-block,
	Peter Maydell, Max Reitz, Stefan Hajnoczi, John Snow

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

Implement and use new interface to get rid of hd_qiov.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20190604161514.262241-12-vsementsov@virtuozzo.com
Message-Id: <20190604161514.262241-12-vsementsov@virtuozzo.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 block/qcow2-cluster.c |  5 +++--
 block/qcow2.c         | 49 +++++++++++++++++++------------------------
 2 files changed, 25 insertions(+), 29 deletions(-)

diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
index cc5609e27a..0e4524d450 100644
--- a/block/qcow2-cluster.c
+++ b/block/qcow2-cluster.c
@@ -452,8 +452,9 @@ static int coroutine_fn do_perform_cow_read(BlockDriverState *bs,
      * interface.  This avoids double I/O throttling and request tracking,
      * which can lead to deadlock when block layer copy-on-read is enabled.
      */
-    ret = bs->drv->bdrv_co_preadv(bs, src_cluster_offset + offset_in_cluster,
-                                  qiov->size, qiov, 0);
+    ret = bs->drv->bdrv_co_preadv_part(bs,
+                                       src_cluster_offset + offset_in_cluster,
+                                       qiov->size, qiov, 0, 0);
     if (ret < 0) {
         return ret;
     }
diff --git a/block/qcow2.c b/block/qcow2.c
index b2b87d1a8d..ec1fff9dd1 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -76,7 +76,8 @@ qcow2_co_preadv_compressed(BlockDriverState *bs,
                            uint64_t file_cluster_offset,
                            uint64_t offset,
                            uint64_t bytes,
-                           QEMUIOVector *qiov);
+                           QEMUIOVector *qiov,
+                           size_t qiov_offset);
 
 static int qcow2_probe(const uint8_t *buf, int buf_size, const char *filename)
 {
@@ -1967,21 +1968,18 @@ out:
     return ret;
 }
 
-static coroutine_fn int qcow2_co_preadv(BlockDriverState *bs, uint64_t offset,
-                                        uint64_t bytes, QEMUIOVector *qiov,
-                                        int flags)
+static coroutine_fn int qcow2_co_preadv_part(BlockDriverState *bs,
+                                             uint64_t offset, uint64_t bytes,
+                                             QEMUIOVector *qiov,
+                                             size_t qiov_offset, int flags)
 {
     BDRVQcow2State *s = bs->opaque;
     int offset_in_cluster;
     int ret;
     unsigned int cur_bytes; /* number of bytes in current iteration */
     uint64_t cluster_offset = 0;
-    uint64_t bytes_done = 0;
-    QEMUIOVector hd_qiov;
     uint8_t *cluster_data = NULL;
 
-    qemu_iovec_init(&hd_qiov, qiov->niov);
-
     while (bytes != 0) {
 
         /* prepare next request */
@@ -2000,34 +1998,31 @@ static coroutine_fn int qcow2_co_preadv(BlockDriverState *bs, uint64_t offset,
 
         offset_in_cluster = offset_into_cluster(s, offset);
 
-        qemu_iovec_reset(&hd_qiov);
-        qemu_iovec_concat(&hd_qiov, qiov, bytes_done, cur_bytes);
-
         switch (ret) {
         case QCOW2_CLUSTER_UNALLOCATED:
 
             if (bs->backing) {
                 BLKDBG_EVENT(bs->file, BLKDBG_READ_BACKING_AIO);
-                ret = bdrv_co_preadv(bs->backing, offset, cur_bytes,
-                                     &hd_qiov, 0);
+                ret = bdrv_co_preadv_part(bs->backing, offset, cur_bytes,
+                                          qiov, qiov_offset, 0);
                 if (ret < 0) {
                     goto fail;
                 }
             } else {
                 /* Note: in this case, no need to wait */
-                qemu_iovec_memset(&hd_qiov, 0, 0, cur_bytes);
+                qemu_iovec_memset(qiov, qiov_offset, 0, cur_bytes);
             }
             break;
 
         case QCOW2_CLUSTER_ZERO_PLAIN:
         case QCOW2_CLUSTER_ZERO_ALLOC:
-            qemu_iovec_memset(&hd_qiov, 0, 0, cur_bytes);
+            qemu_iovec_memset(qiov, qiov_offset, 0, cur_bytes);
             break;
 
         case QCOW2_CLUSTER_COMPRESSED:
             ret = qcow2_co_preadv_compressed(bs, cluster_offset,
                                              offset, cur_bytes,
-                                             &hd_qiov);
+                                             qiov, qiov_offset);
             if (ret < 0) {
                 goto fail;
             }
@@ -2075,12 +2070,12 @@ static coroutine_fn int qcow2_co_preadv(BlockDriverState *bs, uint64_t offset,
                     ret = -EIO;
                     goto fail;
                 }
-                qemu_iovec_from_buf(qiov, bytes_done, cluster_data, cur_bytes);
+                qemu_iovec_from_buf(qiov, qiov_offset, cluster_data, cur_bytes);
             } else {
                 BLKDBG_EVENT(bs->file, BLKDBG_READ_AIO);
-                ret = bdrv_co_preadv(s->data_file,
-                                     cluster_offset + offset_in_cluster,
-                                     cur_bytes, &hd_qiov, 0);
+                ret = bdrv_co_preadv_part(s->data_file,
+                                          cluster_offset + offset_in_cluster,
+                                          cur_bytes, qiov, qiov_offset, 0);
                 if (ret < 0) {
                     goto fail;
                 }
@@ -2095,12 +2090,11 @@ static coroutine_fn int qcow2_co_preadv(BlockDriverState *bs, uint64_t offset,
 
         bytes -= cur_bytes;
         offset += cur_bytes;
-        bytes_done += cur_bytes;
+        qiov_offset += cur_bytes;
     }
     ret = 0;
 
 fail:
-    qemu_iovec_destroy(&hd_qiov);
     qemu_vfree(cluster_data);
 
     return ret;
@@ -4101,7 +4095,8 @@ qcow2_co_preadv_compressed(BlockDriverState *bs,
                            uint64_t file_cluster_offset,
                            uint64_t offset,
                            uint64_t bytes,
-                           QEMUIOVector *qiov)
+                           QEMUIOVector *qiov,
+                           size_t qiov_offset)
 {
     BDRVQcow2State *s = bs->opaque;
     int ret = 0, csize, nb_csectors;
@@ -4132,7 +4127,7 @@ qcow2_co_preadv_compressed(BlockDriverState *bs,
         goto fail;
     }
 
-    qemu_iovec_from_buf(qiov, 0, out_buf + offset_in_cluster, bytes);
+    qemu_iovec_from_buf(qiov, qiov_offset, out_buf + offset_in_cluster, bytes);
 
 fail:
     qemu_vfree(out_buf);
@@ -4679,8 +4674,8 @@ static int qcow2_load_vmstate(BlockDriverState *bs, QEMUIOVector *qiov,
     BDRVQcow2State *s = bs->opaque;
 
     BLKDBG_EVENT(bs->file, BLKDBG_VMSTATE_LOAD);
-    return bs->drv->bdrv_co_preadv(bs, qcow2_vm_state_offset(s) + pos,
-                                   qiov->size, qiov, 0);
+    return bs->drv->bdrv_co_preadv_part(bs, qcow2_vm_state_offset(s) + pos,
+                                        qiov->size, qiov, 0, 0);
 }
 
 /*
@@ -5222,7 +5217,7 @@ BlockDriver bdrv_qcow2 = {
     .bdrv_has_zero_init_truncate = bdrv_has_zero_init_1,
     .bdrv_co_block_status = qcow2_co_block_status,
 
-    .bdrv_co_preadv         = qcow2_co_preadv,
+    .bdrv_co_preadv_part    = qcow2_co_preadv_part,
     .bdrv_co_pwritev        = qcow2_co_pwritev,
     .bdrv_co_flush_to_os    = qcow2_co_flush_to_os,
 
-- 
2.21.0



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

* [Qemu-devel] [PULL 12/12] block/qcow2: implement .bdrv_co_pwritev(_compressed)_part
  2019-08-27 20:16 [Qemu-devel] [PULL 00/12] Block patches Stefan Hajnoczi
                   ` (10 preceding siblings ...)
  2019-08-27 20:16 ` [Qemu-devel] [PULL 11/12] block/qcow2: implement .bdrv_co_preadv_part Stefan Hajnoczi
@ 2019-08-27 20:16 ` Stefan Hajnoczi
  2019-09-03 10:05 ` [Qemu-devel] [PULL 00/12] Block patches Peter Maydell
  12 siblings, 0 replies; 40+ messages in thread
From: Stefan Hajnoczi @ 2019-08-27 20:16 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Kevin Wolf, Vladimir Sementsov-Ogievskiy, qemu-block,
	Peter Maydell, Max Reitz, Stefan Hajnoczi, John Snow

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

Implement and use new interface to get rid of hd_qiov.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20190604161514.262241-13-vsementsov@virtuozzo.com
Message-Id: <20190604161514.262241-13-vsementsov@virtuozzo.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 block/qcow2.h         |  1 +
 include/qemu/iov.h    |  1 +
 block/qcow2-cluster.c |  9 ++++---
 block/qcow2.c         | 60 +++++++++++++++++++++----------------------
 util/iov.c            | 10 ++++++++
 5 files changed, 48 insertions(+), 33 deletions(-)

diff --git a/block/qcow2.h b/block/qcow2.h
index fc1b0d3c1e..998bcdaef1 100644
--- a/block/qcow2.h
+++ b/block/qcow2.h
@@ -420,6 +420,7 @@ typedef struct QCowL2Meta
      * from @cow_start and @cow_end into one single write operation.
      */
     QEMUIOVector *data_qiov;
+    size_t data_qiov_offset;
 
     /** Pointer to next L2Meta of the same write request */
     struct QCowL2Meta *next;
diff --git a/include/qemu/iov.h b/include/qemu/iov.h
index 29957c8a72..bffc151282 100644
--- a/include/qemu/iov.h
+++ b/include/qemu/iov.h
@@ -206,6 +206,7 @@ void qemu_iovec_init_extended(
         void *tail_buf, size_t tail_len);
 void qemu_iovec_init_slice(QEMUIOVector *qiov, QEMUIOVector *source,
                            size_t offset, size_t len);
+int qemu_iovec_subvec_niov(QEMUIOVector *qiov, size_t offset, size_t len);
 void qemu_iovec_add(QEMUIOVector *qiov, void *base, size_t len);
 void qemu_iovec_concat(QEMUIOVector *dst,
                        QEMUIOVector *src, size_t soffset, size_t sbytes);
diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
index 0e4524d450..f09cc992af 100644
--- a/block/qcow2-cluster.c
+++ b/block/qcow2-cluster.c
@@ -829,7 +829,6 @@ static int perform_cow(BlockDriverState *bs, QCowL2Meta *m)
     assert(start->nb_bytes <= UINT_MAX - end->nb_bytes);
     assert(start->nb_bytes + end->nb_bytes <= UINT_MAX - data_bytes);
     assert(start->offset + start->nb_bytes <= end->offset);
-    assert(!m->data_qiov || m->data_qiov->size == data_bytes);
 
     if ((start->nb_bytes == 0 && end->nb_bytes == 0) || m->skip_cow) {
         return 0;
@@ -861,7 +860,11 @@ static int perform_cow(BlockDriverState *bs, QCowL2Meta *m)
     /* The part of the buffer where the end region is located */
     end_buffer = start_buffer + buffer_size - end->nb_bytes;
 
-    qemu_iovec_init(&qiov, 2 + (m->data_qiov ? m->data_qiov->niov : 0));
+    qemu_iovec_init(&qiov, 2 + (m->data_qiov ?
+                                qemu_iovec_subvec_niov(m->data_qiov,
+                                                       m->data_qiov_offset,
+                                                       data_bytes)
+                                : 0));
 
     qemu_co_mutex_unlock(&s->lock);
     /* First we read the existing data from both COW regions. We
@@ -904,7 +907,7 @@ static int perform_cow(BlockDriverState *bs, QCowL2Meta *m)
         if (start->nb_bytes) {
             qemu_iovec_add(&qiov, start_buffer, start->nb_bytes);
         }
-        qemu_iovec_concat(&qiov, m->data_qiov, 0, data_bytes);
+        qemu_iovec_concat(&qiov, m->data_qiov, m->data_qiov_offset, data_bytes);
         if (end->nb_bytes) {
             qemu_iovec_add(&qiov, end_buffer, end->nb_bytes);
         }
diff --git a/block/qcow2.c b/block/qcow2.c
index ec1fff9dd1..0882ff6e92 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -2103,7 +2103,8 @@ fail:
 /* Check if it's possible to merge a write request with the writing of
  * the data from the COW regions */
 static bool merge_cow(uint64_t offset, unsigned bytes,
-                      QEMUIOVector *hd_qiov, QCowL2Meta *l2meta)
+                      QEMUIOVector *qiov, size_t qiov_offset,
+                      QCowL2Meta *l2meta)
 {
     QCowL2Meta *m;
 
@@ -2132,11 +2133,12 @@ static bool merge_cow(uint64_t offset, unsigned bytes,
 
         /* Make sure that adding both COW regions to the QEMUIOVector
          * does not exceed IOV_MAX */
-        if (hd_qiov->niov > IOV_MAX - 2) {
+        if (qemu_iovec_subvec_niov(qiov, qiov_offset, bytes) > IOV_MAX - 2) {
             continue;
         }
 
-        m->data_qiov = hd_qiov;
+        m->data_qiov = qiov;
+        m->data_qiov_offset = qiov_offset;
         return true;
     }
 
@@ -2218,24 +2220,22 @@ static int handle_alloc_space(BlockDriverState *bs, QCowL2Meta *l2meta)
     return 0;
 }
 
-static coroutine_fn int qcow2_co_pwritev(BlockDriverState *bs, uint64_t offset,
-                                         uint64_t bytes, QEMUIOVector *qiov,
-                                         int flags)
+static coroutine_fn int qcow2_co_pwritev_part(
+        BlockDriverState *bs, uint64_t offset, uint64_t bytes,
+        QEMUIOVector *qiov, size_t qiov_offset, int flags)
 {
     BDRVQcow2State *s = bs->opaque;
     int offset_in_cluster;
     int ret;
     unsigned int cur_bytes; /* number of sectors in current iteration */
     uint64_t cluster_offset;
-    QEMUIOVector hd_qiov;
+    QEMUIOVector encrypted_qiov;
     uint64_t bytes_done = 0;
     uint8_t *cluster_data = NULL;
     QCowL2Meta *l2meta = NULL;
 
     trace_qcow2_writev_start_req(qemu_coroutine_self(), offset, bytes);
 
-    qemu_iovec_init(&hd_qiov, qiov->niov);
-
     qemu_co_mutex_lock(&s->lock);
 
     while (bytes != 0) {
@@ -2268,9 +2268,6 @@ static coroutine_fn int qcow2_co_pwritev(BlockDriverState *bs, uint64_t offset,
 
         qemu_co_mutex_unlock(&s->lock);
 
-        qemu_iovec_reset(&hd_qiov);
-        qemu_iovec_concat(&hd_qiov, qiov, bytes_done, cur_bytes);
-
         if (bs->encrypted) {
             assert(s->crypto);
             if (!cluster_data) {
@@ -2283,9 +2280,9 @@ static coroutine_fn int qcow2_co_pwritev(BlockDriverState *bs, uint64_t offset,
                 }
             }
 
-            assert(hd_qiov.size <=
-                   QCOW_MAX_CRYPT_CLUSTERS * s->cluster_size);
-            qemu_iovec_to_buf(&hd_qiov, 0, cluster_data, hd_qiov.size);
+            assert(cur_bytes <= QCOW_MAX_CRYPT_CLUSTERS * s->cluster_size);
+            qemu_iovec_to_buf(qiov, qiov_offset + bytes_done,
+                              cluster_data, cur_bytes);
 
             if (qcow2_co_encrypt(bs, cluster_offset, offset,
                                  cluster_data, cur_bytes) < 0) {
@@ -2293,8 +2290,7 @@ static coroutine_fn int qcow2_co_pwritev(BlockDriverState *bs, uint64_t offset,
                 goto out_unlocked;
             }
 
-            qemu_iovec_reset(&hd_qiov);
-            qemu_iovec_add(&hd_qiov, cluster_data, cur_bytes);
+            qemu_iovec_init_buf(&encrypted_qiov, cluster_data, cur_bytes);
         }
 
         /* Try to efficiently initialize the physical space with zeroes */
@@ -2307,13 +2303,17 @@ static coroutine_fn int qcow2_co_pwritev(BlockDriverState *bs, uint64_t offset,
          * writing of the guest data together with that of the COW regions.
          * If it's not possible (or not necessary) then write the
          * guest data now. */
-        if (!merge_cow(offset, cur_bytes, &hd_qiov, l2meta)) {
+        if (!merge_cow(offset, cur_bytes,
+                       bs->encrypted ? &encrypted_qiov : qiov,
+                       bs->encrypted ? 0 : qiov_offset + bytes_done, l2meta))
+        {
             BLKDBG_EVENT(bs->file, BLKDBG_WRITE_AIO);
             trace_qcow2_writev_data(qemu_coroutine_self(),
                                     cluster_offset + offset_in_cluster);
-            ret = bdrv_co_pwritev(s->data_file,
-                                  cluster_offset + offset_in_cluster,
-                                  cur_bytes, &hd_qiov, 0);
+            ret = bdrv_co_pwritev_part(
+                    s->data_file, cluster_offset + offset_in_cluster, cur_bytes,
+                    bs->encrypted ? &encrypted_qiov : qiov,
+                    bs->encrypted ? 0 : qiov_offset + bytes_done, 0);
             if (ret < 0) {
                 goto out_unlocked;
             }
@@ -2342,7 +2342,6 @@ out_locked:
 
     qemu_co_mutex_unlock(&s->lock);
 
-    qemu_iovec_destroy(&hd_qiov);
     qemu_vfree(cluster_data);
     trace_qcow2_writev_done_req(qemu_coroutine_self(), ret);
 
@@ -4007,8 +4006,9 @@ fail:
 /* XXX: put compressed sectors first, then all the cluster aligned
    tables to avoid losing bytes in alignment */
 static coroutine_fn int
-qcow2_co_pwritev_compressed(BlockDriverState *bs, uint64_t offset,
-                            uint64_t bytes, QEMUIOVector *qiov)
+qcow2_co_pwritev_compressed_part(BlockDriverState *bs,
+                                 uint64_t offset, uint64_t bytes,
+                                 QEMUIOVector *qiov, size_t qiov_offset)
 {
     BDRVQcow2State *s = bs->opaque;
     int ret;
@@ -4045,7 +4045,7 @@ qcow2_co_pwritev_compressed(BlockDriverState *bs, uint64_t offset,
         /* Zero-pad last write if image size is not cluster aligned */
         memset(buf + bytes, 0, s->cluster_size - bytes);
     }
-    qemu_iovec_to_buf(qiov, 0, buf, bytes);
+    qemu_iovec_to_buf(qiov, qiov_offset, buf, bytes);
 
     out_buf = g_malloc(s->cluster_size);
 
@@ -4053,7 +4053,7 @@ qcow2_co_pwritev_compressed(BlockDriverState *bs, uint64_t offset,
                                 buf, s->cluster_size);
     if (out_len == -ENOMEM) {
         /* could not compress: write normal cluster */
-        ret = qcow2_co_pwritev(bs, offset, bytes, qiov, 0);
+        ret = qcow2_co_pwritev_part(bs, offset, bytes, qiov, qiov_offset, 0);
         if (ret < 0) {
             goto fail;
         }
@@ -4664,8 +4664,8 @@ static int qcow2_save_vmstate(BlockDriverState *bs, QEMUIOVector *qiov,
     BDRVQcow2State *s = bs->opaque;
 
     BLKDBG_EVENT(bs->file, BLKDBG_VMSTATE_SAVE);
-    return bs->drv->bdrv_co_pwritev(bs, qcow2_vm_state_offset(s) + pos,
-                                    qiov->size, qiov, 0);
+    return bs->drv->bdrv_co_pwritev_part(bs, qcow2_vm_state_offset(s) + pos,
+                                         qiov->size, qiov, 0, 0);
 }
 
 static int qcow2_load_vmstate(BlockDriverState *bs, QEMUIOVector *qiov,
@@ -5218,7 +5218,7 @@ BlockDriver bdrv_qcow2 = {
     .bdrv_co_block_status = qcow2_co_block_status,
 
     .bdrv_co_preadv_part    = qcow2_co_preadv_part,
-    .bdrv_co_pwritev        = qcow2_co_pwritev,
+    .bdrv_co_pwritev_part   = qcow2_co_pwritev_part,
     .bdrv_co_flush_to_os    = qcow2_co_flush_to_os,
 
     .bdrv_co_pwrite_zeroes  = qcow2_co_pwrite_zeroes,
@@ -5226,7 +5226,7 @@ BlockDriver bdrv_qcow2 = {
     .bdrv_co_copy_range_from = qcow2_co_copy_range_from,
     .bdrv_co_copy_range_to  = qcow2_co_copy_range_to,
     .bdrv_co_truncate       = qcow2_co_truncate,
-    .bdrv_co_pwritev_compressed = qcow2_co_pwritev_compressed,
+    .bdrv_co_pwritev_compressed_part = qcow2_co_pwritev_compressed_part,
     .bdrv_make_empty        = qcow2_make_empty,
 
     .bdrv_snapshot_create   = qcow2_snapshot_create,
diff --git a/util/iov.c b/util/iov.c
index 9ac0261853..5059e10431 100644
--- a/util/iov.c
+++ b/util/iov.c
@@ -401,6 +401,16 @@ static struct iovec *qiov_slice(QEMUIOVector *qiov,
     return iov;
 }
 
+int qemu_iovec_subvec_niov(QEMUIOVector *qiov, size_t offset, size_t len)
+{
+    size_t head, tail;
+    int niov;
+
+    qiov_slice(qiov, offset, len, &head, &tail, &niov);
+
+    return niov;
+}
+
 /*
  * Compile new iovec, combining @head_buf buffer, sub-qiov of @mid_qiov,
  * and @tail_buf buffer into new qiov.
-- 
2.21.0



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

* Re: [Qemu-devel] [PULL 00/12] Block patches
  2019-08-27 20:16 [Qemu-devel] [PULL 00/12] Block patches Stefan Hajnoczi
                   ` (11 preceding siblings ...)
  2019-08-27 20:16 ` [Qemu-devel] [PULL 12/12] block/qcow2: implement .bdrv_co_pwritev(_compressed)_part Stefan Hajnoczi
@ 2019-09-03 10:05 ` Peter Maydell
  12 siblings, 0 replies; 40+ messages in thread
From: Peter Maydell @ 2019-09-03 10:05 UTC (permalink / raw)
  To: Stefan Hajnoczi
  Cc: Fam Zheng, Kevin Wolf, Qemu-block, QEMU Developers, Max Reitz, John Snow

On Tue, 27 Aug 2019 at 21:16, Stefan Hajnoczi <stefanha@redhat.com> wrote:
>
> The following changes since commit dac03af5d5482ec7ee9c23db467bb7230b33c0d9:
>
>   Merge remote-tracking branch 'remotes/rth/tags/pull-axp-20190825' into staging (2019-08-27 10:00:51 +0100)
>
> are available in the Git repository at:
>
>   https://github.com/stefanha/qemu.git tags/block-pull-request
>
> for you to fetch changes up to 5396234b96a2ac743f48644529771498e036e698:
>
>   block/qcow2: implement .bdrv_co_pwritev(_compressed)_part (2019-08-27 14:58:42 +0100)
>
> ----------------------------------------------------------------
> Pull request


Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/4.2
for any user-visible changes.

-- PMM


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

* Re: [Qemu-devel] [PULL 01/12] util/iov: introduce qemu_iovec_init_extended
  2019-08-27 20:16 ` [Qemu-devel] [PULL 01/12] util/iov: introduce qemu_iovec_init_extended Stefan Hajnoczi
@ 2019-09-09 17:39   ` Peter Maydell
  2019-09-10  9:03     ` Vladimir Sementsov-Ogievskiy
  0 siblings, 1 reply; 40+ messages in thread
From: Peter Maydell @ 2019-09-09 17:39 UTC (permalink / raw)
  To: Stefan Hajnoczi
  Cc: Fam Zheng, Kevin Wolf, Vladimir Sementsov-Ogievskiy, Qemu-block,
	QEMU Developers, Max Reitz, John Snow

On Tue, 27 Aug 2019 at 21:16, Stefan Hajnoczi <stefanha@redhat.com> wrote:
>
> From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
>
> Introduce new initialization API, to create requests with padding. Will
> be used in the following patch. New API uses qemu_iovec_init_buf if
> resulting io vector has only one element, to avoid extra allocations.
> So, we need to update qemu_iovec_destroy to support destroying such
> QIOVs.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
> Message-id: 20190604161514.262241-2-vsementsov@virtuozzo.com
> Message-Id: <20190604161514.262241-2-vsementsov@virtuozzo.com>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>

Hi -- Coverity thinks this new function could have an
out-of-bounds read (CID 1405302):

> +/*
> + * Compile new iovec, combining @head_buf buffer, sub-qiov of @mid_qiov,
> + * and @tail_buf buffer into new qiov.
> + */
> +void qemu_iovec_init_extended(
> +        QEMUIOVector *qiov,
> +        void *head_buf, size_t head_len,
> +        QEMUIOVector *mid_qiov, size_t mid_offset, size_t mid_len,
> +        void *tail_buf, size_t tail_len)
> +{
> +    size_t mid_head, mid_tail;
> +    int total_niov, mid_niov = 0;
> +    struct iovec *p, *mid_iov;
> +
> +    if (mid_len) {
> +        mid_iov = qiov_slice(mid_qiov, mid_offset, mid_len,
> +                             &mid_head, &mid_tail, &mid_niov);
> +    }
> +
> +    total_niov = !!head_len + mid_niov + !!tail_len;
> +    if (total_niov == 1) {
> +        qemu_iovec_init_buf(qiov, NULL, 0);
> +        p = &qiov->local_iov;
> +    } else {
> +        qiov->niov = qiov->nalloc = total_niov;
> +        qiov->size = head_len + mid_len + tail_len;
> +        p = qiov->iov = g_new(struct iovec, qiov->niov);
> +    }
> +
> +    if (head_len) {
> +        p->iov_base = head_buf;
> +        p->iov_len = head_len;
> +        p++;
> +    }
> +
> +    if (mid_len) {
> +        memcpy(p, mid_iov, mid_niov * sizeof(*p));
> +        p[0].iov_base = (uint8_t *)p[0].iov_base + mid_head;
> +        p[0].iov_len -= mid_head;
> +        p[mid_niov - 1].iov_len -= mid_tail;
> +        p += mid_niov;
> +    }
> +
> +    if (tail_len) {
> +        p->iov_base = tail_buf;
> +        p->iov_len = tail_len;
> +    }
> +}

but I'm not familiar enough with the code to be able to tell
if it's correct or if it's just getting confused. Could
somebody have a look? (It's possible it's getting confused
because the calculation of 'total_niov' uses 'mid_niov',
but the condition guarding the code that fills in that part
of the vector is 'mid_len', so it thinks it can take the
"total_niov == 1" codepath and also the "head_len == true"
and "mid_len != 0" paths; in which case using "if (mid_niov)"
instead might make it happier.)

thanks
-- PMM


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

* Re: [Qemu-devel] [PULL 01/12] util/iov: introduce qemu_iovec_init_extended
  2019-09-09 17:39   ` Peter Maydell
@ 2019-09-10  9:03     ` Vladimir Sementsov-Ogievskiy
  0 siblings, 0 replies; 40+ messages in thread
From: Vladimir Sementsov-Ogievskiy @ 2019-09-10  9:03 UTC (permalink / raw)
  To: Peter Maydell, Stefan Hajnoczi
  Cc: Fam Zheng, Kevin Wolf, Qemu-block, QEMU Developers, Max Reitz, John Snow

09.09.2019 20:39, Peter Maydell wrote:
> On Tue, 27 Aug 2019 at 21:16, Stefan Hajnoczi <stefanha@redhat.com> wrote:
>>
>> From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
>>
>> Introduce new initialization API, to create requests with padding. Will
>> be used in the following patch. New API uses qemu_iovec_init_buf if
>> resulting io vector has only one element, to avoid extra allocations.
>> So, we need to update qemu_iovec_destroy to support destroying such
>> QIOVs.
>>
>> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
>> Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
>> Message-id: 20190604161514.262241-2-vsementsov@virtuozzo.com
>> Message-Id: <20190604161514.262241-2-vsementsov@virtuozzo.com>
>> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> 
> Hi -- Coverity thinks this new function could have an
> out-of-bounds read (CID 1405302):
> 
>> +/*
>> + * Compile new iovec, combining @head_buf buffer, sub-qiov of @mid_qiov,
>> + * and @tail_buf buffer into new qiov.
>> + */
>> +void qemu_iovec_init_extended(
>> +        QEMUIOVector *qiov,
>> +        void *head_buf, size_t head_len,
>> +        QEMUIOVector *mid_qiov, size_t mid_offset, size_t mid_len,
>> +        void *tail_buf, size_t tail_len)
>> +{
>> +    size_t mid_head, mid_tail;
>> +    int total_niov, mid_niov = 0;
>> +    struct iovec *p, *mid_iov;
>> +
>> +    if (mid_len) {
>> +        mid_iov = qiov_slice(mid_qiov, mid_offset, mid_len,
>> +                             &mid_head, &mid_tail, &mid_niov);
>> +    }
>> +
>> +    total_niov = !!head_len + mid_niov + !!tail_len;
>> +    if (total_niov == 1) {
>> +        qemu_iovec_init_buf(qiov, NULL, 0);
>> +        p = &qiov->local_iov;
>> +    } else {
>> +        qiov->niov = qiov->nalloc = total_niov;
>> +        qiov->size = head_len + mid_len + tail_len;
>> +        p = qiov->iov = g_new(struct iovec, qiov->niov);
>> +    }
>> +
>> +    if (head_len) {
>> +        p->iov_base = head_buf;
>> +        p->iov_len = head_len;
>> +        p++;
>> +    }
>> +
>> +    if (mid_len) {
>> +        memcpy(p, mid_iov, mid_niov * sizeof(*p));
>> +        p[0].iov_base = (uint8_t *)p[0].iov_base + mid_head;
>> +        p[0].iov_len -= mid_head;
>> +        p[mid_niov - 1].iov_len -= mid_tail;
>> +        p += mid_niov;
>> +    }
>> +
>> +    if (tail_len) {
>> +        p->iov_base = tail_buf;
>> +        p->iov_len = tail_len;
>> +    }
>> +}
> 
> but I'm not familiar enough with the code to be able to tell
> if it's correct or if it's just getting confused. Could
> somebody have a look? (It's possible it's getting confused
> because the calculation of 'total_niov' uses 'mid_niov',
> but the condition guarding the code that fills in that part
> of the vector is 'mid_len', so it thinks it can take the
> "total_niov == 1" codepath and also the "head_len == true"
> and "mid_len != 0" paths; in which case using "if (mid_niov)"
> instead might make it happier.)
> 

I'm afraid, I don't have better assumption. Let's try.


-- 
Best regards,
Vladimir

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

* [Qemu-devel] [PULL 00/12] Block patches
@ 2017-05-26 19:23 Jeff Cody
  0 siblings, 0 replies; 40+ messages in thread
From: Jeff Cody @ 2017-05-26 19:23 UTC (permalink / raw)
  To: qemu-block; +Cc: peter.maydell, jcody, qemu-devel, stefanha

The following changes since commit 9964e96dc9999cf7f7c936ee854a795415d19b60:

  Merge remote-tracking branch 'jasowang/tags/net-pull-request' into staging (2017-05-23 15:01:31 +0100)

are available in the git repository at:

  git://github.com/codyprime/qemu-kvm-jtc.git tags/block-pull-request

for you to fetch changes up to 223a23c198787328ae75bc65d84edf5fde33c0b6:

  block/gluster: glfs_lseek() workaround (2017-05-24 16:44:46 -0400)

----------------------------------------------------------------
Block patches
----------------------------------------------------------------

Jeff Cody (1):
  block/gluster: glfs_lseek() workaround

Paolo Bonzini (11):
  blockjob: remove unnecessary check
  blockjob: remove iostatus_reset callback
  blockjob: introduce block_job_early_fail
  blockjob: introduce block_job_pause/resume_all
  blockjob: separate monitor and blockjob APIs
  blockjob: move iostatus reset inside block_job_user_resume
  blockjob: introduce block_job_cancel_async, check iostatus invariants
  blockjob: group BlockJob transaction functions together
  blockjob: strengthen a bit test-blockjob-txn
  blockjob: reorganize block_job_completed_txn_abort
  blockjob: use deferred_to_main_loop to indicate the coroutine has
    ended

 block/backup.c               |   2 +-
 block/commit.c               |   2 +-
 block/gluster.c              |  18 +-
 block/io.c                   |  19 +-
 block/mirror.c               |   2 +-
 blockdev.c                   |   1 -
 blockjob.c                   | 750 ++++++++++++++++++++++++-------------------
 include/block/blockjob.h     |  16 -
 include/block/blockjob_int.h |  27 +-
 tests/test-blockjob-txn.c    |   7 +-
 tests/test-blockjob.c        |  10 +-
 11 files changed, 463 insertions(+), 391 deletions(-)

-- 
2.9.3

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

* Re: [Qemu-devel] [PULL 00/12] Block patches
  2017-04-21 13:46 Jeff Cody
@ 2017-04-21 16:55 ` Peter Maydell
  0 siblings, 0 replies; 40+ messages in thread
From: Peter Maydell @ 2017-04-21 16:55 UTC (permalink / raw)
  To: Jeff Cody; +Cc: Qemu-block, QEMU Developers

On 21 April 2017 at 14:46, Jeff Cody <jcody@redhat.com> wrote:
> The following changes since commit bfec359afba088aaacc7d316f43302f28c6e642a:
>
>   Merge remote-tracking branch 'remotes/armbru/tags/pull-qdev-2017-04-21' into staging (2017-04-21 11:42:03 +0100)
>
> are available in the git repository at:
>
>   git://github.com/codyprime/qemu-kvm-jtc.git tags/block-pull-request
>
> for you to fetch changes up to 1507631e438930bc07f776f303af127a9cdb4d41:
>
>   qemu-iotests: _cleanup_qemu must be called on exit (2017-04-21 08:32:44 -0400)
>
> ----------------------------------------------------------------
>
> Block patches for 2.10
>

Hi, I'm afraid this runs into format string compile issues:

In file included from block/trace.c:4:
/Users/pm215/src/qemu-for-merges/build/all/block/trace.h:1465:42:
error: format specifies type 'unsigned long' but the argument has type
'uint64_t' (aka 'unsigned long long') [-Werror,-Wformat]
                          , guid, iodir, size, off, acb, ret, err);
                                         ^~~~
/Users/pm215/src/qemu-for-merges/include/qemu/log.h:94:30: note:
expanded from macro 'qemu_log_mask'
            qemu_log(FMT, ## __VA_ARGS__);              \
                             ^
In file included from block/trace.c:4:
/Users/pm215/src/qemu-for-merges/build/all/block/trace.h:1465:48:
error: format specifies type 'unsigned long' but the argument has type
'uint64_t' (aka 'unsigned long long') [-Werror,-Wformat]
                          , guid, iodir, size, off, acb, ret, err);
                                               ^~~
/Users/pm215/src/qemu-for-merges/include/qemu/log.h:94:30: note:
expanded from macro 'qemu_log_mask'
            qemu_log(FMT, ## __VA_ARGS__);              \
                             ^
In file included from block/trace.c:4:
/Users/pm215/src/qemu-for-merges/build/all/block/trace.h:1493:41:
error: format specifies type 'unsigned long' but the argument has type
'uint64_t' (aka 'unsigned long long') [-Werror,-Wformat]
                          , vdisk_guid, vdisk_size);
                                        ^~~~~~~~~~
/Users/pm215/src/qemu-for-merges/include/qemu/log.h:94:30: note:
expanded from macro 'qemu_log_mask'
            qemu_log(FMT, ## __VA_ARGS__);              \
                             ^
In file included from block/trace.c:4:
/Users/pm215/src/qemu-for-merges/build/all/block/trace.h:1507:34:
error: format specifies type 'long' but the argument has type
'uint64_t' (aka 'unsigned long long') [-Werror,-Wformat]
                          , acb, ret);
                                 ^~~
/Users/pm215/src/qemu-for-merges/include/qemu/log.h:94:30: note:
expanded from macro 'qemu_log_mask'
            qemu_log(FMT, ## __VA_ARGS__);              \
                             ^
4 errors generated.


Those are the OSX errors, but the compile also fails for 32-bit
hosts (including w32).

thanks
-- PMM

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

* [Qemu-devel] [PULL 00/12] Block patches
@ 2017-04-21 13:46 Jeff Cody
  2017-04-21 16:55 ` Peter Maydell
  0 siblings, 1 reply; 40+ messages in thread
From: Jeff Cody @ 2017-04-21 13:46 UTC (permalink / raw)
  To: qemu-block; +Cc: peter.maydell, jcody, qemu-devel

The following changes since commit bfec359afba088aaacc7d316f43302f28c6e642a:

  Merge remote-tracking branch 'remotes/armbru/tags/pull-qdev-2017-04-21' into staging (2017-04-21 11:42:03 +0100)

are available in the git repository at:

  git://github.com/codyprime/qemu-kvm-jtc.git tags/block-pull-request

for you to fetch changes up to 1507631e438930bc07f776f303af127a9cdb4d41:

  qemu-iotests: _cleanup_qemu must be called on exit (2017-04-21 08:32:44 -0400)

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

Block patches for 2.10

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

Ashish Mittal (2):
  block/vxhs.c: Add support for a new block device type called "vxhs"
  block/vxhs.c: Add qemu-iotests for new block device type "vxhs"

Jeff Cody (10):
  qemu-iotests: exclude vxhs from image creation via protocol
  block: add bdrv_set_read_only() helper function
  block: do not set BDS read_only if copy_on_read enabled
  block: honor BDRV_O_ALLOW_RDWR when clearing bs->read_only
  block: code movement
  block: introduce bdrv_can_set_read_only()
  block: use bdrv_can_set_read_only() during reopen
  block/rbd - update variable names to more apt names
  block/rbd: Add support for reopen()
  qemu-iotests: _cleanup_qemu must be called on exit

 block.c                          |  56 +++-
 block/Makefile.objs              |   2 +
 block/bochs.c                    |   5 +-
 block/cloop.c                    |   5 +-
 block/dmg.c                      |   6 +-
 block/rbd.c                      |  65 +++--
 block/trace-events               |  17 ++
 block/vvfat.c                    |  19 +-
 block/vxhs.c                     | 575 +++++++++++++++++++++++++++++++++++++++
 configure                        |  39 +++
 include/block/block.h            |   2 +
 qapi/block-core.json             |  23 +-
 tests/qemu-iotests/017           |   1 +
 tests/qemu-iotests/020           |   1 +
 tests/qemu-iotests/028           |   1 +
 tests/qemu-iotests/029           |   1 +
 tests/qemu-iotests/073           |   1 +
 tests/qemu-iotests/094           |  11 +-
 tests/qemu-iotests/102           |   5 +-
 tests/qemu-iotests/109           |   1 +
 tests/qemu-iotests/114           |   1 +
 tests/qemu-iotests/117           |   1 +
 tests/qemu-iotests/130           |   2 +
 tests/qemu-iotests/134           |   1 +
 tests/qemu-iotests/140           |   1 +
 tests/qemu-iotests/141           |   1 +
 tests/qemu-iotests/143           |   1 +
 tests/qemu-iotests/156           |   2 +
 tests/qemu-iotests/158           |   1 +
 tests/qemu-iotests/common        |   6 +
 tests/qemu-iotests/common.config |  13 +
 tests/qemu-iotests/common.filter |   1 +
 tests/qemu-iotests/common.rc     |  19 ++
 33 files changed, 844 insertions(+), 42 deletions(-)
 create mode 100644 block/vxhs.c

-- 
2.9.3

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

* Re: [Qemu-devel] [PULL 00/12] Block patches
  2016-06-07 14:26 Stefan Hajnoczi
@ 2016-06-07 15:34 ` Peter Maydell
  0 siblings, 0 replies; 40+ messages in thread
From: Peter Maydell @ 2016-06-07 15:34 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: QEMU Developers

On 7 June 2016 at 15:26, Stefan Hajnoczi <stefanha@redhat.com> wrote:
> The following changes since commit 76462405809d29bab65a3699686998ba124ab942:
>
>   Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20160606-1' into staging (2016-06-06 17:02:42 +0100)
>
> are available in the git repository at:
>
>   git://github.com/stefanha/qemu.git tags/block-pull-request
>
> for you to fetch changes up to 8860eabdee32f78d9a34273a340b8f74476bc9a0:
>
>   throttle: refuse iops-size without iops-total/read/write (2016-06-07 14:40:51 +0100)
>
> ----------------------------------------------------------------
>
> ----------------------------------------------------------------

Applied, thanks.

-- PMM

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

* [Qemu-devel] [PULL 00/12] Block patches
@ 2016-06-07 14:26 Stefan Hajnoczi
  2016-06-07 15:34 ` Peter Maydell
  0 siblings, 1 reply; 40+ messages in thread
From: Stefan Hajnoczi @ 2016-06-07 14:26 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Stefan Hajnoczi

The following changes since commit 76462405809d29bab65a3699686998ba124ab942:

  Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20160606-1' into staging (2016-06-06 17:02:42 +0100)

are available in the git repository at:

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

for you to fetch changes up to 8860eabdee32f78d9a34273a340b8f74476bc9a0:

  throttle: refuse iops-size without iops-total/read/write (2016-06-07 14:40:51 +0100)

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

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

Changlong Xie (1):
  iostatus: fix comments for block_job_iostatus_reset

Eric Blake (1):
  block: Move BlockRequest type to io.c

Fam Zheng (5):
  blockdev-backup: Use bdrv_lookup_bs on target
  blockdev-backup: Don't move target AioContext if it's attached
  virtio-blk: Remove op blocker for dataplane
  virtio-scsi: Remove op blocker for dataplane
  block: Drop bdrv_ioctl_bh_cb

Kevin Wolf (1):
  block/io: Remove unused bdrv_aio_write_zeroes()

Peter Lieven (1):
  block/io: optimize bdrv_co_pwritev for small requests

Stefan Hajnoczi (3):
  tests: avoid coroutine pool test crash
  virtio: drop duplicate virtio_queue_get_id() function
  throttle: refuse iops-size without iops-total/read/write

 block/io.c                      | 60 +++++++++++++++++++-------------------
 blockdev.c                      | 23 ++++++++-------
 hw/block/dataplane/virtio-blk.c | 63 ----------------------------------------
 hw/scsi/virtio-scsi.c           | 64 +----------------------------------------
 hw/virtio/virtio.c              |  7 -----
 include/block/block.h           | 24 ----------------
 include/block/blockjob.h        |  2 +-
 include/hw/virtio/virtio-scsi.h | 11 -------
 include/hw/virtio/virtio.h      |  1 -
 tests/qemu-iotests/077          | 12 +-------
 tests/qemu-iotests/077.out      | 26 -----------------
 tests/test-coroutine.c          | 10 ++++++-
 tests/test-throttle.c           | 10 +++++++
 trace-events                    |  1 -
 util/throttle.c                 |  8 ++++++
 15 files changed, 74 insertions(+), 248 deletions(-)

-- 
2.5.5

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

* Re: [Qemu-devel] [PULL 00/12] Block patches
  2016-02-29 20:08 Jeff Cody
@ 2016-03-01 10:34 ` Peter Maydell
  0 siblings, 0 replies; 40+ messages in thread
From: Peter Maydell @ 2016-03-01 10:34 UTC (permalink / raw)
  To: Jeff Cody; +Cc: Fam Zheng, QEMU Developers, Qemu-block

On 29 February 2016 at 20:08, Jeff Cody <jcody@redhat.com> wrote:
> The following changes since commit 071608b519adf62bc29c914343a21c5407ab1ac9:
>
>   Merge remote-tracking branch 'remotes/kraxel/tags/pull-usb-20160229-1' into staging (2016-02-29 12:24:26 +0000)
>
> are available in the git repository at:
>
>
>   git@github.com:codyprime/qemu-kvm-jtc.git tags/block-pull-request
>
> for you to fetch changes up to cc199b16cf4cb9279aca73f5f5dce2cc337b9079:
>
>   iotests/124: Add cluster_size mismatch test (2016-02-29 14:55:14 -0500)
>
> ----------------------------------------------------------------
> Block patches
> ----------------------------------------------------------------
>

Applied, thanks.

-- PMM

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

* [Qemu-devel] [PULL 00/12] Block patches
@ 2016-02-29 20:08 Jeff Cody
  2016-03-01 10:34 ` Peter Maydell
  0 siblings, 1 reply; 40+ messages in thread
From: Jeff Cody @ 2016-02-29 20:08 UTC (permalink / raw)
  To: qemu-block; +Cc: peter.maydell, jcody, famz, qemu-devel

The following changes since commit 071608b519adf62bc29c914343a21c5407ab1ac9:

  Merge remote-tracking branch 'remotes/kraxel/tags/pull-usb-20160229-1' into staging (2016-02-29 12:24:26 +0000)

are available in the git repository at:


  git@github.com:codyprime/qemu-kvm-jtc.git tags/block-pull-request

for you to fetch changes up to cc199b16cf4cb9279aca73f5f5dce2cc337b9079:

  iotests/124: Add cluster_size mismatch test (2016-02-29 14:55:14 -0500)

----------------------------------------------------------------
Block patches
----------------------------------------------------------------

Daniel P. Berrange (3):
  rbd: add support for getting password from QCryptoSecret object
  curl: add support for HTTP authentication parameters
  iscsi: add support for getting CHAP password via QCryptoSecret API

Fam Zheng (2):
  mirror: Rewrite mirror_iteration
  mirror: Add mirror_wait_for_io

John Snow (3):
  block/backup: make backup cluster size configurable
  block/backup: avoid copying less than full target clusters
  iotests/124: Add cluster_size mismatch test

Max Reitz (2):
  vhdx: DIV_ROUND_UP() in vhdx_calc_bat_entries()
  vhdx: Simplify vhdx_set_shift_bits()

Peter Lieven (1):
  block/nfs: add support for setting debug level

Vasiliy Tolstov (1):
  sheepdog: allow to delete snapshot

 block/backup.c             |  87 +++++++----
 block/curl.c               |  66 +++++++++
 block/iscsi.c              |  24 ++-
 block/mirror.c             | 353 +++++++++++++++++++++++++++------------------
 block/nfs.c                |  12 ++
 block/rbd.c                |  47 ++++++
 block/sheepdog.c           | 125 +++++++++++++++-
 block/vhdx.c               |  18 +--
 tests/qemu-iotests/109.out |  80 +++++-----
 tests/qemu-iotests/124     |  58 +++++++-
 tests/qemu-iotests/124.out |   4 +-
 trace-events               |   1 -
 12 files changed, 641 insertions(+), 234 deletions(-)

-- 
1.9.3

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

* Re: [Qemu-devel] [PULL 00/12] Block patches
  2015-10-30 17:37     ` Peter Maydell
@ 2015-10-30 21:59       ` Peter Maydell
  0 siblings, 0 replies; 40+ messages in thread
From: Peter Maydell @ 2015-10-30 21:59 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: QEMU Developers, Stefan Hajnoczi

On 30 October 2015 at 17:37, Peter Maydell <peter.maydell@linaro.org> wrote:
> On 30 October 2015 at 14:19, Markus Armbruster <armbru@redhat.com> wrote:
>> Peter Maydell <peter.maydell@linaro.org> writes:
>>> I get an error on 64-bit ARM running the ivshmem tests:
>>>
>>> TEST: tests/ivshmem-test... (pid=22948)
>>>   /i386/ivshmem/single:                                                OK
>>>   /i386/ivshmem/pair:                                                  OK
>>>   /i386/ivshmem/server:                                                **
>>> ERROR:/home/petmay01/qemu/tests/ivshmem-test.c:345:test_ivshmem_server:
>>> assertion failed (ret != 0): (0 != 0)
>>> FAIL
>>> GTester: last random seed: R02S51e68a84790014e86af5b8b7264d3e39
>>> (pid=23709)
>>>   /i386/ivshmem/hotplug:                                               OK
>>>   /i386/ivshmem/memdev:                                                OK
>>> FAIL: tests/ivshmem-test
>>>
>>> Nothing obviously related in this patchset that would cause that,
>>> though...
>>
>> I've seen this, too, but throwing away my build tree made it go away, so
>> I blamed "make choking on stale build tree" syndrome.  Perhaps it's an
>> intermittent ivshmem bug instead.
>
> I didn't do a make clean before successfully applying other pulls,
> so I think my money is on "intermittent ivshmem issue". I'll have
> another go with this one once I've finished the rest of the queue...

Second try did indeed work fine, so I've applied it.

thanks
-- PMM

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

* Re: [Qemu-devel] [PULL 00/12] Block patches
  2015-10-30 14:19   ` Markus Armbruster
@ 2015-10-30 17:37     ` Peter Maydell
  2015-10-30 21:59       ` Peter Maydell
  0 siblings, 1 reply; 40+ messages in thread
From: Peter Maydell @ 2015-10-30 17:37 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: QEMU Developers, Stefan Hajnoczi

On 30 October 2015 at 14:19, Markus Armbruster <armbru@redhat.com> wrote:
> Peter Maydell <peter.maydell@linaro.org> writes:
>> I get an error on 64-bit ARM running the ivshmem tests:
>>
>> TEST: tests/ivshmem-test... (pid=22948)
>>   /i386/ivshmem/single:                                                OK
>>   /i386/ivshmem/pair:                                                  OK
>>   /i386/ivshmem/server:                                                **
>> ERROR:/home/petmay01/qemu/tests/ivshmem-test.c:345:test_ivshmem_server:
>> assertion failed (ret != 0): (0 != 0)
>> FAIL
>> GTester: last random seed: R02S51e68a84790014e86af5b8b7264d3e39
>> (pid=23709)
>>   /i386/ivshmem/hotplug:                                               OK
>>   /i386/ivshmem/memdev:                                                OK
>> FAIL: tests/ivshmem-test
>>
>> Nothing obviously related in this patchset that would cause that,
>> though...
>
> I've seen this, too, but throwing away my build tree made it go away, so
> I blamed "make choking on stale build tree" syndrome.  Perhaps it's an
> intermittent ivshmem bug instead.

I didn't do a make clean before successfully applying other pulls,
so I think my money is on "intermittent ivshmem issue". I'll have
another go with this one once I've finished the rest of the queue...

thanks
-- PMM

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

* Re: [Qemu-devel] [PULL 00/12] Block patches
  2015-10-30  9:40 ` Peter Maydell
@ 2015-10-30 14:19   ` Markus Armbruster
  2015-10-30 17:37     ` Peter Maydell
  0 siblings, 1 reply; 40+ messages in thread
From: Markus Armbruster @ 2015-10-30 14:19 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEMU Developers, Stefan Hajnoczi

Peter Maydell <peter.maydell@linaro.org> writes:

> On 29 October 2015 at 18:09, Stefan Hajnoczi <stefanha@redhat.com> wrote:
>> The following changes since commit 7bc8e0c967a4ef77657174d28af775691e18b4ce:
>>
>>   Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into
>> staging (2015-10-29 09:49:52 +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 37a639a7fbc5c6b065c80e7e2de78d22af735496:
>>
>>   block: Consider all child nodes in bdrv_requests_pending()
>> (2015-10-29 17:59:27 +0000)
>>
>> ----------------------------------------------------------------
>>
>> ----------------------------------------------------------------
>
> I get an error on 64-bit ARM running the ivshmem tests:
>
> TEST: tests/ivshmem-test... (pid=22948)
>   /i386/ivshmem/single:                                                OK
>   /i386/ivshmem/pair:                                                  OK
>   /i386/ivshmem/server:                                                **
> ERROR:/home/petmay01/qemu/tests/ivshmem-test.c:345:test_ivshmem_server:
> assertion failed (ret != 0): (0 != 0)
> FAIL
> GTester: last random seed: R02S51e68a84790014e86af5b8b7264d3e39
> (pid=23709)
>   /i386/ivshmem/hotplug:                                               OK
>   /i386/ivshmem/memdev:                                                OK
> FAIL: tests/ivshmem-test
>
> Nothing obviously related in this patchset that would cause that,
> though...

I've seen this, too, but throwing away my build tree made it go away, so
I blamed "make choking on stale build tree" syndrome.  Perhaps it's an
intermittent ivshmem bug instead.

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

* Re: [Qemu-devel] [PULL 00/12] Block patches
  2015-10-29 18:09 Stefan Hajnoczi
@ 2015-10-30  9:40 ` Peter Maydell
  2015-10-30 14:19   ` Markus Armbruster
  0 siblings, 1 reply; 40+ messages in thread
From: Peter Maydell @ 2015-10-30  9:40 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: QEMU Developers

On 29 October 2015 at 18:09, Stefan Hajnoczi <stefanha@redhat.com> wrote:
> The following changes since commit 7bc8e0c967a4ef77657174d28af775691e18b4ce:
>
>   Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging (2015-10-29 09:49:52 +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 37a639a7fbc5c6b065c80e7e2de78d22af735496:
>
>   block: Consider all child nodes in bdrv_requests_pending() (2015-10-29 17:59:27 +0000)
>
> ----------------------------------------------------------------
>
> ----------------------------------------------------------------

I get an error on 64-bit ARM running the ivshmem tests:

TEST: tests/ivshmem-test... (pid=22948)
  /i386/ivshmem/single:                                                OK
  /i386/ivshmem/pair:                                                  OK
  /i386/ivshmem/server:                                                **
ERROR:/home/petmay01/qemu/tests/ivshmem-test.c:345:test_ivshmem_server:
assertion failed (ret != 0): (0 != 0)
FAIL
GTester: last random seed: R02S51e68a84790014e86af5b8b7264d3e39
(pid=23709)
  /i386/ivshmem/hotplug:                                               OK
  /i386/ivshmem/memdev:                                                OK
FAIL: tests/ivshmem-test

Nothing obviously related in this patchset that would cause that,
though...

thanks
-- PMM

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

* [Qemu-devel] [PULL 00/12] Block patches
@ 2015-10-29 18:09 Stefan Hajnoczi
  2015-10-30  9:40 ` Peter Maydell
  0 siblings, 1 reply; 40+ messages in thread
From: Stefan Hajnoczi @ 2015-10-29 18:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Stefan Hajnoczi

The following changes since commit 7bc8e0c967a4ef77657174d28af775691e18b4ce:

  Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging (2015-10-29 09:49:52 +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 37a639a7fbc5c6b065c80e7e2de78d22af735496:

  block: Consider all child nodes in bdrv_requests_pending() (2015-10-29 17:59:27 +0000)

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

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

Cornelia Huck (3):
  s390x: include HW_COMPAT_* props
  ppc/spapr: add 2.4 compat props
  virtio-blk: switch off scsi-passthrough by default

Dr. David Alan Gilbert (1):
  gdb command: qemu handlers

Kevin Wolf (1):
  block: Consider all child nodes in bdrv_requests_pending()

Paolo Bonzini (3):
  qemu-gdb: allow using glibc_pointer_guard() on core dumps
  qemu-gdb: extract parts of "qemu coroutine" implementation
  qemu-gdb: add $qemu_coroutine_sp and $qemu_coroutine_pc

Pavel Butsykin (1):
  virtio: sync the dataplane vring state to the virtqueue before
    virtio_save

Sai Pavan Boddu (3):
  sd.h: Move sd.h to include/hw/sd/
  sdhci: Split sdhci.h for public and internal device usage
  target-arm: xlnx-zynqmp: Add sdhci support.

 block/io.c                   |  13 +-
 hw/arm/xlnx-zynqmp.c         |  28 ++++
 hw/block/virtio-blk.c        |   7 +-
 hw/ppc/spapr.c               |   9 ++
 hw/s390x/s390-virtio-ccw.c   |   2 +
 hw/scsi/virtio-scsi.c        |   5 +
 hw/sd/milkymist-memcard.c    |   2 +-
 hw/sd/omap_mmc.c             |   2 +-
 hw/sd/pl181.c                |   2 +-
 hw/sd/pxa2xx_mmci.c          |   2 +-
 hw/sd/sd.c                   |   2 +-
 hw/sd/sdhci-internal.h       | 232 +++++++++++++++++++++++++++++++++
 hw/sd/sdhci.c                |   3 +-
 hw/sd/sdhci.h                | 297 -------------------------------------------
 hw/sd/ssi-sd.c               |   2 +-
 include/hw/arm/xlnx-zynqmp.h |   3 +
 include/hw/compat.h          |   6 +-
 include/hw/sd.h              |  80 ------------
 include/hw/sd/sd.h           |  80 ++++++++++++
 include/hw/sd/sdhci.h        |  94 ++++++++++++++
 scripts/qemu-gdb.py          |   6 +-
 scripts/qemugdb/aio.py       |  58 +++++++++
 scripts/qemugdb/coroutine.py |  90 ++++++++-----
 23 files changed, 601 insertions(+), 424 deletions(-)
 create mode 100644 hw/sd/sdhci-internal.h
 delete mode 100644 hw/sd/sdhci.h
 delete mode 100644 include/hw/sd.h
 create mode 100644 include/hw/sd/sd.h
 create mode 100644 include/hw/sd/sdhci.h
 create mode 100644 scripts/qemugdb/aio.py

-- 
2.4.3

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

* Re: [Qemu-devel] [PULL 00/12] Block patches
  2015-01-23 18:20 Kevin Wolf
@ 2015-01-26 10:16 ` Peter Maydell
  0 siblings, 0 replies; 40+ messages in thread
From: Peter Maydell @ 2015-01-26 10:16 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: QEMU Developers

On 23 January 2015 at 18:20, Kevin Wolf <kwolf@redhat.com> wrote:
> The following changes since commit c6441452b50c44fdbb362b239ce623f77cf3cd51:
>
>   Merge remote-tracking branch 'remotes/kraxel/tags/pull-audio-20150122-1' into staging (2015-01-22 18:57:36 +0000)
>
> are available in the git repository at:
>
>
>   git://repo.or.cz/qemu/kevin.git tags/for-upstream
>
> for you to fetch changes up to bc63781ca350cad4c9eb142ce8f55bfaded4276e:
>
>   Merge remote-tracking branch 'mreitz/block' into queue-block (2015-01-23 18:51:47 +0100)
>
> ----------------------------------------------------------------
>
> Block patches for 2.3
>
> ----------------------------------------------------------------

Applied, thanks.

-- PMM

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

* [Qemu-devel] [PULL 00/12] Block patches
@ 2015-01-23 18:20 Kevin Wolf
  2015-01-26 10:16 ` Peter Maydell
  0 siblings, 1 reply; 40+ messages in thread
From: Kevin Wolf @ 2015-01-23 18:20 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf

The following changes since commit c6441452b50c44fdbb362b239ce623f77cf3cd51:

  Merge remote-tracking branch 'remotes/kraxel/tags/pull-audio-20150122-1' into staging (2015-01-22 18:57:36 +0000)

are available in the git repository at:


  git://repo.or.cz/qemu/kevin.git tags/for-upstream

for you to fetch changes up to bc63781ca350cad4c9eb142ce8f55bfaded4276e:

  Merge remote-tracking branch 'mreitz/block' into queue-block (2015-01-23 18:51:47 +0100)

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

Block patches for 2.3

----------------------------------------------------------------
Fam Zheng (2):
      virtio-blk: Pass req to virtio_blk_handle_scsi_req
      virtio-blk: Use blk_aio_ioctl

Jeff Cody (7):
      block: vmdk - make ret variable usage clear
      block: vmdk - move string allocations from stack to the heap
      block: qapi - move string allocation from stack to the heap
      block: remove unused variable in bdrv_commit
      block: mirror - change string allocation to 2-bytes
      block: update string sizes for filename,backing_file,exact_filename
      block: vhdx - force FileOffsetMB field to '0' for certain block states

Kevin Wolf (1):
      Merge remote-tracking branch 'mreitz/block' into queue-block

Max Reitz (3):
      qcow2: Add two more unalignment checks
      iotests: Add tests for more corruption cases
      iotests: Lower 064's memory usage

 block.c                        |   3 -
 block/mirror.c                 |   3 +-
 block/qapi.c                   |   7 ++-
 block/qcow.c                   |   2 +-
 block/qcow2-cluster.c          |  21 +++++++
 block/qcow2.c                  |   3 +-
 block/vhdx.c                   |  13 +++-
 block/vmdk.c                   |  51 +++++++++-------
 block/vvfat.c                  |   4 +-
 hw/block/virtio-blk.c          | 134 ++++++++++++++++++++++++++---------------
 include/block/block_int.h      |   8 +--
 include/hw/virtio/virtio-blk.h |   3 -
 qemu-img.c                     |   4 +-
 tests/qemu-iotests/060         |  15 +++++
 tests/qemu-iotests/060.out     |  13 ++++
 tests/qemu-iotests/064         |  19 +++++-
 tests/qemu-iotests/064.out     |  34 +++++++++--
 17 files changed, 239 insertions(+), 98 deletions(-)

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

* Re: [Qemu-devel] [PULL 00/12] Block patches
  2012-08-06 20:44 Kevin Wolf
  2012-08-07  8:28 ` Paolo Bonzini
@ 2012-08-07 15:36 ` Anthony Liguori
  1 sibling, 0 replies; 40+ messages in thread
From: Anthony Liguori @ 2012-08-07 15:36 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: qemu-devel

Kevin Wolf <kwolf@redhat.com> writes:

> The following changes since commit 26b9b5fe17cc1b6be2e8bf8b9d16094f420bb8ad:
>
>   virtio: fix vhost handling (2012-08-06 14:01:44 -0500)
>
> are available in the git repository at:
>   http://repo.or.cz/r/qemu/kevin.git for-anthony

Pulled. Thanks.

Regards,

Anthony Liguori

>
> Dong Xu Wang (1):
>       qemu-img: use QemuOpts instead of QEMUOptionParameter in resize function
>
> Kevin Wolf (1):
>       qemu-iotests: Be more flexible with image creation options
>
> Markus Armbruster (1):
>       ide scsi: Mess with geometry only for hard disk devices
>
> Paolo Bonzini (1):
>       qapi: generalize documentation of streaming commands
>
> Stefan Hajnoczi (8):
>       qemu-iotests: add qed.py image manipulation utility
>       docs: add dirty bit to qcow2 specification
>       qcow2: introduce dirty bit
>       docs: add lazy refcounts bit to qcow2 specification
>       qemu-iotests: ignore qemu-img create lazy_refcounts output
>       qcow2: implement lazy refcounts
>       qemu-io: add "abort" command to simulate program crash
>       qemu-iotests: add 039 qcow2 lazy refcounts test
>
>  block/qcow2-cluster.c        |    5 +-
>  block/qcow2.c                |  123 +++++++++++++++++++++--
>  block/qcow2.h                |   21 ++++
>  block_int.h                  |   26 +++--
>  docs/specs/qcow2.txt         |   14 ++-
>  hmp-commands.hx              |    2 +-
>  hw/ide/qdev.c                |    3 +-
>  hw/scsi-disk.c               |    3 +-
>  qapi-schema.json             |   17 ++--
>  qemu-img.c                   |   28 +++--
>  qemu-io.c                    |   12 ++
>  tests/qemu-iotests/031.out   |   20 ++--
>  tests/qemu-iotests/036.out   |    4 +-
>  tests/qemu-iotests/039       |  136 ++++++++++++++++++++++++
>  tests/qemu-iotests/039.out   |   53 ++++++++++
>  tests/qemu-iotests/common.rc |    7 +-
>  tests/qemu-iotests/group     |    1 +
>  tests/qemu-iotests/qed.py    |  235 ++++++++++++++++++++++++++++++++++++++++++
>  18 files changed, 650 insertions(+), 60 deletions(-)
>  create mode 100755 tests/qemu-iotests/039
>  create mode 100644 tests/qemu-iotests/039.out
>  create mode 100755 tests/qemu-iotests/qed.py

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

* Re: [Qemu-devel] [PULL 00/12] Block patches
  2012-08-06 20:44 Kevin Wolf
@ 2012-08-07  8:28 ` Paolo Bonzini
  2012-08-07 15:36 ` Anthony Liguori
  1 sibling, 0 replies; 40+ messages in thread
From: Paolo Bonzini @ 2012-08-07  8:28 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: qemu-devel, anthony

Il 06/08/2012 22:44, Kevin Wolf ha scritto:
> The following changes since commit 26b9b5fe17cc1b6be2e8bf8b9d16094f420bb8ad:
> 
>   virtio: fix vhost handling (2012-08-06 14:01:44 -0500)

I see the virtio caching patches are not included, should I resubmit
them together with the change of the default from writethrough to writeback?

Paolo

> are available in the git repository at:
>   http://repo.or.cz/r/qemu/kevin.git for-anthony
> 
> Dong Xu Wang (1):
>       qemu-img: use QemuOpts instead of QEMUOptionParameter in resize function
> 
> Kevin Wolf (1):
>       qemu-iotests: Be more flexible with image creation options
> 
> Markus Armbruster (1):
>       ide scsi: Mess with geometry only for hard disk devices
> 
> Paolo Bonzini (1):
>       qapi: generalize documentation of streaming commands
> 
> Stefan Hajnoczi (8):
>       qemu-iotests: add qed.py image manipulation utility
>       docs: add dirty bit to qcow2 specification
>       qcow2: introduce dirty bit
>       docs: add lazy refcounts bit to qcow2 specification
>       qemu-iotests: ignore qemu-img create lazy_refcounts output
>       qcow2: implement lazy refcounts
>       qemu-io: add "abort" command to simulate program crash
>       qemu-iotests: add 039 qcow2 lazy refcounts test
> 
>  block/qcow2-cluster.c        |    5 +-
>  block/qcow2.c                |  123 +++++++++++++++++++++--
>  block/qcow2.h                |   21 ++++
>  block_int.h                  |   26 +++--
>  docs/specs/qcow2.txt         |   14 ++-
>  hmp-commands.hx              |    2 +-
>  hw/ide/qdev.c                |    3 +-
>  hw/scsi-disk.c               |    3 +-
>  qapi-schema.json             |   17 ++--
>  qemu-img.c                   |   28 +++--
>  qemu-io.c                    |   12 ++
>  tests/qemu-iotests/031.out   |   20 ++--
>  tests/qemu-iotests/036.out   |    4 +-
>  tests/qemu-iotests/039       |  136 ++++++++++++++++++++++++
>  tests/qemu-iotests/039.out   |   53 ++++++++++
>  tests/qemu-iotests/common.rc |    7 +-
>  tests/qemu-iotests/group     |    1 +
>  tests/qemu-iotests/qed.py    |  235 ++++++++++++++++++++++++++++++++++++++++++
>  18 files changed, 650 insertions(+), 60 deletions(-)
>  create mode 100755 tests/qemu-iotests/039
>  create mode 100644 tests/qemu-iotests/039.out
>  create mode 100755 tests/qemu-iotests/qed.py
> 
> 

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

* [Qemu-devel] [PULL 00/12] Block patches
@ 2012-08-06 20:44 Kevin Wolf
  2012-08-07  8:28 ` Paolo Bonzini
  2012-08-07 15:36 ` Anthony Liguori
  0 siblings, 2 replies; 40+ messages in thread
From: Kevin Wolf @ 2012-08-06 20:44 UTC (permalink / raw)
  To: anthony; +Cc: kwolf, qemu-devel

The following changes since commit 26b9b5fe17cc1b6be2e8bf8b9d16094f420bb8ad:

  virtio: fix vhost handling (2012-08-06 14:01:44 -0500)

are available in the git repository at:
  http://repo.or.cz/r/qemu/kevin.git for-anthony

Dong Xu Wang (1):
      qemu-img: use QemuOpts instead of QEMUOptionParameter in resize function

Kevin Wolf (1):
      qemu-iotests: Be more flexible with image creation options

Markus Armbruster (1):
      ide scsi: Mess with geometry only for hard disk devices

Paolo Bonzini (1):
      qapi: generalize documentation of streaming commands

Stefan Hajnoczi (8):
      qemu-iotests: add qed.py image manipulation utility
      docs: add dirty bit to qcow2 specification
      qcow2: introduce dirty bit
      docs: add lazy refcounts bit to qcow2 specification
      qemu-iotests: ignore qemu-img create lazy_refcounts output
      qcow2: implement lazy refcounts
      qemu-io: add "abort" command to simulate program crash
      qemu-iotests: add 039 qcow2 lazy refcounts test

 block/qcow2-cluster.c        |    5 +-
 block/qcow2.c                |  123 +++++++++++++++++++++--
 block/qcow2.h                |   21 ++++
 block_int.h                  |   26 +++--
 docs/specs/qcow2.txt         |   14 ++-
 hmp-commands.hx              |    2 +-
 hw/ide/qdev.c                |    3 +-
 hw/scsi-disk.c               |    3 +-
 qapi-schema.json             |   17 ++--
 qemu-img.c                   |   28 +++--
 qemu-io.c                    |   12 ++
 tests/qemu-iotests/031.out   |   20 ++--
 tests/qemu-iotests/036.out   |    4 +-
 tests/qemu-iotests/039       |  136 ++++++++++++++++++++++++
 tests/qemu-iotests/039.out   |   53 ++++++++++
 tests/qemu-iotests/common.rc |    7 +-
 tests/qemu-iotests/group     |    1 +
 tests/qemu-iotests/qed.py    |  235 ++++++++++++++++++++++++++++++++++++++++++
 18 files changed, 650 insertions(+), 60 deletions(-)
 create mode 100755 tests/qemu-iotests/039
 create mode 100644 tests/qemu-iotests/039.out
 create mode 100755 tests/qemu-iotests/qed.py

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

* Re: [Qemu-devel] [PULL 00/12] Block patches
  2012-06-08 14:07     ` Anthony Liguori
@ 2012-06-08 14:57       ` Kevin Wolf
  0 siblings, 0 replies; 40+ messages in thread
From: Kevin Wolf @ 2012-06-08 14:57 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: qemu-devel

Am 08.06.2012 16:07, schrieb Anthony Liguori:
> On 06/08/2012 05:48 PM, Kevin Wolf wrote:
>> Am 07.06.2012 03:17, schrieb Anthony Liguori:
>>> On 06/04/2012 07:13 PM, Kevin Wolf wrote:
>>>> The following changes since commit 8cc9b43f7c5f826b39af4b012ad89bb55faac29c:
>>>>
>>>>     target-microblaze: lwx/swx: first implementation (2012-06-04 10:19:46 +0200)
>>>>
>>>> are available in the git repository at:
>>>>     git://repo.or.cz/qemu/kevin.git for-anthony
>>>
>>> Pulled.  Thanks.
>>
>> But not pushed?
> 
> I'm having a really hard time connecting to repo.or.cz here.  Looks like I 
> mistook a timeout for success and mistakenly merged nothing.
> 
> I'm still having trouble getting to repo.or.cz.  I'll be back in the States 
> Saturday evening so will process this pull Sunday or Monday.

Hm, when repo.or.cz started behaving bad, I started to use things like
'while ! git fetch repo.or.cz; do sleep 1; done' (it would always
succeed after a few attempts), but recently it never needed more than
one attempt.

> Do you want to update the branch in the interim to fix the build issue?

Sure, updated it now.

Kevin

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

* Re: [Qemu-devel] [PULL 00/12] Block patches
  2012-06-08  9:48   ` Kevin Wolf
@ 2012-06-08 14:07     ` Anthony Liguori
  2012-06-08 14:57       ` Kevin Wolf
  0 siblings, 1 reply; 40+ messages in thread
From: Anthony Liguori @ 2012-06-08 14:07 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: qemu-devel

On 06/08/2012 05:48 PM, Kevin Wolf wrote:
> Am 07.06.2012 03:17, schrieb Anthony Liguori:
>> On 06/04/2012 07:13 PM, Kevin Wolf wrote:
>>> The following changes since commit 8cc9b43f7c5f826b39af4b012ad89bb55faac29c:
>>>
>>>     target-microblaze: lwx/swx: first implementation (2012-06-04 10:19:46 +0200)
>>>
>>> are available in the git repository at:
>>>     git://repo.or.cz/qemu/kevin.git for-anthony
>>
>> Pulled.  Thanks.
>
> But not pushed?

I'm having a really hard time connecting to repo.or.cz here.  Looks like I 
mistook a timeout for success and mistakenly merged nothing.

I'm still having trouble getting to repo.or.cz.  I'll be back in the States 
Saturday evening so will process this pull Sunday or Monday.

Do you want to update the branch in the interim to fix the build issue?

Regards,

Anthony Liguori

>
> Kevin

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

* Re: [Qemu-devel] [PULL 00/12] Block patches
  2012-06-07  1:17 ` Anthony Liguori
@ 2012-06-08  9:48   ` Kevin Wolf
  2012-06-08 14:07     ` Anthony Liguori
  0 siblings, 1 reply; 40+ messages in thread
From: Kevin Wolf @ 2012-06-08  9:48 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: qemu-devel

Am 07.06.2012 03:17, schrieb Anthony Liguori:
> On 06/04/2012 07:13 PM, Kevin Wolf wrote:
>> The following changes since commit 8cc9b43f7c5f826b39af4b012ad89bb55faac29c:
>>
>>    target-microblaze: lwx/swx: first implementation (2012-06-04 10:19:46 +0200)
>>
>> are available in the git repository at:
>>    git://repo.or.cz/qemu/kevin.git for-anthony
> 
> Pulled.  Thanks.

But not pushed?

Kevin

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

* Re: [Qemu-devel] [PULL 00/12] Block patches
  2012-06-04 11:13 Kevin Wolf
@ 2012-06-07  1:17 ` Anthony Liguori
  2012-06-08  9:48   ` Kevin Wolf
  0 siblings, 1 reply; 40+ messages in thread
From: Anthony Liguori @ 2012-06-07  1:17 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: qemu-devel

On 06/04/2012 07:13 PM, Kevin Wolf wrote:
> The following changes since commit 8cc9b43f7c5f826b39af4b012ad89bb55faac29c:
>
>    target-microblaze: lwx/swx: first implementation (2012-06-04 10:19:46 +0200)
>
> are available in the git repository at:
>    git://repo.or.cz/qemu/kevin.git for-anthony

Pulled.  Thanks.

Regards,

Anthony Liguori

>
> Josh Durgin (1):
>        rbd: hook up cache options
>
> Kevin Wolf (3):
>        qemu-img check -r for repairing images
>        qemu-img check: Print fixed clusters and recheck
>        qcow2: Support for fixing refcount inconsistencies
>
> MORITA Kazutaka (1):
>        sheepdog: add coroutine_fn markers to coroutine functions
>
> Markus Armbruster (1):
>        Un-inline fdctrl_init_isa()
>
> Paolo Bonzini (4):
>        block: implement is_allocated for raw
>        stream: tweak usage of bdrv_co_is_allocated
>        stream: move is_allocated_above to block.c
>        stream: move rate limiting to a separate header file
>
> Zhi Yong Wu (2):
>        qcow2: remove a line of unnecessary code
>        qcow2: fix the byte endian convertion
>
>   block.c                  |   53 +++++++++++++++++++++-
>   block.h                  |   13 +++++-
>   block/qcow2-cluster.c    |    1 -
>   block/qcow2-refcount.c   |   33 ++++++++++++--
>   block/qcow2.c            |    5 +-
>   block/qcow2.h            |    3 +-
>   block/qed-check.c        |    2 +
>   block/qed.c              |    5 +-
>   block/raw-posix.c        |   98 +++++++++++++++++++++++++++++++++++++++++
>   block/raw.c              |    8 +++
>   block/rbd.c              |   19 ++++++++
>   block/sheepdog.c         |    9 ++--
>   block/stream.c           |  109 +++++++---------------------------------------
>   block/vdi.c              |    7 +++-
>   block_int.h              |    3 +-
>   hw/fdc.c                 |   20 ++++++++
>   hw/fdc.h                 |   24 +---------
>   hw/ide/piix.c            |    3 +-
>   hw/isa.h                 |    2 -
>   hw/pc_sysfw.c            |    1 +
>   include/qemu/ratelimit.h |   48 ++++++++++++++++++++
>   qemu-common.h            |    1 +
>   qemu-img-cmds.hx         |    4 +-
>   qemu-img.c               |   35 +++++++++++++-
>   qemu-img.texi            |    7 +++-
>   25 files changed, 369 insertions(+), 144 deletions(-)
>   create mode 100644 include/qemu/ratelimit.h
>
>

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

* [Qemu-devel] [PULL 00/12] Block patches
@ 2012-06-04 11:13 Kevin Wolf
  2012-06-07  1:17 ` Anthony Liguori
  0 siblings, 1 reply; 40+ messages in thread
From: Kevin Wolf @ 2012-06-04 11:13 UTC (permalink / raw)
  To: anthony; +Cc: kwolf, qemu-devel

The following changes since commit 8cc9b43f7c5f826b39af4b012ad89bb55faac29c:

  target-microblaze: lwx/swx: first implementation (2012-06-04 10:19:46 +0200)

are available in the git repository at:
  git://repo.or.cz/qemu/kevin.git for-anthony

Josh Durgin (1):
      rbd: hook up cache options

Kevin Wolf (3):
      qemu-img check -r for repairing images
      qemu-img check: Print fixed clusters and recheck
      qcow2: Support for fixing refcount inconsistencies

MORITA Kazutaka (1):
      sheepdog: add coroutine_fn markers to coroutine functions

Markus Armbruster (1):
      Un-inline fdctrl_init_isa()

Paolo Bonzini (4):
      block: implement is_allocated for raw
      stream: tweak usage of bdrv_co_is_allocated
      stream: move is_allocated_above to block.c
      stream: move rate limiting to a separate header file

Zhi Yong Wu (2):
      qcow2: remove a line of unnecessary code
      qcow2: fix the byte endian convertion

 block.c                  |   53 +++++++++++++++++++++-
 block.h                  |   13 +++++-
 block/qcow2-cluster.c    |    1 -
 block/qcow2-refcount.c   |   33 ++++++++++++--
 block/qcow2.c            |    5 +-
 block/qcow2.h            |    3 +-
 block/qed-check.c        |    2 +
 block/qed.c              |    5 +-
 block/raw-posix.c        |   98 +++++++++++++++++++++++++++++++++++++++++
 block/raw.c              |    8 +++
 block/rbd.c              |   19 ++++++++
 block/sheepdog.c         |    9 ++--
 block/stream.c           |  109 +++++++---------------------------------------
 block/vdi.c              |    7 +++-
 block_int.h              |    3 +-
 hw/fdc.c                 |   20 ++++++++
 hw/fdc.h                 |   24 +---------
 hw/ide/piix.c            |    3 +-
 hw/isa.h                 |    2 -
 hw/pc_sysfw.c            |    1 +
 include/qemu/ratelimit.h |   48 ++++++++++++++++++++
 qemu-common.h            |    1 +
 qemu-img-cmds.hx         |    4 +-
 qemu-img.c               |   35 +++++++++++++-
 qemu-img.texi            |    7 +++-
 25 files changed, 369 insertions(+), 144 deletions(-)
 create mode 100644 include/qemu/ratelimit.h

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

* Re: [Qemu-devel] [PULL 00/12] Block patches
  2011-06-08 13:48 Kevin Wolf
@ 2011-06-09 12:39 ` Anthony Liguori
  0 siblings, 0 replies; 40+ messages in thread
From: Anthony Liguori @ 2011-06-09 12:39 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: qemu-devel

On 06/08/2011 08:48 AM, Kevin Wolf wrote:
> The following changes since commit a90d4690074526f54ad0851fce19fa6783f06803:
>
>    Add an isa device for SGA (2011-06-07 13:52:30 -0500)
>
> are available in the git repository at:
>    git://repo.or.cz/qemu/kevin.git for-anthony

Pulled.  Thanks.

Regards,

Anthony Liguori

>
> Alexander Graf (1):
>        vmdk: fix endianness bugs
>
> Christoph Egger (2):
>        block/raw-posix: use a character device if a block device is given
>        block/raw-posix: get right partition size
>
> Christoph Hellwig (1):
>        block: clarify the meaning of BDRV_O_NOCACHE
>
> Josh Durgin (4):
>        rbd: use the higher level librbd instead of just librados
>        rbd: allow configuration of rados from the rbd filename
>        rbd: check return values when scheduling aio
>        rbd: Add bdrv_truncate implementation
>
> Kevin Wolf (4):
>        ide/core: Remove explicit setting of BM_STATUS_INT
>        qcow2: Fix memory leaks in error cases
>        bdrv_img_create: Fix segfault
>        qemu-img create: Fix displayed default cluster size
>
>   block.c                |   13 +-
>   block/qcow2-cluster.c  |    2 +-
>   block/qcow2-refcount.c |    9 +-
>   block/qcow2.c          |    7 +-
>   block/qcow2.h          |    2 +
>   block/qed.c            |    3 +-
>   block/raw-posix.c      |   77 ++++-
>   block/raw-win32.c      |   12 +-
>   block/rbd.c            |  896 ++++++++++++++++++------------------------------
>   block/rbd_types.h      |   71 ----
>   block/vdi.c            |    6 +-
>   block/vmdk.c           |   22 +-
>   blockdev.c             |    2 +-
>   configure              |   33 +--
>   hw/ide/core.c          |    7 +-
>   qemu-io.c              |    4 +-
>   qemu-nbd.c             |    2 +-
>   17 files changed, 461 insertions(+), 707 deletions(-)
>   delete mode 100644 block/rbd_types.h
>
>

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

* [Qemu-devel] [PULL 00/12] Block patches
@ 2011-06-08 13:48 Kevin Wolf
  2011-06-09 12:39 ` Anthony Liguori
  0 siblings, 1 reply; 40+ messages in thread
From: Kevin Wolf @ 2011-06-08 13:48 UTC (permalink / raw)
  To: anthony; +Cc: kwolf, qemu-devel

The following changes since commit a90d4690074526f54ad0851fce19fa6783f06803:

  Add an isa device for SGA (2011-06-07 13:52:30 -0500)

are available in the git repository at:
  git://repo.or.cz/qemu/kevin.git for-anthony

Alexander Graf (1):
      vmdk: fix endianness bugs

Christoph Egger (2):
      block/raw-posix: use a character device if a block device is given
      block/raw-posix: get right partition size

Christoph Hellwig (1):
      block: clarify the meaning of BDRV_O_NOCACHE

Josh Durgin (4):
      rbd: use the higher level librbd instead of just librados
      rbd: allow configuration of rados from the rbd filename
      rbd: check return values when scheduling aio
      rbd: Add bdrv_truncate implementation

Kevin Wolf (4):
      ide/core: Remove explicit setting of BM_STATUS_INT
      qcow2: Fix memory leaks in error cases
      bdrv_img_create: Fix segfault
      qemu-img create: Fix displayed default cluster size

 block.c                |   13 +-
 block/qcow2-cluster.c  |    2 +-
 block/qcow2-refcount.c |    9 +-
 block/qcow2.c          |    7 +-
 block/qcow2.h          |    2 +
 block/qed.c            |    3 +-
 block/raw-posix.c      |   77 ++++-
 block/raw-win32.c      |   12 +-
 block/rbd.c            |  896 ++++++++++++++++++------------------------------
 block/rbd_types.h      |   71 ----
 block/vdi.c            |    6 +-
 block/vmdk.c           |   22 +-
 blockdev.c             |    2 +-
 configure              |   33 +--
 hw/ide/core.c          |    7 +-
 qemu-io.c              |    4 +-
 qemu-nbd.c             |    2 +-
 17 files changed, 461 insertions(+), 707 deletions(-)
 delete mode 100644 block/rbd_types.h

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

end of thread, other threads:[~2019-09-10  9:28 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-27 20:16 [Qemu-devel] [PULL 00/12] Block patches Stefan Hajnoczi
2019-08-27 20:16 ` [Qemu-devel] [PULL 01/12] util/iov: introduce qemu_iovec_init_extended Stefan Hajnoczi
2019-09-09 17:39   ` Peter Maydell
2019-09-10  9:03     ` Vladimir Sementsov-Ogievskiy
2019-08-27 20:16 ` [Qemu-devel] [PULL 02/12] util/iov: improve qemu_iovec_is_zero Stefan Hajnoczi
2019-08-27 20:16 ` [Qemu-devel] [PULL 03/12] block/io: refactor padding Stefan Hajnoczi
2019-08-27 20:16 ` [Qemu-devel] [PULL 04/12] block: define .*_part io handlers in BlockDriver Stefan Hajnoczi
2019-08-27 20:16 ` [Qemu-devel] [PULL 05/12] block/io: bdrv_co_do_copy_on_readv: use and support qiov_offset Stefan Hajnoczi
2019-08-27 20:16 ` [Qemu-devel] [PULL 06/12] block/io: bdrv_co_do_copy_on_readv: lazy allocation Stefan Hajnoczi
2019-08-27 20:16 ` [Qemu-devel] [PULL 07/12] block/io: bdrv_aligned_preadv: use and support qiov_offset Stefan Hajnoczi
2019-08-27 20:16 ` [Qemu-devel] [PULL 08/12] block/io: bdrv_aligned_pwritev: " Stefan Hajnoczi
2019-08-27 20:16 ` [Qemu-devel] [PULL 09/12] block/io: introduce bdrv_co_p{read, write}v_part Stefan Hajnoczi
2019-08-27 20:16 ` [Qemu-devel] [PULL 10/12] block/qcow2: refactor qcow2_co_preadv to use buffer-based io Stefan Hajnoczi
2019-08-27 20:16 ` [Qemu-devel] [PULL 11/12] block/qcow2: implement .bdrv_co_preadv_part Stefan Hajnoczi
2019-08-27 20:16 ` [Qemu-devel] [PULL 12/12] block/qcow2: implement .bdrv_co_pwritev(_compressed)_part Stefan Hajnoczi
2019-09-03 10:05 ` [Qemu-devel] [PULL 00/12] Block patches Peter Maydell
  -- strict thread matches above, loose matches on Subject: below --
2017-05-26 19:23 Jeff Cody
2017-04-21 13:46 Jeff Cody
2017-04-21 16:55 ` Peter Maydell
2016-06-07 14:26 Stefan Hajnoczi
2016-06-07 15:34 ` Peter Maydell
2016-02-29 20:08 Jeff Cody
2016-03-01 10:34 ` Peter Maydell
2015-10-29 18:09 Stefan Hajnoczi
2015-10-30  9:40 ` Peter Maydell
2015-10-30 14:19   ` Markus Armbruster
2015-10-30 17:37     ` Peter Maydell
2015-10-30 21:59       ` Peter Maydell
2015-01-23 18:20 Kevin Wolf
2015-01-26 10:16 ` Peter Maydell
2012-08-06 20:44 Kevin Wolf
2012-08-07  8:28 ` Paolo Bonzini
2012-08-07 15:36 ` Anthony Liguori
2012-06-04 11:13 Kevin Wolf
2012-06-07  1:17 ` Anthony Liguori
2012-06-08  9:48   ` Kevin Wolf
2012-06-08 14:07     ` Anthony Liguori
2012-06-08 14:57       ` Kevin Wolf
2011-06-08 13:48 Kevin Wolf
2011-06-09 12:39 ` Anthony Liguori

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).