|
From: | Pratik Parvati |
Subject: | VMState in QEMU |
Date: | Mon, 20 Jul 2020 16:28:01 +0530 |
Hi team,
Can someone please explain to me briefly the significance of VMState in Migration. I understand that this reduces the lot of duplication of code across all the devices in QEMU with the common put and get implementation somewhere in the code. Does this have any other significance?
Is it mandatory to define the state of each device? Like, for example, I am referring hw/arm/versatilepb.c; I see the VMState is defined for sic (secondary interrupt controller) Whereas VMState is not defined for PL011 UART device. How do I know which device should be considered for VMState?
Below snippet is used as a reference
typedef struct vpb_sic_state {
SysBusDevice parent_obj;
MemoryRegion iomem;
uint32_t level;
uint32_t mask;
uint32_t pic_enable;
qemu_irq parent[32];
int irq;
} vpb_sic_state;
static const VMStateDescription vmstate_vpb_sic = {
.name = "versatilepb_sic",
.version_id = 1,
.minimum_version_id = 1,
.fields = (VMStateField[]) {
VMSTATE_UINT32(level, vpb_sic_state),
VMSTATE_UINT32(mask, vpb_sic_state),
VMSTATE_UINT32(pic_enable, vpb_sic_state),
VMSTATE_END_OF_LIST()
}
};
From the above code, it is definite that VMState is implemented as per the device (I mean, there is no common structure for defining a VMState of the device). From the migration point of view, how does this declaration help?
Thanks for your continuous support
Regards,
Pratik
[Prev in Thread] | Current Thread | [Next in Thread] |