qemu-file: Only set last_error if it is not already set

Signed-off-by: Juan Quintela <quintela@redhat.com>

Reviewed-by: Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Juan Quintela 2013-01-14 13:36:28 +01:00
parent 1e973051b9
commit afe419319d

View File

@ -419,7 +419,9 @@ int qemu_file_get_error(QEMUFile *f)
static void qemu_file_set_error(QEMUFile *f, int ret)
{
f->last_error = ret;
if (f->last_error == 0) {
f->last_error = ret;
}
}
/** Flushes QEMUFile buffer