> +static void qmp_screendump_finish(QemuConsole *con, struct qmp_screendump > *dump) > +{ > + Error *err = NULL; > + DisplaySurface *surface; > + Monitor *prev_mon = cur_mon;
Why this is needed? > + /* > + * 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. cheers, Gerd