screendump: replace FILE with QIOChannel and fix close()/qemu_close()
commitc5f2bce5ee75ec3267b025f2053bac728da9a6c3
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Fri, 8 Nov 2019 13:31:43 +0000 (8 17:31 +0400)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Thu, 2 Jan 2020 12:29:32 +0000 (2 16:29 +0400)
treeb721e4e5bdd337a8aafa104f43a9a324343fb53b
parentf60a1cdca52dd9cf49aad768471d9e0ea6751f76
screendump: replace FILE with QIOChannel and fix close()/qemu_close()

The file opened for ppm_save() may be a /dev/fdset, in which case a
dup fd is added to the fdset. It should be removed by calling
qemu_close(), instead of the implicit close() on fclose().

I don't see a convenient way to solve that with stdio streams, so I
switched the code to QIOChannel which uses qemu_close().

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
ui/console.c