summaryrefslogtreecommitdiff
path: root/savevm.c
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2009-09-29 22:48:20 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-10-05 09:32:36 -0500
commit84e2e3eb5f20248ce85d11b8b751e2bd01d8fd95 (patch)
tree3273be0631e4876e9703ff020560fc8072c4ea81 /savevm.c
parent50af324697cb91d3e7a820e2b94ee0237c0103e2 (diff)
vmstate: remove const for put operations
In a later patch, we introduce pre_save() and post_save() functions. The whole point of that operation is to change things in the state. Without this patch, we have to remove the const qualifier in each use with a cast Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'savevm.c')
-rw-r--r--savevm.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/savevm.c b/savevm.c
index fd767be2c..b36c6574d 100644
--- a/savevm.c
+++ b/savevm.c
@@ -649,9 +649,9 @@ static int get_int8(QEMUFile *f, void *pv, size_t size)
return 0;
}
-static void put_int8(QEMUFile *f, const void *pv, size_t size)
+static void put_int8(QEMUFile *f, void *pv, size_t size)
{
- const int8_t *v = pv;
+ int8_t *v = pv;
qemu_put_s8s(f, v);
}
@@ -670,9 +670,9 @@ static int get_int16(QEMUFile *f, void *pv, size_t size)
return 0;
}
-static void put_int16(QEMUFile *f, const void *pv, size_t size)
+static void put_int16(QEMUFile *f, void *pv, size_t size)
{
- const int16_t *v = pv;
+ int16_t *v = pv;
qemu_put_sbe16s(f, v);
}
@@ -691,9 +691,9 @@ static int get_int32(QEMUFile *f, void *pv, size_t size)
return 0;
}
-static void put_int32(QEMUFile *f, const void *pv, size_t size)
+static void put_int32(QEMUFile *f, void *pv, size_t size)
{
- const int32_t *v = pv;
+ int32_t *v = pv;
qemu_put_sbe32s(f, v);
}
@@ -752,9 +752,9 @@ static int get_int64(QEMUFile *f, void *pv, size_t size)
return 0;
}
-static void put_int64(QEMUFile *f, const void *pv, size_t size)
+static void put_int64(QEMUFile *f, void *pv, size_t size)
{
- const int64_t *v = pv;
+ int64_t *v = pv;
qemu_put_sbe64s(f, v);
}
@@ -773,9 +773,9 @@ static int get_uint8(QEMUFile *f, void *pv, size_t size)
return 0;
}
-static void put_uint8(QEMUFile *f, const void *pv, size_t size)
+static void put_uint8(QEMUFile *f, void *pv, size_t size)
{
- const uint8_t *v = pv;
+ uint8_t *v = pv;
qemu_put_8s(f, v);
}
@@ -794,9 +794,9 @@ static int get_uint16(QEMUFile *f, void *pv, size_t size)
return 0;
}
-static void put_uint16(QEMUFile *f, const void *pv, size_t size)
+static void put_uint16(QEMUFile *f, void *pv, size_t size)
{
- const uint16_t *v = pv;
+ uint16_t *v = pv;
qemu_put_be16s(f, v);
}
@@ -815,9 +815,9 @@ static int get_uint32(QEMUFile *f, void *pv, size_t size)
return 0;
}
-static void put_uint32(QEMUFile *f, const void *pv, size_t size)
+static void put_uint32(QEMUFile *f, void *pv, size_t size)
{
- const uint32_t *v = pv;
+ uint32_t *v = pv;
qemu_put_be32s(f, v);
}
@@ -836,9 +836,9 @@ static int get_uint64(QEMUFile *f, void *pv, size_t size)
return 0;
}
-static void put_uint64(QEMUFile *f, const void *pv, size_t size)
+static void put_uint64(QEMUFile *f, void *pv, size_t size)
{
- const uint64_t *v = pv;
+ uint64_t *v = pv;
qemu_put_be64s(f, v);
}
@@ -877,9 +877,9 @@ static int get_timer(QEMUFile *f, void *pv, size_t size)
return 0;
}
-static void put_timer(QEMUFile *f, const void *pv, size_t size)
+static void put_timer(QEMUFile *f, void *pv, size_t size)
{
- QEMUTimer *v = (void *)pv;
+ QEMUTimer *v = pv;
qemu_put_timer(f, v);
}
@@ -898,9 +898,9 @@ static int get_buffer(QEMUFile *f, void *pv, size_t size)
return 0;
}
-static void put_buffer(QEMUFile *f, const void *pv, size_t size)
+static void put_buffer(QEMUFile *f, void *pv, size_t size)
{
- uint8_t *v = (void *)pv;
+ uint8_t *v = pv;
qemu_put_buffer(f, v, size);
}
@@ -1090,7 +1090,7 @@ int vmstate_load_state(QEMUFile *f, const VMStateDescription *vmsd,
}
void vmstate_save_state(QEMUFile *f, const VMStateDescription *vmsd,
- const void *opaque)
+ void *opaque)
{
VMStateField *field = vmsd->fields;
@@ -1098,7 +1098,7 @@ void vmstate_save_state(QEMUFile *f, const VMStateDescription *vmsd,
vmsd->pre_save(opaque);
}
while(field->name) {
- const void *base_addr = opaque + field->offset;
+ void *base_addr = opaque + field->offset;
int i, n_elems = 1;
if (field->flags & VMS_ARRAY) {
@@ -1110,7 +1110,7 @@ void vmstate_save_state(QEMUFile *f, const VMStateDescription *vmsd,
base_addr = *(void **)base_addr;
}
for (i = 0; i < n_elems; i++) {
- const void *addr = base_addr + field->size * i;
+ void *addr = base_addr + field->size * i;
if (field->flags & VMS_STRUCT) {
vmstate_save_state(f, field->vmsd, addr);