|
|
8b1478 |
From de5542b5a8dc74f413bf2f1b0d5f4b370aa6801b Mon Sep 17 00:00:00 2001
|
|
|
8b1478 |
From: Maxim Levitsky <mlevitsk@redhat.com>
|
|
|
8b1478 |
Date: Wed, 5 Jun 2019 13:57:05 +0200
|
|
|
8b1478 |
Subject: [PATCH 17/23] qemu-io: Add write -n for BDRV_REQ_NO_FALLBACK
|
|
|
8b1478 |
|
|
|
8b1478 |
RH-Author: Maxim Levitsky <mlevitsk@redhat.com>
|
|
|
8b1478 |
Message-id: <20190605135705.24526-10-mlevitsk@redhat.com>
|
|
|
8b1478 |
Patchwork-id: 88565
|
|
|
8b1478 |
O-Subject: [RHEL-7.7 qemu-kvm-rhev PATCH 9/9] qemu-io: Add write -n for BDRV_REQ_NO_FALLBACK
|
|
|
8b1478 |
Bugzilla: 1648622
|
|
|
8b1478 |
RH-Acked-by: Max Reitz <mreitz@redhat.com>
|
|
|
8b1478 |
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
8b1478 |
RH-Acked-by: John Snow <jsnow@redhat.com>
|
|
|
8b1478 |
|
|
|
8b1478 |
From: Kevin Wolf <kwolf@redhat.com>
|
|
|
8b1478 |
|
|
|
8b1478 |
This makes the new BDRV_REQ_NO_FALLBACK flag available in the qemu-io
|
|
|
8b1478 |
write command.
|
|
|
8b1478 |
|
|
|
8b1478 |
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
8b1478 |
Acked-by: Eric Blake <eblake@redhat.com>
|
|
|
8b1478 |
|
|
|
8b1478 |
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1648622
|
|
|
8b1478 |
|
|
|
8b1478 |
Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
|
|
|
8b1478 |
(Cherry picked from c6e3f520c802c5cb2de80576aba7f9f1fe985d8b)
|
|
|
8b1478 |
|
|
|
8b1478 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
8b1478 |
---
|
|
|
8b1478 |
qemu-io-cmds.c | 13 +++++++++++--
|
|
|
8b1478 |
1 file changed, 11 insertions(+), 2 deletions(-)
|
|
|
8b1478 |
|
|
|
8b1478 |
diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c
|
|
|
8b1478 |
index 9c51e57..ac8c533 100644
|
|
|
8b1478 |
--- a/qemu-io-cmds.c
|
|
|
8b1478 |
+++ b/qemu-io-cmds.c
|
|
|
8b1478 |
@@ -945,6 +945,7 @@ static void write_help(void)
|
|
|
8b1478 |
" -b, -- write to the VM state rather than the virtual disk\n"
|
|
|
8b1478 |
" -c, -- write compressed data with blk_write_compressed\n"
|
|
|
8b1478 |
" -f, -- use Force Unit Access semantics\n"
|
|
|
8b1478 |
+" -n, -- with -z, don't allow slow fallback\n"
|
|
|
8b1478 |
" -p, -- ignored for backwards compatibility\n"
|
|
|
8b1478 |
" -P, -- use different pattern to fill file\n"
|
|
|
8b1478 |
" -C, -- report statistics in a machine parsable format\n"
|
|
|
8b1478 |
@@ -963,7 +964,7 @@ static const cmdinfo_t write_cmd = {
|
|
|
8b1478 |
.perm = BLK_PERM_WRITE,
|
|
|
8b1478 |
.argmin = 2,
|
|
|
8b1478 |
.argmax = -1,
|
|
|
8b1478 |
- .args = "[-bcCfquz] [-P pattern] off len",
|
|
|
8b1478 |
+ .args = "[-bcCfnquz] [-P pattern] off len",
|
|
|
8b1478 |
.oneline = "writes a number of bytes at a specified offset",
|
|
|
8b1478 |
.help = write_help,
|
|
|
8b1478 |
};
|
|
|
8b1478 |
@@ -982,7 +983,7 @@ static int write_f(BlockBackend *blk, int argc, char **argv)
|
|
|
8b1478 |
int64_t total = 0;
|
|
|
8b1478 |
int pattern = 0xcd;
|
|
|
8b1478 |
|
|
|
8b1478 |
- while ((c = getopt(argc, argv, "bcCfpP:quz")) != -1) {
|
|
|
8b1478 |
+ while ((c = getopt(argc, argv, "bcCfnpP:quz")) != -1) {
|
|
|
8b1478 |
switch (c) {
|
|
|
8b1478 |
case 'b':
|
|
|
8b1478 |
bflag = true;
|
|
|
8b1478 |
@@ -996,6 +997,9 @@ static int write_f(BlockBackend *blk, int argc, char **argv)
|
|
|
8b1478 |
case 'f':
|
|
|
8b1478 |
flags |= BDRV_REQ_FUA;
|
|
|
8b1478 |
break;
|
|
|
8b1478 |
+ case 'n':
|
|
|
8b1478 |
+ flags |= BDRV_REQ_NO_FALLBACK;
|
|
|
8b1478 |
+ break;
|
|
|
8b1478 |
case 'p':
|
|
|
8b1478 |
/* Ignored for backwards compatibility */
|
|
|
8b1478 |
break;
|
|
|
8b1478 |
@@ -1036,6 +1040,11 @@ static int write_f(BlockBackend *blk, int argc, char **argv)
|
|
|
8b1478 |
return -EINVAL;
|
|
|
8b1478 |
}
|
|
|
8b1478 |
|
|
|
8b1478 |
+ if ((flags & BDRV_REQ_NO_FALLBACK) && !zflag) {
|
|
|
8b1478 |
+ printf("-n requires -z to be specified\n");
|
|
|
8b1478 |
+ return -EINVAL;
|
|
|
8b1478 |
+ }
|
|
|
8b1478 |
+
|
|
|
8b1478 |
if ((flags & BDRV_REQ_MAY_UNMAP) && !zflag) {
|
|
|
8b1478 |
printf("-u requires -z to be specified\n");
|
|
|
8b1478 |
return -EINVAL;
|
|
|
8b1478 |
--
|
|
|
8b1478 |
1.8.3.1
|
|
|
8b1478 |
|