From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vrabel Subject: Re: [PATCH v5 RFC 09/14] tools/libxc: x86 PV restore code Date: Thu, 12 Jun 2014 16:49:23 +0100 Message-ID: <5399CC03.7010809@citrix.com> References: <1402510482-21099-1-git-send-email-andrew.cooper3@citrix.com> <1402510482-21099-10-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1402510482-21099-10-git-send-email-andrew.cooper3@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper , Xen-devel Cc: Frediano Ziglio , David Vrabel List-Id: xen-devel@lists.xenproject.org On 11/06/14 19:14, Andrew Cooper wrote: > --- /dev/null > +++ b/tools/libxc/saverestore/restore_x86_pv.c ... > +static int x86_pv_process_record(struct context *ctx, struct record *rec) > +{ > + xc_interface *xch = ctx->xch; > + > + switch ( rec->type ) > + { > + case REC_TYPE_X86_PV_INFO: > + return handle_x86_pv_info(ctx, rec); > + ... > + > + case REC_TYPE_X86_PV_VCPU_MSRS: > + return handle_x86_pv_vcpu_msrs(ctx, rec); > + > + default: > + if ( rec->type & REC_TYPE_OPTIONAL ) > + { > + IPRINTF("Ignoring optional record (0x%"PRIx32", %s)", > + rec->type, rec_type_to_str(rec->type)); > + return 0; > + } > + > + ERROR("Invalid record type (0x%"PRIx32", %s) for x86_pv domains", > + rec->type, rec_type_to_str(rec->type)); > + return -1; > + } I think this default case can be moved to common code. Perhaps return XC_SR_RECORD_UNHANDLED (== 1) to indicate the record wasn't handled. David