qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] scsi: allow user to set werror as report


From: Zihao Chang
Subject: Re: [PATCH] scsi: allow user to set werror as report
Date: Tue, 3 Nov 2020 22:03:29 +0800
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0


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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]