diff mbox

[02/19] migration: They are called vmstate_foo, move them to vmstate.c

Message ID 20170417200041.2451-3-quintela@redhat.com
State New
Headers show

Commit Message

Juan Quintela April 17, 2017, 8 p.m. UTC
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 migration/savevm.c  | 17 -----------------
 migration/vmstate.c | 16 ++++++++++++++++
 2 files changed, 16 insertions(+), 17 deletions(-)

Comments

Dr. David Alan Gilbert April 18, 2017, 6:40 p.m. UTC | #1
* Juan Quintela (quintela@redhat.com) wrote:
> Signed-off-by: Juan Quintela <quintela@redhat.com>
> ---
>  migration/savevm.c  | 17 -----------------
>  migration/vmstate.c | 16 ++++++++++++++++
>  2 files changed, 16 insertions(+), 17 deletions(-)

OK, but it's a little odd, savevm.c still has the vmstate_register_with_alias_id
and vmstate-unregister,  so this is just the simple ram cases.

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

> diff --git a/migration/savevm.c b/migration/savevm.c
> index cc9c086..c47b209 100644
> --- a/migration/savevm.c
> +++ b/migration/savevm.c
> @@ -45,7 +45,6 @@
>  #include "qemu/sockets.h"
>  #include "qemu/queue.h"
>  #include "sysemu/cpus.h"
> -#include "exec/memory.h"
>  #include "qmp-commands.h"
>  #include "trace.h"
>  #include "qemu/bitops.h"
> @@ -2465,19 +2464,3 @@ void hmp_info_snapshots(Monitor *mon, const QDict *qdict)
>      g_free(global_snapshots);
>  
>  }
> -
> -void vmstate_register_ram(MemoryRegion *mr, DeviceState *dev)
> -{
> -    qemu_ram_set_idstr(mr->ram_block,
> -                       memory_region_name(mr), dev);
> -}
> -
> -void vmstate_unregister_ram(MemoryRegion *mr, DeviceState *dev)
> -{
> -    qemu_ram_unset_idstr(mr->ram_block);
> -}
> -
> -void vmstate_register_ram_global(MemoryRegion *mr)
> -{
> -    vmstate_register_ram(mr, NULL);
> -}
> diff --git a/migration/vmstate.c b/migration/vmstate.c
> index 8a71349..174c490 100644
> --- a/migration/vmstate.c
> +++ b/migration/vmstate.c
> @@ -1,5 +1,6 @@
>  #include "qemu/osdep.h"
>  #include "qemu-common.h"
> +#include "exec/memory.h"
>  #include "migration/migration.h"
>  #include "migration/qemu-file.h"
>  #include "migration/vmstate.h"
> @@ -1127,3 +1128,18 @@ bool vmstate_device_is_migratable(const VMStateDescription *vmsd)
>      return true;
>  }
>  
> +void vmstate_register_ram(MemoryRegion *mr, DeviceState *dev)
> +{
> +    qemu_ram_set_idstr(mr->ram_block,
> +                       memory_region_name(mr), dev);
> +}
> +
> +void vmstate_unregister_ram(MemoryRegion *mr, DeviceState *dev)
> +{
> +    qemu_ram_unset_idstr(mr->ram_block);
> +}
> +
> +void vmstate_register_ram_global(MemoryRegion *mr)
> +{
> +    vmstate_register_ram(mr, NULL);
> +}
> -- 
> 2.9.3
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
Juan Quintela April 19, 2017, 7:02 a.m. UTC | #2
"Dr. David Alan Gilbert" <dgilbert@redhat.com> wrote:
> * Juan Quintela (quintela@redhat.com) wrote:
>> Signed-off-by: Juan Quintela <quintela@redhat.com>
>> ---
>>  migration/savevm.c  | 17 -----------------
>>  migration/vmstate.c | 16 ++++++++++++++++
>>  2 files changed, 16 insertions(+), 17 deletions(-)
>
> OK, but it's a little odd, savevm.c still has the vmstate_register_with_alias_id
> and vmstate-unregister,  so this is just the simple ram cases.

This are the easy bits, for others I need to rearrange headers elsewhere.

Thanks, Juan.
Juan Quintela April 25, 2017, 9 a.m. UTC | #3
"Dr. David Alan Gilbert" <dgilbert@redhat.com> wrote:
> * Juan Quintela (quintela@redhat.com) wrote:
>> Signed-off-by: Juan Quintela <quintela@redhat.com>
>> ---
>>  migration/savevm.c  | 17 -----------------
>>  migration/vmstate.c | 16 ++++++++++++++++
>>  2 files changed, 16 insertions(+), 17 deletions(-)
>
> OK, but it's a little odd, savevm.c still has the vmstate_register_with_alias_id
> and vmstate-unregister,  so this is just the simple ram cases.

Dropped the patch.

vmstate.c ends only having the interpreter on it.
diff mbox

Patch

diff --git a/migration/savevm.c b/migration/savevm.c
index cc9c086..c47b209 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -45,7 +45,6 @@ 
 #include "qemu/sockets.h"
 #include "qemu/queue.h"
 #include "sysemu/cpus.h"
-#include "exec/memory.h"
 #include "qmp-commands.h"
 #include "trace.h"
 #include "qemu/bitops.h"
@@ -2465,19 +2464,3 @@  void hmp_info_snapshots(Monitor *mon, const QDict *qdict)
     g_free(global_snapshots);
 
 }
-
-void vmstate_register_ram(MemoryRegion *mr, DeviceState *dev)
-{
-    qemu_ram_set_idstr(mr->ram_block,
-                       memory_region_name(mr), dev);
-}
-
-void vmstate_unregister_ram(MemoryRegion *mr, DeviceState *dev)
-{
-    qemu_ram_unset_idstr(mr->ram_block);
-}
-
-void vmstate_register_ram_global(MemoryRegion *mr)
-{
-    vmstate_register_ram(mr, NULL);
-}
diff --git a/migration/vmstate.c b/migration/vmstate.c
index 8a71349..174c490 100644
--- a/migration/vmstate.c
+++ b/migration/vmstate.c
@@ -1,5 +1,6 @@ 
 #include "qemu/osdep.h"
 #include "qemu-common.h"
+#include "exec/memory.h"
 #include "migration/migration.h"
 #include "migration/qemu-file.h"
 #include "migration/vmstate.h"
@@ -1127,3 +1128,18 @@  bool vmstate_device_is_migratable(const VMStateDescription *vmsd)
     return true;
 }
 
+void vmstate_register_ram(MemoryRegion *mr, DeviceState *dev)
+{
+    qemu_ram_set_idstr(mr->ram_block,
+                       memory_region_name(mr), dev);
+}
+
+void vmstate_unregister_ram(MemoryRegion *mr, DeviceState *dev)
+{
+    qemu_ram_unset_idstr(mr->ram_block);
+}
+
+void vmstate_register_ram_global(MemoryRegion *mr)
+{
+    vmstate_register_ram(mr, NULL);
+}