qemu_fclose: return last_error if set (v3)
authorEduardo Habkost <ehabkost@redhat.com>
Thu, 10 Nov 2011 12:41:43 +0000 (10:41 -0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Mon, 12 Dec 2011 17:47:19 +0000 (11:47 -0600)
commitd82ca915875ac55ba291435f7eb4fe7bfcb2cecb
treee1c091c4263ce611cd3f1c26e2b807b4c56a0435
parenta6d34a949c3546404d403bda61a5e37431b4a6ad
qemu_fclose: return last_error if set (v3)

This will make sure no error will be missed as long as callers always
check for qemu_fclose() return value. For reference, this is the
complete list of qemu_fclose() callers:

 - exec_close(): already fixed to check for negative values, not -1
 - migrate_fd_cleanup(): already fixed to consider only negative values
   as error, not any non-zero value
 - exec_accept_incoming_migration(): no return value check (yet)
 - fd_accept_incoming_migration(): no return value check (yet)
 - tcp_accept_incoming_migration(): no return value check (yet)
 - unix_accept_incoming_migration(): no return value check (yet)
 - do_savevm(): no return value check (yet)
 - load_vmstate(): no return value check (yet)

Changes v1 -> v2:
 - Add small comment about the need to return previously-spotted errors

Changes v2 -> v3:
 - Add braces to "if" statements to match coding style

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
savevm.c