]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
blockdev: drop unnecessary DriveBackupState field assignment
authorStefan Hajnoczi <stefanha@redhat.com>
Fri, 21 Nov 2014 10:48:58 +0000 (10:48 +0000)
committerKevin Wolf <kwolf@redhat.com>
Wed, 10 Dec 2014 09:31:13 +0000 (10:31 +0100)
drive_backup_prepare() assigns DriveBackupState fields to NULL in the
error path.  This is unnecessary because the DriveBackupState is
allocated using g_malloc0() and other functions like
external_snapshot_prepare() already rely on this.

Do not explicitly assign fields to NULL so that the error path is
concise and does not require modification when fields are added to
DriveBackupState.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 1416566940-4430-3-git-send-email-stefanha@redhat.com
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
blockdev.c

index 490f698ce2633943ecacc70305af4385d6501423..b58ce303a558677afbe1684c888e44042b42b86a 100644 (file)
@@ -1489,8 +1489,6 @@ static void drive_backup_prepare(BlkTransactionState *common, Error **errp)
                      &local_err);
     if (local_err) {
         error_propagate(errp, local_err);
-        state->bs = NULL;
-        state->job = NULL;
         return;
     }