qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] Re: [RFC PATCH 7/6] savevm: Create a new continue flag to a


From: Paolo Bonzini
Subject: [Qemu-devel] Re: [RFC PATCH 7/6] savevm: Create a new continue flag to avoid resending block name
Date: Wed, 09 Jun 2010 00:29:17 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-3.fc13 Lightning/1.0b2pre Thunderbird/3.0.4

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]