]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commit
block/vdi: Error out immediately in vdi_create()
authorMax Reitz <mreitz@redhat.com>
Tue, 29 Apr 2014 17:03:16 +0000 (19:03 +0200)
committerKevin Wolf <kwolf@redhat.com>
Wed, 30 Apr 2014 12:46:17 +0000 (14:46 +0200)
commit0549ea8b6d3ed4eba9a3bd0abfaed3af5de69873
treec17db1fa56ca19c240ccd5cda7196d2f231460ca
parente1b42f456fad6e797eaf795ed2e400c4e47d5eb4
block/vdi: Error out immediately in vdi_create()

Currently, if an error occurs during the part of vdi_create() which
actually writes the image, the function stores -errno, but continues
anyway.

Instead of trying to write data which (if it can be written at all) does
not make any sense without the operations before succeeding (e.g.,
writing the image header), just error out immediately.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/vdi.c