diff mbox

[v4,6/7] commit: remove unused check

Message ID 1380542578-2387-7-git-send-email-famz@redhat.com
State New
Headers show

Commit Message

Fam Zheng Sept. 30, 2013, 12:02 p.m. UTC
We support top == active for commit now, remove the check which is dead
code now.

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 block/commit.c | 7 -------
 1 file changed, 7 deletions(-)

Comments

Paolo Bonzini Sept. 30, 2013, 12:17 p.m. UTC | #1
Il 30/09/2013 14:02, Fam Zheng ha scritto:
> We support top == active for commit now, remove the check which is dead
> code now.
> 
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
>  block/commit.c | 7 -------
>  1 file changed, 7 deletions(-)
> 
> diff --git a/block/commit.c b/block/commit.c
> index ac4b7cc..086f8c9 100644
> --- a/block/commit.c
> +++ b/block/commit.c
> @@ -198,13 +198,6 @@ void commit_start(BlockDriverState *bs, BlockDriverState *base,
>          return;
>      }
>  
> -    /* Once we support top == active layer, remove this check */
> -    if (top == bs) {
> -        error_setg(errp,
> -                   "Top image as the active layer is currently unsupported");
> -        return;
> -    }
> -
>      if (top == base) {
>          error_setg(errp, "Invalid files for merge: top and base are the same");
>          return;
> 

Perhaps this could even become an assertion, or it could take care of
calling commit_active_start?

Paolo
Fam Zheng Oct. 8, 2013, 9:32 a.m. UTC | #2
On Mon, 09/30 14:17, Paolo Bonzini wrote:
> Il 30/09/2013 14:02, Fam Zheng ha scritto:
> > We support top == active for commit now, remove the check which is dead
> > code now.
> > 
> > Signed-off-by: Fam Zheng <famz@redhat.com>
> > ---
> >  block/commit.c | 7 -------
> >  1 file changed, 7 deletions(-)
> > 
> > diff --git a/block/commit.c b/block/commit.c
> > index ac4b7cc..086f8c9 100644
> > --- a/block/commit.c
> > +++ b/block/commit.c
> > @@ -198,13 +198,6 @@ void commit_start(BlockDriverState *bs, BlockDriverState *base,
> >          return;
> >      }
> >  
> > -    /* Once we support top == active layer, remove this check */
> > -    if (top == bs) {
> > -        error_setg(errp,
> > -                   "Top image as the active layer is currently unsupported");
> > -        return;
> > -    }
> > -
> >      if (top == base) {
> >          error_setg(errp, "Invalid files for merge: top and base are the same");
> >          return;
> > 
> 
> Perhaps this could even become an assertion, or it could take care of
> calling commit_active_start?
> 

Good idea. I'll make it an assertion.

Thanks,
Fam
diff mbox

Patch

diff --git a/block/commit.c b/block/commit.c
index ac4b7cc..086f8c9 100644
--- a/block/commit.c
+++ b/block/commit.c
@@ -198,13 +198,6 @@  void commit_start(BlockDriverState *bs, BlockDriverState *base,
         return;
     }
 
-    /* Once we support top == active layer, remove this check */
-    if (top == bs) {
-        error_setg(errp,
-                   "Top image as the active layer is currently unsupported");
-        return;
-    }
-
     if (top == base) {
         error_setg(errp, "Invalid files for merge: top and base are the same");
         return;