[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 6/6] tools/libx{l, c}: Fix trivial Coverity defects in migration v2 code



All of these are UNUSED_VALUE defects where a default vaule 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@xxxxxxxxxx>
CC: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
CC: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
CC: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 tools/libxc/xc_sr_save.c        |   10 +++++-----
 tools/libxl/libxl_stream_read.c |    2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/libxc/xc_sr_save.c b/tools/libxc/xc_sr_save.c
index 46700a1..79c389a 100644
--- a/tools/libxc/xc_sr_save.c
+++ b/tools/libxc/xc_sr_save.c
@@ -473,7 +473,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 )
@@ -525,7 +525,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);
 
@@ -572,7 +572,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,
@@ -612,7 +612,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 )
@@ -652,7 +652,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 )
diff --git a/tools/libxl/libxl_stream_read.c b/tools/libxl/libxl_stream_read.c
index 94247b7..213bdc2 100644
--- a/tools/libxl/libxl_stream_read.c
+++ b/tools/libxl/libxl_stream_read.c
@@ -583,7 +583,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;
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.