From 6094fe493701095414108ead0f100b18af1ccd04 Mon Sep 17 00:00:00 2001 From: Andrew Cooper Date: Mon, 20 Jul 2015 11:37:59 +0100 Subject: [PATCH] tools/libx{l, c}: Fix trivial Coverity defects in migration v2 code 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 CC: Ian Campbell CC: Ian Jackson CC: Wei Liu Acked-by: Ian Campbell --- 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 cd2be47ca2..58667afb9d 100644 --- a/tools/libxc/xc_sr_save.c +++ b/tools/libxc/xc_sr_save.c @@ -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 ) diff --git a/tools/libxl/libxl_stream_read.c b/tools/libxl/libxl_stream_read.c index 56637e2e41..7702b3f460 100644 --- a/tools/libxl/libxl_stream_read.c +++ b/tools/libxl/libxl_stream_read.c @@ -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; -- 2.39.5