Remove the internal QEMUFile error state modification from qemu_get_buffer_at(). This function is called by two functions, both of which already check for unexpected return values and handle their own error reporting.
Removing this shared state modification makes qemu_get_buffer_at() strictly thread-safe for concurrent disk reads, serving as a preparatory change for the upcoming fast snapshot load feature. Signed-off-by: Aadeshveer Singh <[email protected]> --- migration/qemu-file.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/migration/qemu-file.c b/migration/qemu-file.c index d5a48115bd..c73f8178d7 100644 --- a/migration/qemu-file.c +++ b/migration/qemu-file.c @@ -553,14 +553,11 @@ void qemu_put_buffer_at(QEMUFile *f, const uint8_t *buf, size_t buflen, size_t qemu_get_buffer_at(QEMUFile *f, uint8_t *buf, size_t buflen, off_t pos) { - Error *err = NULL; - if (f->last_error) { return 0; } - if (qio_channel_pread_all(f->ioc, buf, buflen, pos, &err) < 0) { - qemu_file_set_error_obj(f, -EIO, err); + if (qio_channel_pread_all(f->ioc, buf, buflen, pos, NULL) < 0) { return 0; } -- 2.54.0
