> > > + /* > > > + * FIXME: async save with coroutine? it would have to copy or > > > + * lock the surface. > > > + */ > > > + ppm_save(dump->filename, surface, &err); > > > > DisplaySurface is just a thin layer above pixman images these days. > > Pixman images are reference counted, so you can > > pixman_image_ref(surface->image) to make sure it doesn't disappear > > underneath you, then pass the pixman image to ppm_save. > > ppm_save() is still synchronous. I suppose you suggested that for a > future async version.
Yes. > (note that in this case, ref the surface is > probably not sufficient, as it could be mutated while it is being > saved) That can happen anyway. The display surface / pixman image can be backed by guest-writable memory (stdvga vram for example) and even when holding the qemu lock the guest vcpu can write there ... cheers, GerdY