diff mbox

[4/8] Remove support for version 3 ram_load

Message ID 1324474477-22267-5-git-send-email-avi@redhat.com
State New
Headers show

Commit Message

Avi Kivity Dec. 21, 2011, 1:34 p.m. UTC
Version 3 ram_load depends on ram_addrs, which are not stable.  Version 4
was introduced in 0.13 (and RHEL 6), so this means live migration from 0.12
and earlier to 1.1 or later will not work.

Signed-off-by: Avi Kivity <avi@redhat.com>
---
 arch_init.c |   18 ++++--------------
 1 files changed, 4 insertions(+), 14 deletions(-)

Comments

Anthony Liguori Dec. 21, 2011, 1:57 p.m. UTC | #1
On 12/21/2011 07:34 AM, Avi Kivity wrote:
> Version 3 ram_load depends on ram_addrs, which are not stable.  Version 4
> was introduced in 0.13 (and RHEL 6), so this means live migration from 0.12
> and earlier to 1.1 or later will not work.

Can you please make a note on http://wiki.qemu.org/ChangeLog/Next

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>

Regards,

Anthony Liguori

>
> Signed-off-by: Avi Kivity<avi@redhat.com>
> ---
>   arch_init.c |   18 ++++--------------
>   1 files changed, 4 insertions(+), 14 deletions(-)
>
> diff --git a/arch_init.c b/arch_init.c
> index 8a3f052..9b8a1f3 100644
> --- a/arch_init.c
> +++ b/arch_init.c
> @@ -366,7 +366,7 @@ int ram_load(QEMUFile *f, void *opaque, int version_id)
>       int flags;
>       int error;
>
> -    if (version_id<  3 || version_id>  4) {
> +    if (version_id<  4 || version_id>  4) {
>           return -EINVAL;
>       }
>
> @@ -377,11 +377,7 @@ int ram_load(QEMUFile *f, void *opaque, int version_id)
>           addr&= TARGET_PAGE_MASK;
>
>           if (flags&  RAM_SAVE_FLAG_MEM_SIZE) {
> -            if (version_id == 3) {
> -                if (addr != ram_bytes_total()) {
> -                    return -EINVAL;
> -                }
> -            } else {
> +            if (version_id == 4) {
>                   /* Synchronize RAM block list */
>                   char id[256];
>                   ram_addr_t length;
> @@ -419,10 +415,7 @@ int ram_load(QEMUFile *f, void *opaque, int version_id)
>               void *host;
>               uint8_t ch;
>
> -            if (version_id == 3)
> -                host = qemu_get_ram_ptr(addr);
> -            else
> -                host = host_from_stream_offset(f, addr, flags);
> +            host = host_from_stream_offset(f, addr, flags);
>               if (!host) {
>                   return -EINVAL;
>               }
> @@ -438,10 +431,7 @@ int ram_load(QEMUFile *f, void *opaque, int version_id)
>           } else if (flags&  RAM_SAVE_FLAG_PAGE) {
>               void *host;
>
> -            if (version_id == 3)
> -                host = qemu_get_ram_ptr(addr);
> -            else
> -                host = host_from_stream_offset(f, addr, flags);
> +            host = host_from_stream_offset(f, addr, flags);
>
>               qemu_get_buffer(f, host, TARGET_PAGE_SIZE);
>           }
Avi Kivity Dec. 21, 2011, 3:18 p.m. UTC | #2
On 12/21/2011 03:57 PM, Anthony Liguori wrote:
> On 12/21/2011 07:34 AM, Avi Kivity wrote:
>> Version 3 ram_load depends on ram_addrs, which are not stable. 
>> Version 4
>> was introduced in 0.13 (and RHEL 6), so this means live migration
>> from 0.12
>> and earlier to 1.1 or later will not work.
>
> Can you please make a note on http://wiki.qemu.org/ChangeLog/Next

Done.
diff mbox

Patch

diff --git a/arch_init.c b/arch_init.c
index 8a3f052..9b8a1f3 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -366,7 +366,7 @@  int ram_load(QEMUFile *f, void *opaque, int version_id)
     int flags;
     int error;
 
-    if (version_id < 3 || version_id > 4) {
+    if (version_id < 4 || version_id > 4) {
         return -EINVAL;
     }
 
@@ -377,11 +377,7 @@  int ram_load(QEMUFile *f, void *opaque, int version_id)
         addr &= TARGET_PAGE_MASK;
 
         if (flags & RAM_SAVE_FLAG_MEM_SIZE) {
-            if (version_id == 3) {
-                if (addr != ram_bytes_total()) {
-                    return -EINVAL;
-                }
-            } else {
+            if (version_id == 4) {
                 /* Synchronize RAM block list */
                 char id[256];
                 ram_addr_t length;
@@ -419,10 +415,7 @@  int ram_load(QEMUFile *f, void *opaque, int version_id)
             void *host;
             uint8_t ch;
 
-            if (version_id == 3)
-                host = qemu_get_ram_ptr(addr);
-            else
-                host = host_from_stream_offset(f, addr, flags);
+            host = host_from_stream_offset(f, addr, flags);
             if (!host) {
                 return -EINVAL;
             }
@@ -438,10 +431,7 @@  int ram_load(QEMUFile *f, void *opaque, int version_id)
         } else if (flags & RAM_SAVE_FLAG_PAGE) {
             void *host;
 
-            if (version_id == 3)
-                host = qemu_get_ram_ptr(addr);
-            else
-                host = host_from_stream_offset(f, addr, flags);
+            host = host_from_stream_offset(f, addr, flags);
 
             qemu_get_buffer(f, host, TARGET_PAGE_SIZE);
         }