diff mbox

[15/21] qcow2: Use abort() instead of assert(false)

Message ID 1415627159-15941-16-git-send-email-mreitz@redhat.com
State New
Headers show

Commit Message

Max Reitz Nov. 10, 2014, 1:45 p.m. UTC
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 block/qcow2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Eric Blake Nov. 11, 2014, 6:12 p.m. UTC | #1
On 11/10/2014 06:45 AM, Max Reitz wrote:
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
>  block/qcow2.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

Is it worth hoisting this one into 2.2 via the -trivial tree?

> 
> diff --git a/block/qcow2.c b/block/qcow2.c
> index beb7187..ebf843f 100644
> --- a/block/qcow2.c
> +++ b/block/qcow2.c
> @@ -2718,9 +2718,9 @@ static int qcow2_amend_options(BlockDriverState *bs, QemuOpts *opts,
>              error_report("Cannot change refcount entry width");
>              return -ENOTSUP;
>          } else {
> -            /* if this assertion fails, this probably means a new option was
> +            /* if this point is reached, this probably means a new option was
>               * added without having it covered here */
> -            assert(false);
> +            abort();
>          }
>  
>          desc++;
>
Max Reitz Nov. 12, 2014, 8:48 a.m. UTC | #2
On 2014-11-11 at 19:12, Eric Blake wrote:
> On 11/10/2014 06:45 AM, Max Reitz wrote:
>> Signed-off-by: Max Reitz <mreitz@redhat.com>
>> ---
>>   block/qcow2.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
> Reviewed-by: Eric Blake <eblake@redhat.com>
>
> Is it worth hoisting this one into 2.2 via the -trivial tree?

No, as explained this point can only be reached if there is some 
creation option for qcow2 images which is not handled by any of the 
branches in this function. Since there is no such thing currently in 
master and there most certainly won't be in 2.2 (thanks to hard freeze), 
it's fine to keep it out of 2.2.

Max

>> diff --git a/block/qcow2.c b/block/qcow2.c
>> index beb7187..ebf843f 100644
>> --- a/block/qcow2.c
>> +++ b/block/qcow2.c
>> @@ -2718,9 +2718,9 @@ static int qcow2_amend_options(BlockDriverState *bs, QemuOpts *opts,
>>               error_report("Cannot change refcount entry width");
>>               return -ENOTSUP;
>>           } else {
>> -            /* if this assertion fails, this probably means a new option was
>> +            /* if this point is reached, this probably means a new option was
>>                * added without having it covered here */
>> -            assert(false);
>> +            abort();
>>           }
>>   
>>           desc++;
>>
diff mbox

Patch

diff --git a/block/qcow2.c b/block/qcow2.c
index beb7187..ebf843f 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -2718,9 +2718,9 @@  static int qcow2_amend_options(BlockDriverState *bs, QemuOpts *opts,
             error_report("Cannot change refcount entry width");
             return -ENOTSUP;
         } else {
-            /* if this assertion fails, this probably means a new option was
+            /* if this point is reached, this probably means a new option was
              * added without having it covered here */
-            assert(false);
+            abort();
         }
 
         desc++;