From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] [RFC][PATCH] kvm: kvmtrace: kvmtrace_format for supporting big_endian Date: Sun, 25 May 2008 12:34:21 +0300 Message-ID: <4839329D.9080100@qumranet.com> References: <08DF4D958216244799FC84F3514D70F0015B1B58@pdsmsx415.ccr.corp.intel.com> <200805141637.03442.hollisb@us.ibm.com> <08DF4D958216244799FC84F3514D70F00164BF05@pdsmsx415.ccr.corp.intel.com> <08DF4D958216244799FC84F3514D70F00164BF20@pdsmsx415.ccr.corp.intel.com> <4832FAD4.2040908@qumranet.com> <08DF4D958216244799FC84F3514D70F00164C4A2@pdsmsx415.ccr.corp.intel.com> <4833E98C.20202@qumranet.com> <08DF4D958216244799FC84F3514D70F00164C67D@pdsmsx415.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: "Tan, Li" Return-path: Received: from bzq-179-150-194.static.bezeqint.net ([212.179.150.194]:36422 "EHLO il.qumranet.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753540AbYEYJeX (ORCPT ); Sun, 25 May 2008 05:34:23 -0400 In-Reply-To: <08DF4D958216244799FC84F3514D70F00164C67D@pdsmsx415.ccr.corp.intel.com> Sender: kvm-owner@vger.kernel.org List-ID: Tan, Li wrote: > I meant, you can change the definitions of D3REC, D4REC, etc. and not > worry about reversing once you've decoded the magic word. > > > [tan] so it looks like: > if reverse_flag == 0: > # print "host and data file are same endian order" > D3REC = "III" > D4REC = "IIII" > D5REC = "IIIII" > else: > If pack(' # print "host is Little Endian, data file is big endian" > D3REC = ">III" > D4REC = ">IIII" > D5REC = ">IIIII" > elif pack('>h', 1) == pack('=h',1): > # print "host is big Endian, data file is little endian" > D3REC = " D4REC = " D5REC = " Not sure about the tests. You aren't looking at the data from the file, how can you conclude it's little endian or big endian? -- error compiling committee.c: too many arguments to function