]> git.proxmox.com Git - mirror_qemu.git/commit
qmp: dump-guest-memory: don't spin if non-blocking fd would block
authorLuiz Capitulino <lcapitulino@redhat.com>
Fri, 21 Sep 2012 16:17:55 +0000 (13:17 -0300)
committerLuiz Capitulino <lcapitulino@redhat.com>
Thu, 27 Sep 2012 12:46:17 +0000 (09:46 -0300)
commit2f61652d660ec1ffdadf926401a174c11f5c13a7
treed9a101aadfe2d190fad0e16e6df0c0c815179719
parentd691180e41f58cc3c1f9fa848c2ab89193503160
qmp: dump-guest-memory: don't spin if non-blocking fd would block

fd_write_vmcore() will indefinitely spin for a non-blocking
file-descriptor that would block. However, if the fd is non-blocking,
how does it make sense to spin?

Change this behavior to return an error instead.

Note that this can only happen with an fd provided by a management
application. The fd opened internally by dump-guest-memory is blocking.

While there, also fix 'writen_size' variable name.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
dump.c