Skip to contentSkip to conversation

scsi: allow user to set werror as report

PATCH Applied Zihao Chang 4 participants 7 messages Nov 3, 2020 – Jan 13, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: allow user to set werror as report

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

---
 hw/scsi/scsi-generic.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/scsi/scsi-generic.c +2 -1
index 2cb23ca891..2730e37d63 100644
@@ -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;
     }
Signature · 1 line
2.28.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 27 lines · Zihao Chang

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

---
 hw/scsi/scsi-generic.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/scsi/scsi-generic.c +1 -1
index 2cb23ca891..2730e37d63 100644
@@ -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

Quoted 3 lines
werror");
         return;
     }

Accepting the report sounds sane to me, it matches what we actually (always) do. Is the idea to allow users to spell it out explicitly in the command line?

#2 lore raw
Quoted 21 lines · Fam Zheng
Quoted 20 lines · Zihao Chang

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

---
 hw/scsi/scsi-generic.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/scsi/scsi-generic.c +0 -0
index 2cb23ca891..2730e37d63 100644
@@ -664,7 +664,8 @@ static void scsi_generic_realize(SCSIDevice *s,
 Error **errp)
         return;
     }
 
Quoted 15 lines
Quoted 10 lines
hw/scsi/scsi-generic.c +1 -1
-    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;
     }

Accepting the report sounds sane to me, it matches what we actually (always) do. Is the idea to allow users to spell it out explicitly in the command line?

Actually, qemu supports user to spell it out explicitly in the command line like "enospc", "report" & "action". This patch just allows user to set werror as "report" for scsi-generic, which is a common scenario.

Quoted 4 lines

.

#3 lore raw

Ping? This is a fix patch which has been reviewed, whose tree should it go via?

Thanks
Zihao

Quoted 47 lines · Zihao Chang
Quoted 21 lines · Fam Zheng
Quoted 20 lines · Zihao Chang

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

---
 hw/scsi/scsi-generic.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/scsi/scsi-generic.c +0 -0
index 2cb23ca891..2730e37d63 100644
@@ -664,7 +664,8 @@ static void scsi_generic_realize(SCSIDevice *s,
 Error **errp)
         return;
     }
 
Quoted 15 lines
Quoted 10 lines
hw/scsi/scsi-generic.c +1 -1
-    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;
     }

Accepting the report sounds sane to me, it matches what we actually (always) do. Is the idea to allow users to spell it out explicitly in the command line?

Actually, qemu supports user to spell it out explicitly in the command line like "enospc", "report" & "action". This patch just allows user to set werror as "report" for scsi-generic, which is a common scenario.

Quoted 4 lines

.

#4 lore raw
Quoted 1 line · Zihao Chang

Ping? This is a fix patch which has been reviewed, whose tree should it go via?

The change itself is in-between 'Block layer' and 'SCSI' subsystems, so either Paolo or Kevin (Cc'ing qemu-block@).

Quoted 53 lines

Thanks
Zihao

Quoted 47 lines · Zihao Chang
Quoted 21 lines · Fam Zheng
Quoted 20 lines · Zihao Chang

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

---
 hw/scsi/scsi-generic.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/scsi/scsi-generic.c +0 -0
index 2cb23ca891..2730e37d63 100644
@@ -664,7 +664,8 @@ static void scsi_generic_realize(SCSIDevice *s,
 Error **errp)
         return;
     }
 
Quoted 15 lines
Quoted 10 lines
hw/scsi/scsi-generic.c +1 -1
-    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;
     }

Accepting the report sounds sane to me, it matches what we actually (always) do. Is the idea to allow users to spell it out explicitly in the command line?

Actually, qemu supports user to spell it out explicitly in the command line like "enospc", "report" & "action". This patch just allows user to set werror as "report" for scsi-generic, which is a common scenario.

Quoted 4 lines

.

#5 lore raw

Ping again? Another month has passed, whose tree should it go via? Or did I miss any response?

Thanks
Zihao

Quoted 62 lines · Philippe Mathieu-Daudé
Quoted 1 line · Zihao Chang

Ping? This is a fix patch which has been reviewed, whose tree should it go via?

The change itself is in-between 'Block layer' and 'SCSI' subsystems, so either Paolo or Kevin (Cc'ing qemu-block@).

Quoted 53 lines

Thanks
Zihao

Quoted 47 lines · Zihao Chang
Quoted 21 lines · Fam Zheng
Quoted 20 lines · Zihao Chang

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

---
 hw/scsi/scsi-generic.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/scsi/scsi-generic.c +0 -0
index 2cb23ca891..2730e37d63 100644
@@ -664,7 +664,8 @@ static void scsi_generic_realize(SCSIDevice *s,
 Error **errp)
         return;
     }
 
Quoted 15 lines
Quoted 10 lines
hw/scsi/scsi-generic.c +1 -1
-    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;
     }

Accepting the report sounds sane to me, it matches what we actually (always) do. Is the idea to allow users to spell it out explicitly in the command line?

Actually, qemu supports user to spell it out explicitly in the command line like "enospc", "report" & "action". This patch just allows user to set werror as "report" for scsi-generic, which is a common scenario.

Quoted 4 lines

.

.

#6 lore raw
In reply to Zihao Chang
Quoted 54 lines · Zihao Chang

Ping? This is a fix patch which has been reviewed, whose tree should it go via?

Thanks
Zihao

Quoted 47 lines · Zihao Chang
Quoted 21 lines · Fam Zheng
Quoted 20 lines · Zihao Chang

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

---
  hw/scsi/scsi-generic.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
hw/scsi/scsi-generic.c +0 -0
index 2cb23ca891..2730e37d63 100644
@@ -664,7 +664,8 @@ static void scsi_generic_realize(SCSIDevice *s,
 Error **errp)
          return;
      }
 
Quoted 15 lines
Quoted 10 lines
hw/scsi/scsi-generic.c +1 -1
-    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;
      }

Accepting the report sounds sane to me, it matches what we actually (always) do. Is the idea to allow users to spell it out explicitly in the command line?

Actually, qemu supports user to spell it out explicitly in the command line like "enospc", "report" & "action". This patch just allows user to set werror as "report" for scsi-generic, which is a common scenario.

Quoted 4 lines

.

Queued, thanks.

Paolo