From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=47493 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OM7IR-000086-QE for qemu-devel@nongnu.org; Tue, 08 Jun 2010 18:29:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OM7IQ-0007Zv-P9 for qemu-devel@nongnu.org; Tue, 08 Jun 2010 18:29:23 -0400 Received: from fg-out-1718.google.com ([72.14.220.159]:14884) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OM7IQ-0007Zo-Jj for qemu-devel@nongnu.org; Tue, 08 Jun 2010 18:29:22 -0400 Received: by fg-out-1718.google.com with SMTP id 16so1216250fgg.10 for ; Tue, 08 Jun 2010 15:29:21 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4C0EC43D.7050908@redhat.com> Date: Wed, 09 Jun 2010 00:29:17 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <0100608191447.4451.47795.stgit@localhost.localdomain> <20100608211131.10053.73203.stgit@localhost.localdomain> <1276032766.3079.18.camel@x201> In-Reply-To: <1276032766.3079.18.camel@x201> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [RFC PATCH 7/6] savevm: Create a new continue flag to avoid resending block name List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Williamson Cc: chrisw@redhat.com, quintela@redhat.com, qemu-devel@nongnu.org, kvm@vger.kernel.org On 06/08/2010 11:32 PM, Alex Williamson wrote: > On Tue, 2010-06-08 at 15:11 -0600, Alex Williamson wrote: >> Allows us to compress the protocol a bit. > ... >> @@ -284,6 +290,33 @@ int ram_save_live(Monitor *mon, QEMUFile *f, int stage, void *opaque) >> return (stage == 2)&& (expected_time<= migrate_max_downtime()); >> } >> >> +static inline void *host_from_stream_offset(QEMUFile *f, >> + ram_addr_t offset, >> + int flags) > > This probably shouldn't be inline. When sending, we'll continue from > COMPRESS or PAGE. We'd get out of sync on the recv if the compiler > created separate static blocks. Compiler folks correct me if this can't > happen. There is only one static variable even if the inlining happens in multiple places. In fact, inlining is totally transparent. Example: $ cat > x.c <<\EOF #ifndef force_inline #define force_inline inline __attribute__((always_inline)) #endif static force_inline int f() { static int i; return i++; } int main() { printf ("%d\n", f()); printf ("%d\n", f()); printf ("%d\n", f()); printf ("%d\n", f()); } EOF $ gcc -o - -Dforce_inline= -S x.c | egrep -cw _?f 7 $ gcc -o - -S x.c | egrep -cw _?f 0 $ gcc x.c && ./a.out 0 1 2 3 Paolo