mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
vmstate: constify VMStateField
Because they are supposed to remain const. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20181114132931.22624-1-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
5aaac46793
commit
03fee66fde
22 changed files with 162 additions and 135 deletions
|
@ -625,7 +625,7 @@ void msix_unset_vector_notifiers(PCIDevice *dev)
|
|||
}
|
||||
|
||||
static int put_msix_state(QEMUFile *f, void *pv, size_t size,
|
||||
VMStateField *field, QJSON *vmdesc)
|
||||
const VMStateField *field, QJSON *vmdesc)
|
||||
{
|
||||
msix_save(pv, f);
|
||||
|
||||
|
@ -633,7 +633,7 @@ static int put_msix_state(QEMUFile *f, void *pv, size_t size,
|
|||
}
|
||||
|
||||
static int get_msix_state(QEMUFile *f, void *pv, size_t size,
|
||||
VMStateField *field)
|
||||
const VMStateField *field)
|
||||
{
|
||||
msix_load(pv, f);
|
||||
return 0;
|
||||
|
|
|
@ -450,7 +450,7 @@ int pci_bus_numa_node(PCIBus *bus)
|
|||
}
|
||||
|
||||
static int get_pci_config_device(QEMUFile *f, void *pv, size_t size,
|
||||
VMStateField *field)
|
||||
const VMStateField *field)
|
||||
{
|
||||
PCIDevice *s = container_of(pv, PCIDevice, config);
|
||||
PCIDeviceClass *pc = PCI_DEVICE_GET_CLASS(s);
|
||||
|
@ -490,7 +490,7 @@ static int get_pci_config_device(QEMUFile *f, void *pv, size_t size,
|
|||
|
||||
/* just put buffer */
|
||||
static int put_pci_config_device(QEMUFile *f, void *pv, size_t size,
|
||||
VMStateField *field, QJSON *vmdesc)
|
||||
const VMStateField *field, QJSON *vmdesc)
|
||||
{
|
||||
const uint8_t **v = pv;
|
||||
assert(size == pci_config_size(container_of(pv, PCIDevice, config)));
|
||||
|
@ -506,7 +506,7 @@ static VMStateInfo vmstate_info_pci_config = {
|
|||
};
|
||||
|
||||
static int get_pci_irq_state(QEMUFile *f, void *pv, size_t size,
|
||||
VMStateField *field)
|
||||
const VMStateField *field)
|
||||
{
|
||||
PCIDevice *s = container_of(pv, PCIDevice, irq_state);
|
||||
uint32_t irq_state[PCI_NUM_PINS];
|
||||
|
@ -528,7 +528,7 @@ static int get_pci_irq_state(QEMUFile *f, void *pv, size_t size,
|
|||
}
|
||||
|
||||
static int put_pci_irq_state(QEMUFile *f, void *pv, size_t size,
|
||||
VMStateField *field, QJSON *vmdesc)
|
||||
const VMStateField *field, QJSON *vmdesc)
|
||||
{
|
||||
int i;
|
||||
PCIDevice *s = container_of(pv, PCIDevice, irq_state);
|
||||
|
|
|
@ -688,8 +688,8 @@ void shpc_cap_write_config(PCIDevice *d, uint32_t addr, uint32_t val, int l)
|
|||
shpc_cap_update_dword(d);
|
||||
}
|
||||
|
||||
static int shpc_save(QEMUFile *f, void *pv, size_t size, VMStateField *field,
|
||||
QJSON *vmdesc)
|
||||
static int shpc_save(QEMUFile *f, void *pv, size_t size,
|
||||
const VMStateField *field, QJSON *vmdesc)
|
||||
{
|
||||
PCIDevice *d = container_of(pv, PCIDevice, shpc);
|
||||
qemu_put_buffer(f, d->shpc->config, SHPC_SIZEOF(d));
|
||||
|
@ -697,7 +697,8 @@ static int shpc_save(QEMUFile *f, void *pv, size_t size, VMStateField *field,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int shpc_load(QEMUFile *f, void *pv, size_t size, VMStateField *field)
|
||||
static int shpc_load(QEMUFile *f, void *pv, size_t size,
|
||||
const VMStateField *field)
|
||||
{
|
||||
PCIDevice *d = container_of(pv, PCIDevice, shpc);
|
||||
int ret = qemu_get_buffer(f, d->shpc->config, SHPC_SIZEOF(d));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue