From: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
Anthony Liguori <aliguori@us.ibm.com>,
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Subject: [Qemu-devel] [PATCH 7/8] qed: Add QED_CF_STREAM flag to auto-enable streaming
Date: Wed, 27 Apr 2011 14:27:34 +0100 [thread overview]
Message-ID: <1303910855-28999-8-git-send-email-stefanha@linux.vnet.ibm.com> (raw)
In-Reply-To: <1303910855-28999-1-git-send-email-stefanha@linux.vnet.ibm.com>
The QED_CF_STREAM flag can be set to automatically stream from the
backing file.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
---
block/qed.c | 5 +++++
block/qed.h | 6 +++++-
2 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/block/qed.c b/block/qed.c
index 2c155d9..a61cee9 100644
--- a/block/qed.c
+++ b/block/qed.c
@@ -373,6 +373,11 @@ static int bdrv_qed_open(BlockDriverState *bs, int flags)
if (s->header.features & QED_F_BACKING_FORMAT_NO_PROBE) {
pstrcpy(bs->backing_format, sizeof(bs->backing_format), "raw");
}
+
+ if ((s->header.compat_features & QED_CF_STREAM) &&
+ !bdrv_is_read_only(bs->file)) {
+ bs->stream = 1;
+ }
}
/* Reset unknown autoclear feature bits. This is a backwards
diff --git a/block/qed.h b/block/qed.h
index 8e9e415..23a9bde 100644
--- a/block/qed.h
+++ b/block/qed.h
@@ -59,13 +59,17 @@ enum {
/* Reads to the backing file should populate the image file */
QED_CF_COPY_ON_READ = 0x01,
+ /* Stream until the backing image is no longer needed */
+ QED_CF_STREAM = 0x02,
+
/* Supported feature bits */
QED_FEATURE_MASK = QED_F_BACKING_FILE |
QED_F_NEED_CHECK |
QED_F_BACKING_FORMAT_NO_PROBE,
/* Supported compat feature bits */
- QED_COMPAT_FEATURE_MASK = QED_CF_COPY_ON_READ,
+ QED_COMPAT_FEATURE_MASK = QED_CF_COPY_ON_READ |
+ QED_CF_STREAM,
/* Supported autoclear feature bits */
QED_AUTOCLEAR_FEATURE_MASK = 0,
--
1.7.4.4
next prev parent reply other threads:[~2011-04-27 13:27 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-27 13:27 [Qemu-devel] [RFC PATCH 0/8] QED image streaming Stefan Hajnoczi
2011-04-27 13:27 ` [Qemu-devel] [PATCH 1/8] block: add bdrv_aio_stream Stefan Hajnoczi
2011-04-29 11:56 ` Kevin Wolf
2011-05-06 13:21 ` Stefan Hajnoczi
2011-05-06 13:36 ` Kevin Wolf
2011-05-06 15:47 ` Stefan Hajnoczi
2011-04-27 13:27 ` [Qemu-devel] [PATCH 2/8] qmp: Add QMP support for stream commands Stefan Hajnoczi
2011-04-29 12:09 ` Kevin Wolf
2011-05-06 13:23 ` Stefan Hajnoczi
2011-04-27 13:27 ` [Qemu-devel] [PATCH 3/8] qed: add support for Copy-on-Read Stefan Hajnoczi
2011-04-27 14:29 ` Paolo Bonzini
2011-04-29 12:14 ` Kevin Wolf
2011-05-06 13:24 ` Stefan Hajnoczi
2011-04-27 13:27 ` [Qemu-devel] [PATCH 4/8] qed: intelligent streaming implementation Stefan Hajnoczi
2011-04-27 13:27 ` [Qemu-devel] [PATCH 5/8] qed: detect zero writes and skip them when to an unalloc cluster Stefan Hajnoczi
2011-04-27 13:27 ` [Qemu-devel] [PATCH 6/8] blockdev: Allow image files to auto-enable streaming Stefan Hajnoczi
2011-04-29 12:20 ` Kevin Wolf
2011-04-27 13:27 ` Stefan Hajnoczi [this message]
2011-04-27 13:27 ` [Qemu-devel] [PATCH 8/8] qed: Add -o stream=on image creation option Stefan Hajnoczi
2011-04-27 13:41 ` [Qemu-devel] [RFC PATCH 0/8] QED image streaming Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1303910855-28999-8-git-send-email-stefanha@linux.vnet.ibm.com \
--to=stefanha@linux.vnet.ibm.com \
--cc=aliguori@us.ibm.com \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).