[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 04/16] qemu-file: Don't call qemu_fflush() for read only files
From: |
Juan Quintela |
Subject: |
[PATCH 04/16] qemu-file: Don't call qemu_fflush() for read only files |
Date: |
Tue, 30 May 2023 14:28:01 +0200 |
This was the only caller for read only files. So change the test for
an assert in qemu_fflush().
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
migration/qemu-file.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/migration/qemu-file.c b/migration/qemu-file.c
index 7a5c1a5e32..38984504ba 100644
--- a/migration/qemu-file.c
+++ b/migration/qemu-file.c
@@ -272,9 +272,7 @@ static void qemu_iovec_release_ram(QEMUFile *f)
*/
void qemu_fflush(QEMUFile *f)
{
- if (!qemu_file_is_writable(f)) {
- return;
- }
+ g_assert(qemu_file_is_writable(f));
if (qemu_file_get_error(f)) {
return;
@@ -363,7 +361,9 @@ static ssize_t coroutine_mixed_fn qemu_fill_buffer(QEMUFile
*f)
int qemu_fclose(QEMUFile *f)
{
int ret, ret2;
- qemu_fflush(f);
+ if (qemu_file_is_writable(f)) {
+ qemu_fflush(f);
+ }
ret = qemu_file_get_error(f);
ret2 = qio_channel_close(f->ioc, NULL);
--
2.40.1
- [PATCH 02/16] migration: Change qemu_file_transferred to noflush, (continued)
- [PATCH 02/16] migration: Change qemu_file_transferred to noflush, Juan Quintela, 2023/05/30
- [PATCH 06/16] qemu_file: Use a stat64 for qemu_file_transferred, Juan Quintela, 2023/05/30
- [PATCH 03/16] migration: Use qemu_file_transferred_noflush() for block migration., Juan Quintela, 2023/05/30
- [PATCH 13/16] qemu-file: Simplify qemu_file_get_error(), Juan Quintela, 2023/05/30
- [PATCH 05/16] qemu-file: We only call qemu_file_transferred_* on the sending side, Juan Quintela, 2023/05/30
- [PATCH 08/16] migration: Use the number of transferred bytes directly, Juan Quintela, 2023/05/30
- [PATCH 09/16] qemu_file: Remove unused qemu_file_transferred(), Juan Quintela, 2023/05/30
- [PATCH 04/16] qemu-file: Don't call qemu_fflush() for read only files,
Juan Quintela <=
- Re: [PATCH 04/16] qemu-file: Don't call qemu_fflush() for read only files, Juan Quintela, 2023/05/30
[PATCH 10/16] qemu-file: Remove _noflush from qemu_file_transferred_noflush(), Juan Quintela, 2023/05/30
[PATCH 01/16] qemu-file: Rename qemu_file_transferred_ fast -> noflush, Juan Quintela, 2023/05/30