Skip to contentSkip to conversation

migration: do not doubly-define LoadStateHandler

PATCH In review Paolo Bonzini 2 participants 2 messages Jun 15, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 migration: do not doubly-define LoadStateHandler

As the simplest fix to un-confuse patchew, inline the type in struct VMStateDescription. As there are no users of LoadStateHandler anymore in e.g. function declarations, there isn't much advantage in defining it as a type.

---
 include/migration/vmstate.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
include/migration/vmstate.h +1 -2
index f3f3c2a..82d41fa 100644
@@ -29,7 +29,6 @@
 
 #include "migration/qjson.h"
 
-typedef int LoadStateHandler(QEMUFile *f, void *opaque, int version_id);
 typedef struct VMStateInfo VMStateInfo;
 typedef struct VMStateDescription VMStateDescription;
 typedef struct VMStateField VMStateField;
@@ -176,7 +175,7 @@ struct VMStateDescription {
     int minimum_version_id;
     int minimum_version_id_old;
     MigrationPriority priority;
-    LoadStateHandler *load_state_old;
+    int (*load_state_old)(QEMUFile *f, void *opaque, int version_id);
     int (*pre_load)(void *opaque);
     int (*post_load)(void *opaque, int version_id);
     void (*pre_save)(void *opaque);
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 6 lines · Paolo Bonzini

As the simplest fix to un-confuse patchew, inline the type in struct VMStateDescription. As there are no users of LoadStateHandler anymore in e.g. function declarations, there isn't much advantage in defining it as a type.

I'm currently processing Juan's pullrequest which includes a fix for this (it moves the typedefs into typedefs.h.)

thanks
-- PMM