Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/bhyve/block_if.c
Show First 20 Lines • Show All 880 Lines • ▼ Show 20 Lines | |||||
pthread_mutex_lock(&bc->bc_mtx); | pthread_mutex_lock(&bc->bc_mtx); | ||||
bc->bc_paused = 1; | bc->bc_paused = 1; | ||||
/* The interface is paused. Wait for workers to finish their work */ | /* The interface is paused. Wait for workers to finish their work */ | ||||
while (!blockif_empty(bc)) | while (!blockif_empty(bc)) | ||||
pthread_cond_wait(&bc->bc_work_done_cond, &bc->bc_mtx); | pthread_cond_wait(&bc->bc_work_done_cond, &bc->bc_mtx); | ||||
pthread_mutex_unlock(&bc->bc_mtx); | pthread_mutex_unlock(&bc->bc_mtx); | ||||
if (blockif_flush_bc(bc)) | if (!bc->bc_rdonly && blockif_flush_bc(bc)) | ||||
corvink: Unrelated too. | |||||
Done Inline Actionsgusev.vitaliy_gmail.com: Done. https://reviews.freebsd.org/D38855 | |||||
fprintf(stderr, "%s: [WARN] failed to flush backing file.\r\n", | fprintf(stderr, "%s: [WARN] failed to flush backing file.\r\n", | ||||
__func__); | __func__); | ||||
} | } | ||||
void | void | ||||
blockif_resume(struct blockif_ctxt *bc) | blockif_resume(struct blockif_ctxt *bc) | ||||
{ | { | ||||
assert(bc != NULL); | assert(bc != NULL); | ||||
assert(bc->bc_magic == BLOCKIF_SIG); | assert(bc->bc_magic == BLOCKIF_SIG); | ||||
pthread_mutex_lock(&bc->bc_mtx); | pthread_mutex_lock(&bc->bc_mtx); | ||||
bc->bc_paused = 0; | bc->bc_paused = 0; | ||||
pthread_mutex_unlock(&bc->bc_mtx); | pthread_mutex_unlock(&bc->bc_mtx); | ||||
} | } | ||||
#endif /* BHYVE_SNAPSHOT */ | #endif /* BHYVE_SNAPSHOT */ | ||||
Context not available. |
Unrelated too.