From: Zihao Chang <changzihao1@huawei.com>
To: <pbonzini@redhat.com>, <fam@euphon.net>
Cc: changzihao1@huawei.com, qemu-devel@nongnu.org, xiexiangyou@huawei.com
Subject: [PATCH] scsi: allow user to set werror as report
Date: Tue, 3 Nov 2020 14:12:40 +0800 [thread overview]
Message-ID: <20201103061240.1364-1-changzihao1@huawei.com> (raw)
'enospc' is the default for -drive, but qemu allows user to set
drive option werror. If werror of scsi-generic is set to 'report'
by user, qemu will not allow vm to start.
This patch allow user to set werror as 'report' for scsi-generic.
Signed-off-by: Zihao Chang <changzihao1@huawei.com>
---
hw/scsi/scsi-generic.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/scsi/scsi-generic.c b/hw/scsi/scsi-generic.c
index 2cb23ca891..2730e37d63 100644
--- a/hw/scsi/scsi-generic.c
+++ b/hw/scsi/scsi-generic.c
@@ -664,7 +664,8 @@ static void scsi_generic_realize(SCSIDevice *s, Error **errp)
return;
}
- if (blk_get_on_error(s->conf.blk, 0) != BLOCKDEV_ON_ERROR_ENOSPC) {
+ if (blk_get_on_error(s->conf.blk, 0) != BLOCKDEV_ON_ERROR_ENOSPC &&
+ blk_get_on_error(s->conf.blk, 0) != BLOCKDEV_ON_ERROR_REPORT) {
error_setg(errp, "Device doesn't support drive option werror");
return;
}
--
2.28.0
next reply other threads:[~2020-11-03 9:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-03 6:12 Zihao Chang [this message]
2020-11-03 10:52 ` [PATCH] scsi: allow user to set werror as report Fam Zheng
2020-11-03 14:03 ` Zihao Chang
2020-12-03 2:55 ` Zihao Chang
2020-12-03 9:53 ` Philippe Mathieu-Daudé
2021-01-12 2:39 ` Zihao Chang
2021-01-13 12:55 ` Paolo Bonzini
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=20201103061240.1364-1-changzihao1@huawei.com \
--to=changzihao1@huawei.com \
--cc=fam@euphon.net \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=xiexiangyou@huawei.com \
/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).