The branch stable/13 has been updated by corvink:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=c8b5f347317d1d0dca53acf2f40682314ad0b64e

commit c8b5f347317d1d0dca53acf2f40682314ad0b64e
Author:     Vitaliy Gusev <[email protected]>
AuthorDate: 2023-03-06 11:35:17 +0000
Commit:     Corvin Köhne <[email protected]>
CommitDate: 2023-03-17 10:26:34 +0000

    bhyve: don't flush readonly device at blockif_pause
    
    Reviewed by:            corvink, markj
    MFC after:              1 week
    Sponsored by:           vStack
    Differential Revision:  https://reviews.freebsd.org/D38855
    
    (cherry picked from commit 5c0a03125988b89610f61a1bb2137b0e29d7cf31)
---
 usr.sbin/bhyve/block_if.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/usr.sbin/bhyve/block_if.c b/usr.sbin/bhyve/block_if.c
index f2e60f865f78..edf191491de1 100644
--- a/usr.sbin/bhyve/block_if.c
+++ b/usr.sbin/bhyve/block_if.c
@@ -993,7 +993,7 @@ blockif_pause(struct blockif_ctxt *bc)
                pthread_cond_wait(&bc->bc_work_done_cond, &bc->bc_mtx);
        pthread_mutex_unlock(&bc->bc_mtx);
 
-       if (blockif_flush_bc(bc))
+       if (!bc->bc_rdonly && blockif_flush_bc(bc))
                fprintf(stderr, "%s: [WARN] failed to flush backing file.\r\n",
                        __func__);
 }

Reply via email to