Patchwork [qom-cpu,v3,1/6] vmstate: Make vmstate_register() static inline

login
register
mail settings
Submitter Andreas Färber
Date Feb. 25, 2013, 6:22 p.m.
Message ID <1361816570-8707-2-git-send-email-afaerber@suse.de>
Download mbox | patch
Permalink /patch/223005/
State New
Headers show

Comments

Andreas Färber - Feb. 25, 2013, 6:22 p.m.
This avoids adding a duplicate stub for CONFIG_USER_ONLY.

Suggested-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 include/migration/vmstate.h |   12 ++++++++++--
 savevm.c                    |    7 -------
 2 Dateien geändert, 10 Zeilen hinzugefügt(+), 9 Zeilen entfernt(-)

Patch

diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
index f27276c..6d50f6e 100644
--- a/include/migration/vmstate.h
+++ b/include/migration/vmstate.h
@@ -623,12 +623,20 @@  int vmstate_load_state(QEMUFile *f, const VMStateDescription *vmsd,
                        void *opaque, int version_id);
 void vmstate_save_state(QEMUFile *f, const VMStateDescription *vmsd,
                         void *opaque);
-int vmstate_register(DeviceState *dev, int instance_id,
-                     const VMStateDescription *vmsd, void *base);
+
 int vmstate_register_with_alias_id(DeviceState *dev, int instance_id,
                                    const VMStateDescription *vmsd,
                                    void *base, int alias_id,
                                    int required_for_version);
+
+static inline int vmstate_register(DeviceState *dev, int instance_id,
+                                   const VMStateDescription *vmsd,
+                                   void *opaque)
+{
+    return vmstate_register_with_alias_id(dev, instance_id, vmsd,
+                                          opaque, -1, 0);
+}
+
 void vmstate_unregister(DeviceState *dev, const VMStateDescription *vmsd,
                         void *opaque);
 
diff --git a/savevm.c b/savevm.c
index a8a53ef..9a4031a 100644
--- a/savevm.c
+++ b/savevm.c
@@ -1380,13 +1380,6 @@  int vmstate_register_with_alias_id(DeviceState *dev, int instance_id,
     return 0;
 }
 
-int vmstate_register(DeviceState *dev, int instance_id,
-                     const VMStateDescription *vmsd, void *opaque)
-{
-    return vmstate_register_with_alias_id(dev, instance_id, vmsd,
-                                          opaque, -1, 0);
-}
-
 void vmstate_unregister(DeviceState *dev, const VMStateDescription *vmsd,
                         void *opaque)
 {