Patchwork [qom-cpu,v2,1/8] stubs: Add vmstate_register() stub

login
register
mail settings
Submitter Andreas Färber
Date Feb. 18, 2013, 7:42 p.m.
Message ID <1361216553-4549-2-git-send-email-afaerber@suse.de>
Download mbox | patch
Permalink /patch/221456/
State New
Headers show

Comments

Andreas Färber - Feb. 18, 2013, 7:42 p.m.
So far we only had vmstate_register_with_alias_id().

Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 stubs/vmstate.c |    7 +++++++
 1 Datei geändert, 7 Zeilen hinzugefügt(+)
Eduardo Habkost - Feb. 18, 2013, 7:49 p.m.
On Mon, Feb 18, 2013 at 08:42:26PM +0100, Andreas Färber wrote:
> So far we only had vmstate_register_with_alias_id().

This is an exact duplicate of the real vmstate_register()
implementation. What about simply making the real vmstate_register()
function a static inline inside vmstate.h?

> 
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> ---
>  stubs/vmstate.c |    7 +++++++
>  1 Datei geändert, 7 Zeilen hinzugefügt(+)
> 
> diff --git a/stubs/vmstate.c b/stubs/vmstate.c
> index 3682af5..f64e9a3 100644
> --- a/stubs/vmstate.c
> +++ b/stubs/vmstate.c
> @@ -10,6 +10,13 @@ int vmstate_register_with_alias_id(DeviceState *dev,
>      return 0;
>  }
>  
> +int vmstate_register(DeviceState *dev, int instance_id,
> +                     const VMStateDescription *vmsd, void *base)
> +{
> +    return vmstate_register_with_alias_id(dev, instance_id, vmsd, base,
> +                                          -1, 0);
> +}
> +
>  void vmstate_unregister(DeviceState *dev,
>                          const VMStateDescription *vmsd,
>                          void *opaque)
> -- 
> 1.7.10.4
>

Patch

diff --git a/stubs/vmstate.c b/stubs/vmstate.c
index 3682af5..f64e9a3 100644
--- a/stubs/vmstate.c
+++ b/stubs/vmstate.c
@@ -10,6 +10,13 @@  int vmstate_register_with_alias_id(DeviceState *dev,
     return 0;
 }
 
+int vmstate_register(DeviceState *dev, int instance_id,
+                     const VMStateDescription *vmsd, void *base)
+{
+    return vmstate_register_with_alias_id(dev, instance_id, vmsd, base,
+                                          -1, 0);
+}
+
 void vmstate_unregister(DeviceState *dev,
                         const VMStateDescription *vmsd,
                         void *opaque)