Patchwork [3/8] libqemustub: vmstate register/unregister stubs

login
register
mail settings
Submitter Eduardo Habkost
Date Dec. 5, 2012, 4:49 p.m.
Message ID <1354726153-30264-4-git-send-email-ehabkost@redhat.com>
Download mbox | patch
Permalink /patch/203905/
State New
Headers show

Comments

Eduardo Habkost - Dec. 5, 2012, 4:49 p.m.
Add vmstate stub functions, so that qdev.o can be used without savevm.o
when vmstate support is not necessary (i.e. by *-user).

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
Originally submitted as:
  Subject: qdev-core: isolate vmstate handling into separate functions

Changes v1 -> v2:
 - Add GCC_WEAK_DECL to function declarations

Changes v2 -> v3:
 - Subject: qdev: add weak aliases for vmstate handling on qdev.c
 - Make vmstate_register_with_alias_id()/vmstate_unregister()
   have GCC_WEAK versions, instead of creating a new function
 - Kept qdev_get_vmsd() inside qdev.c

Changss v3 -> v4:
 - Use the new QEMU_WEAK_ALIAS system instead of GCC_WEAK

Changes v4 -> v5:
 - Use the new libqemustub.a, instead of QEMU_WEAK_ALIAS

Changes v5 -> v6:
 - Cosmetic whitespace changes
---
 stubs/Makefile.objs |  1 +
 stubs/vmstate.c     | 17 +++++++++++++++++
 2 files changed, 18 insertions(+)
 create mode 100644 stubs/vmstate.c
Andreas Färber - Jan. 2, 2013, 12:57 p.m.
Am 05.12.2012 17:49, schrieb Eduardo Habkost:
> diff --git a/stubs/vmstate.c b/stubs/vmstate.c
> new file mode 100644
> index 0000000..badf79e
> --- /dev/null
> +++ b/stubs/vmstate.c
> @@ -0,0 +1,17 @@
> +#include "qemu-common.h"
> +#include "vmstate.h"

Needed to update this to "migration/vmstate.h" since Paolo's header file
reorganization.

Andreas

Patch

diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs
index 00f0b64..ca2197e 100644
--- a/stubs/Makefile.objs
+++ b/stubs/Makefile.objs
@@ -6,4 +6,5 @@  stub-obj-y += fdset-remove-fd.o
 stub-obj-y += get-fd.o
 stub-obj-y += set-fd-handler.o
 stub-obj-y += reset.o
+stub-obj-y += vmstate.o
 stub-obj-$(CONFIG_WIN32) += fd-register.o
diff --git a/stubs/vmstate.c b/stubs/vmstate.c
new file mode 100644
index 0000000..badf79e
--- /dev/null
+++ b/stubs/vmstate.c
@@ -0,0 +1,17 @@ 
+#include "qemu-common.h"
+#include "vmstate.h"
+
+int vmstate_register_with_alias_id(DeviceState *dev,
+                                   int instance_id,
+                                   const VMStateDescription *vmsd,
+                                   void *base, int alias_id,
+                                   int required_for_version)
+{
+    return 0;
+}
+
+void vmstate_unregister(DeviceState *dev,
+                        const VMStateDescription *vmsd,
+                        void *opaque)
+{
+}