[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v3 2/2] libxl: save/restore qemu's physmap
On Mon, 30 Jan 2012, Shriram Rajagopalan wrote: > On Mon, Jan 30, 2012 at 8:54 AM, Stefano Stabellini > <stefano.stabellini@xxxxxxxxxxxxx> wrote: > + > +static int libxl__toolstack_restore(uint32_t domid, uint8_t *buf, > + Â Â Â Â uint32_t size, void *data) > +{ > + Â Â libxl__gc *gc = (libxl__gc *) data; > + Â Â int i, ret; > + Â Â uint8_t *ptr = buf; > + Â Â uint32_t count = 0, version = 0; > + Â Â struct libxl__physmap_info* pi; > + > + Â Â if (size < sizeof(version) + sizeof(count)) > + Â Â Â Â return -1; > + > + Â Â memcpy(&version, ptr, sizeof(version)); > + Â Â ptr += sizeof(version); > + > + Â Â if (version != TOOLSTACK_SAVE_VERSION) > + Â Â Â Â return -1; > + > + Â Â memcpy(&count, ptr, sizeof(count)); > + Â Â ptr += sizeof(count); > + > + Â Â if (size < sizeof(version) + sizeof(count) + > + Â Â Â Â Â Â count * (sizeof(struct libxl__physmap_info))) > + Â Â Â Â return -1; > + > + Â Â for (i = 0; i < count; i++) { > + Â Â Â Â pi = (struct libxl__physmap_info*) ptr; > + Â Â Â Â ptr += sizeof(struct libxl__physmap_info) + pi->namelen; > + > + Â Â Â Â ret = libxl__xs_write(gc, 0, libxl__sprintf(gc, > + Â Â Â Â Â Â Â Â Â > Â "/local/domain/0/device-model/%d/physmap/%"PRIx64"/start_addr", > + Â Â Â Â Â Â Â Â Â Â domid, pi->phys_offset), "%"PRIx64, > pi->start_addr); > + Â Â Â Â if (ret) > + Â Â Â Â Â Â return -1; > + Â Â Â Â ret = libxl__xs_write(gc, 0, libxl__sprintf(gc, > + Â Â Â Â Â Â Â Â Â > Â "/local/domain/0/device-model/%d/physmap/%"PRIx64"/size", > + Â Â Â Â Â Â Â Â Â Â domid, pi->phys_offset), "%"PRIx64, > pi->size); > + Â Â Â Â if (ret) > + Â Â Â Â Â Â return -1; > + Â Â Â Â if (pi->namelen > 0) { > + Â Â Â Â Â Â ret = libxl__xs_write(gc, 0, libxl__sprintf(gc, > + Â Â Â Â Â Â Â Â Â Â Â > Â "/local/domain/0/device-model/%d/physmap/%"PRIx64"/name", > + Â Â Â Â Â Â Â Â Â Â Â Â domid, pi->phys_offset), "%s", > pi->name); > + Â Â Â Â Â Â if (ret) > + Â Â Â Â Â Â Â Â return -1; > + Â Â Â Â } > + Â Â } > + Â Â return 0; > +} > + > > > > Sorry if this sounds silly. Is the save/restore of Qemu Physmap equivalent to > save/restore of the Qemu Device Model ? Nope, it is in addition to the save/restore of the QEMU device state. _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |