]> xenbits.xensource.com Git - xen.git/commitdiff
tools/libx{l, c}: Fix trivial Coverity defects in migration v2 code
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 20 Jul 2015 10:37:59 +0000 (11:37 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Tue, 28 Jul 2015 10:11:59 +0000 (11:11 +0100)
All of these are UNUSED_VALUE defects where a default value is
unconditionally overwritten.  They are not particularly interesting,
bug wise, but keeping these defects at bay helps prevent real bugs
going unnoticed in the volume.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Ian Campbell <Ian.Campbell@citrix.com>
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxc/xc_sr_save.c
tools/libxl/libxl_stream_read.c

index cd2be47ca2f74ed487a6bb2ad36f107f183d7988..58667afb9d3e70715db2c4f218050c01b68c73cd 100644 (file)
@@ -474,7 +474,7 @@ static int send_memory_live(struct xc_sr_context *ctx)
     xc_shadow_op_stats_t stats = { 0, ctx->save.p2m_size };
     char *progress_str = NULL;
     unsigned x;
-    int rc = -1;
+    int rc;
 
     rc = update_progress_string(ctx, &progress_str, 0);
     if ( rc )
@@ -526,7 +526,7 @@ static int suspend_and_send_dirty(struct xc_sr_context *ctx)
     xc_interface *xch = ctx->xch;
     xc_shadow_op_stats_t stats = { 0, ctx->save.p2m_size };
     char *progress_str = NULL;
-    int rc = -1;
+    int rc;
     DECLARE_HYPERCALL_BUFFER_SHADOW(unsigned long, dirty_bitmap,
                                     &ctx->save.dirty_bitmap_hbuf);
 
@@ -573,7 +573,7 @@ static int send_memory_verify(struct xc_sr_context *ctx)
 {
     xc_interface *xch = ctx->xch;
     xc_shadow_op_stats_t stats = { 0, ctx->save.p2m_size };
-    int rc = -1;
+    int rc;
     struct xc_sr_record rec =
     {
         .type = REC_TYPE_VERIFY,
@@ -613,7 +613,7 @@ static int send_memory_verify(struct xc_sr_context *ctx)
  */
 static int send_domain_memory_live(struct xc_sr_context *ctx)
 {
-    int rc = -1;
+    int rc;
 
     rc = enable_logdirty(ctx);
     if ( rc )
@@ -653,7 +653,7 @@ static int send_domain_memory_checkpointed(struct xc_sr_context *ctx)
 static int send_domain_memory_nonlive(struct xc_sr_context *ctx)
 {
     xc_interface *xch = ctx->xch;
-    int rc = -1;
+    int rc;
 
     rc = suspend_domain(ctx);
     if ( rc )
index 56637e2e419e0237708e648428cafb4e396e0f76..7702b3f4602394e196fefc6ddb4bc510bfde5a47 100644 (file)
@@ -584,7 +584,7 @@ static void write_emulator_blob(libxl__egc *egc,
     libxl__sr_emulator_hdr *emu_hdr;
     STATE_AO_GC(stream->ao);
     char path[256];
-    int rc = 0, writefd = -1;
+    int rc = 0, writefd;
 
     if (rec->hdr.length < sizeof(*emu_hdr)) {
         rc = ERROR_FAIL;