* [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
* Re: [PATCH] scsi: allow user to set werror as report 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 0 siblings, 1 reply; 7+ messages in thread From: Fam Zheng @ 2020-11-03 10:52 UTC (permalink / raw) To: Zihao Chang, pbonzini; +Cc: qemu-devel, xiexiangyou On Tue, 2020-11-03 at 14:12 +0800, Zihao Chang wrote: > '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; > } 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? Reviewed-by: Fam Zheng <fam@euphon.net> ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] scsi: allow user to set werror as report 2020-11-03 10:52 ` Fam Zheng @ 2020-11-03 14:03 ` Zihao Chang 2020-12-03 2:55 ` Zihao Chang 0 siblings, 1 reply; 7+ messages in thread From: Zihao Chang @ 2020-11-03 14:03 UTC (permalink / raw) To: Fam Zheng, pbonzini; +Cc: qemu-devel, xiexiangyou On 2020/11/3 18:52, Fam Zheng wrote: > On Tue, 2020-11-03 at 14:12 +0800, Zihao Chang wrote: >> '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; >> } > > 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. > Reviewed-by: Fam Zheng <fam@euphon.net> > > . > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] scsi: allow user to set werror as report 2020-11-03 14:03 ` Zihao Chang @ 2020-12-03 2:55 ` Zihao Chang 2020-12-03 9:53 ` Philippe Mathieu-Daudé 2021-01-13 12:55 ` Paolo Bonzini 0 siblings, 2 replies; 7+ messages in thread From: Zihao Chang @ 2020-12-03 2:55 UTC (permalink / raw) To: Fam Zheng, pbonzini; +Cc: qemu-devel, xiexiangyou Ping? This is a fix patch which has been reviewed, whose tree should it go via? Thanks Zihao On 2020/11/3 22:03, Zihao Chang wrote: > > > On 2020/11/3 18:52, Fam Zheng wrote: >> On Tue, 2020-11-03 at 14:12 +0800, Zihao Chang wrote: >>> '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; >>> } >> >> 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. > >> Reviewed-by: Fam Zheng <fam@euphon.net> >> >> . >> ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] scsi: allow user to set werror as report 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 1 sibling, 1 reply; 7+ messages in thread From: Philippe Mathieu-Daudé @ 2020-12-03 9:53 UTC (permalink / raw) To: Zihao Chang, Fam Zheng, pbonzini Cc: Kevin Wolf, Qemu-block, qemu-devel, xiexiangyou, Max Reitz On 12/3/20 3:55 AM, Zihao Chang wrote: > 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@). > > Thanks > Zihao > > On 2020/11/3 22:03, Zihao Chang wrote: >> >> >> On 2020/11/3 18:52, Fam Zheng wrote: >>> On Tue, 2020-11-03 at 14:12 +0800, Zihao Chang wrote: >>>> '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; >>>> } >>> >>> 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. >> >>> Reviewed-by: Fam Zheng <fam@euphon.net> >>> >>> . >>> > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] scsi: allow user to set werror as report 2020-12-03 9:53 ` Philippe Mathieu-Daudé @ 2021-01-12 2:39 ` Zihao Chang 0 siblings, 0 replies; 7+ messages in thread From: Zihao Chang @ 2021-01-12 2:39 UTC (permalink / raw) To: Philippe Mathieu-Daudé, Fam Zheng, pbonzini, Kevin Wolf, Max Reitz Cc: Qemu-block, qemu-devel, xiexiangyou Ping again? Another month has passed, whose tree should it go via? Or did I miss any response? Thanks Zihao On 2020/12/3 17:53, Philippe Mathieu-Daudé wrote: > On 12/3/20 3:55 AM, Zihao Chang wrote: >> 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@). > >> >> Thanks >> Zihao >> >> On 2020/11/3 22:03, Zihao Chang wrote: >>> >>> >>> On 2020/11/3 18:52, Fam Zheng wrote: >>>> On Tue, 2020-11-03 at 14:12 +0800, Zihao Chang wrote: >>>>> '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; >>>>> } >>>> >>>> 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. >>> >>>> Reviewed-by: Fam Zheng <fam@euphon.net> >>>> >>>> . >>>> >> > > . > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] scsi: allow user to set werror as report 2020-12-03 2:55 ` Zihao Chang 2020-12-03 9:53 ` Philippe Mathieu-Daudé @ 2021-01-13 12:55 ` Paolo Bonzini 1 sibling, 0 replies; 7+ messages in thread From: Paolo Bonzini @ 2021-01-13 12:55 UTC (permalink / raw) To: Zihao Chang, Fam Zheng; +Cc: qemu-devel, xiexiangyou On 03/12/20 03:55, Zihao Chang wrote: > Ping? This is a fix patch which has been reviewed, whose tree should it go via? > > Thanks > Zihao > > On 2020/11/3 22:03, Zihao Chang wrote: >> >> >> On 2020/11/3 18:52, Fam Zheng wrote: >>> On Tue, 2020-11-03 at 14:12 +0800, Zihao Chang wrote: >>>> '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; >>>> } >>> >>> 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. >> >>> Reviewed-by: Fam Zheng <fam@euphon.net> >>> >>> . >>> > Queued, thanks. Paolo ^ permalink raw reply [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).