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
This commit is contained in:
Vitaliy Gusev 2023-03-06 12:35:17 +01:00 committed by Oscar Zhao
parent 09c06686ad
commit 8678beae24

View File

@ -1009,7 +1009,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__);
}