Re: [Qemu-devel] [PATCH v4 1/3] hw/block/fdc: Replace error_setg(_abort) by assert()

2018-06-26 Thread Markus Armbruster
John Snow  writes:

> On 06/25/2018 12:57 PM, Philippe Mathieu-Daudé wrote:
>> Use assert() instead of error_setg(_abort),
>> as suggested by the "qapi/error.h" documentation:
>> 
>> Please don't error_setg(_fatal, ...), use error_report() and
>> exit(), because that's more obvious.
>> Likewise, don't error_setg(_abort, ...), use assert().
>> 
>> Signed-off-by: Philippe Mathieu-Daudé 
>> Acked-by: John Snow 
>
> AIUI this series is to be merged by someone else currently, right?
> Nothing needed on my part?

Whatever doesn't get picked up by maintainers of patched code can go
through my tree.



Re: [Qemu-devel] [PATCH v4 1/3] hw/block/fdc: Replace error_setg(_abort) by assert()

2018-06-25 Thread John Snow



On 06/25/2018 12:57 PM, Philippe Mathieu-Daudé wrote:
> Use assert() instead of error_setg(_abort),
> as suggested by the "qapi/error.h" documentation:
> 
> Please don't error_setg(_fatal, ...), use error_report() and
> exit(), because that's more obvious.
> Likewise, don't error_setg(_abort, ...), use assert().
> 
> Signed-off-by: Philippe Mathieu-Daudé 
> Acked-by: John Snow 

AIUI this series is to be merged by someone else currently, right?
Nothing needed on my part?



[Qemu-devel] [PATCH v4 1/3] hw/block/fdc: Replace error_setg(_abort) by assert()

2018-06-25 Thread Philippe Mathieu-Daudé
Use assert() instead of error_setg(_abort),
as suggested by the "qapi/error.h" documentation:

Please don't error_setg(_fatal, ...), use error_report() and
exit(), because that's more obvious.
Likewise, don't error_setg(_abort, ...), use assert().

Signed-off-by: Philippe Mathieu-Daudé 
Acked-by: John Snow 
---
 hw/block/fdc.c | 9 +
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/hw/block/fdc.c b/hw/block/fdc.c
index cd29e27d8f..7c1c57f57f 100644
--- a/hw/block/fdc.c
+++ b/hw/block/fdc.c
@@ -396,16 +396,9 @@ static int pick_geometry(FDrive *drv)
nb_sectors,
FloppyDriveType_str(parse->drive));
 }
+assert(type_match != -1 && "misconfigured fd_format");
 match = type_match;
 }
-
-/* No match of any kind found -- fd_format is misconfigured, abort. */
-if (match == -1) {
-error_setg(_abort, "No candidate geometries present in table "
-   " for floppy drive type '%s'",
-   FloppyDriveType_str(drv->drive));
-}
-
 parse = &(fd_formats[match]);
 
  out:
-- 
2.18.0