qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: allow user to set werror as report
@ 2020-11-03  6:12 Zihao Chang
  2020-11-03 10:52 ` Fam Zheng
  0 siblings, 1 reply; 7+ messages in thread
From: Zihao Chang @ 2020-11-03  6:12 UTC (permalink / raw)
  To: pbonzini, fam; +Cc: changzihao1, qemu-devel, xiexiangyou

'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



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

end of thread, other threads:[~2021-01-13 12:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-03  6:12 [PATCH] scsi: allow user to set werror as report Zihao Chang
2020-11-03 10:52 ` 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

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