block: incremental backup transactions using BlockJobTxn
v2 cover block: incremental backup transactions using BlockJobTxn
v2:
Patch 5:
* Set txn pointer to NULL in block_job_txn_begin() [jsnow]
* Rename block_job_txn_job_done to block_job_txn_job_done [jsnow]
* Rename block_job_txn_complete to block_job_txn_kick [jsnow]
* Add BLOCK_JOB_TXN_CANCEL_PENDING to solve race condition on cancel [jsnow]
* Document when txn may be NULL
Patch 7:
* Convert blockdev-backup in addition to drive-backup
* Add 'transactional-cancel' argument so users can enable/disable transactional behavior. This preserves semantics for existing users and allows fine-grained control over when to use transaction semantics. [jsnow]
Patch 10:
* Test fail/cancel race condition [jsnow]
* Use new 'transactional-cancel' QMP argument
This series uses patches from John Snow's "[PATCH v6 00/10] block: incremental backup transactions" series but implements the feature with a new transaction mechanism for blockjobs called BlockJobTxn.
Recap: motivation for block job transactions
--------------------------------------------
If an incremental backup block job fails then we reclaim the bitmap so the job can be retried. The problem comes when multiple jobs are started as part of a qmp 'transaction' command. We need to group these jobs in a transaction so that either all jobs complete successfully or all bitmaps are reclaimed.
Without transactions, there is a case where some jobs complete successfully and throw away their bitmaps, making it impossible to retry the backup by rerunning the command if one of the jobs fails.
How does this implementation work?
----------------------------------
These patches add a BlockJobTxn object with the following API:
txn = block_job_txn_new(); block_job_txn_add_job(txn, job1); block_job_txn_add_job(txn, job2); block_job_txn_begin();
The jobs either both complete successfully or they both fail/cancel. If the user cancels job1 then job2 will also be cancelled and vice versa.
Jobs stay alive waiting for other jobs to complete. They can be cancelled by the user during this time. Job blockers are still in effect and no other block job can run on this device in the meantime (since QEMU currently only allows 1 job per device). This is the main drawback to this approach but reasonable since you probably don't want to run other jobs/operations until you're sure the backup was successful (you won't be able to retry a failed backup if there's a new job running).
Adding transaction support to the backup job is very easy. It just needs to make a call before throwing away the bitmap and returning from its coroutine:
block_job_txn_job_done(job->txn, job, ret);
if (job->sync_bitmap) {
BdrvDirtyBitmap *bm;
if (ret < 0 || block_job_is_cancelled(&job->common)) {
...John Snow (4):
qapi: Add transaction support to block-dirty-bitmap operations
iotests: add transactional incremental backup test
block: rename BlkTransactionState and BdrvActionOps
iotests: 124 - transactional failure test
Kashyap Chamarthy (1):
qmp-commands.hx: Update the supported 'transaction' operations
Stefan Hajnoczi (5):
block: keep bitmap if incremental backup job is cancelled
block: add block job transactions
blockdev: make BlockJobTxn available to qmp 'transaction' block/backup: support block job transactions
tests: add BlockJobTxn unit test
block.c | 19 ++- block/backup.c | 7 +- blockdev.c | 364 ++++++++++++++++++++++++++++++++++++--------- blockjob.c | 193 ++++++++++++++++++++++++ docs/bitmaps.md | 6 +- hmp.c | 2 +- include/block/block.h | 2 +- include/block/block_int.h | 6 +- include/block/blockjob.h | 52 +++++++ qapi-schema.json | 6 +- qapi/block-core.json | 14 +- qmp-commands.hx | 21 ++- tests/Makefile | 3 + tests/qemu-iotests/124 | 182 ++++++++++++++++++++++- tests/qemu-iotests/124.out | 4 +- tests/test-blockjob-txn.c | 233 +++++++++++++++++++++++++++++ trace-events | 4 + 17 files changed, 1022 insertions(+), 96 deletions(-) create mode 100644 tests/test-blockjob-txn.c
Signature · 1 line
2.4.3
PATCH v2 1/10 qapi: Add transaction support to block-dirty-bitmap operations
From: John Snow <[email protected]>
This adds two qmp commands to transactions.
block-dirty-bitmap-add allows you to create a bitmap simultaneously alongside a new full backup to accomplish a clean synchronization point.
block-dirty-bitmap-clear allows you to reset a bitmap back to as-if it were new, which can also be used alongside a full backup to accomplish a clean synchronization point.
--- block.c | 19 +++++++- blockdev.c | 114 +++++++++++++++++++++++++++++++++++++++++++++- docs/bitmaps.md | 6 +-- include/block/block.h | 1 - include/block/block_int.h | 3 ++ qapi-schema.json | 6 ++- 6 files changed, 139 insertions(+), 10 deletions(-)
block.c +17 -2
@@ -3510,10 +3510,25 @@ void bdrv_reset_dirty_bitmap(BdrvDirtyBitmap *bitmap,hbitmap_reset (bitmap->bitmap, cur_sector, nr_sectors); } -void bdrv_clear_dirty_bitmap (BdrvDirtyBitmap *bitmap) +void bdrv_clear_dirty_bitmap (BdrvDirtyBitmap *bitmap,HBitmap **out) {assert (bdrv_dirty_bitmap_enabled (bitmap)); -hbitmap_reset_all (bitmap->bitmap); +if (!out) { +hbitmap_reset_all (bitmap->bitmap); + }else { +HBitmap *backup = bitmap->bitmap; + bitmap->bitmap =hbitmap_alloc (bitmap->size, +hbitmap_granularity (backup)); + *out = backup; + } +} + +void bdrv_undo_clear_dirty_bitmap (BdrvDirtyBitmap *bitmap,HBitmap *in) +{ +HBitmap *tmp = bitmap->bitmap; +assert (bdrv_dirty_bitmap_enabled (bitmap)); + bitmap->bitmap = in; +hbitmap_free (tmp); } void bdrv_set_dirty(BlockDriverState *bs, int64_t cur_sector,
blockdev.c +113 -1
132 lines not on this page · raw message
docs/bitmaps.md +1 -5
@@ -97,11 +97,7 @@ which is included at the end of this document. } ``` -## Transactions (Not yet implemented) - -* Transactional commands are forthcoming in a future version, - and are not yet available for use. This section serves as - documentation of intent for their design and usage. +## Transactions ### Justification
include/block/block.h +0 -1
@@ -497,7 +497,6 @@ void bdrv_set_dirty_bitmap(BdrvDirtyBitmap *bitmap, int64_t cur_sector, int nr_sectors);void bdrv_reset_dirty_bitmap (BdrvDirtyBitmap *bitmap,int64_t cur_sector,int nr_sectors); -void bdrv_clear_dirty_bitmap (BdrvDirtyBitmap *bitmap);void bdrv_dirty_iter_init (BdrvDirtyBitmap *bitmap,struct HBitmapIter *hbi);void bdrv_set_dirty_iter (struct HBitmapIter *hbi,int64_t offset);int64_t bdrv_get_dirty_count (BdrvDirtyBitmap *bitmap);
include/block/block_int.h +3 -0
@@ -663,4 +663,7 @@ void blk_dev_resize_cb(BlockBackend *blk);void bdrv_set_dirty (BlockDriverState *bs,int64_t cur_sector,int nr_sectors); +void bdrv_clear_dirty_bitmap (BdrvDirtyBitmap *bitmap,HBitmap **out); +void bdrv_undo_clear_dirty_bitmap (BdrvDirtyBitmap *bitmap,HBitmap *in); +#endif /* BLOCK_INT_H */
qapi-schema.json +5 -1
@@ -1490,6 +1490,8 @@ # abort since 1.6 # blockdev-snapshot-internal-sync since 1.7 # blockdev-backup since 2.3 +# block-dirty-bitmap-add since 2.4 +# block-dirty-bitmap-clear since 2.4 ## { 'union': 'TransactionAction', 'data': {
@@ -1497,7 +1499,9 @@ 'drive-backup': 'DriveBackup', 'blockdev-backup': 'BlockdevBackup', 'abort': 'Abort', - 'blockdev-snapshot-internal-sync': 'BlockdevSnapshotInternal' + 'blockdev-snapshot-internal-sync': 'BlockdevSnapshotInternal', + 'block-dirty-bitmap-add': 'BlockDirtyBitmapAdd', + 'block-dirty-bitmap-clear': 'BlockDirtyBitmap' } } ##
Signature · 1 line
2.4.3
PATCH v2 2/10 iotests: add transactional incremental backup test
In reply to Stefan HajnocziFrom: John Snow <[email protected]>
Test simple usage cases for using transactions to create and synchronize incremental backups.
--- tests/qemu-iotests/124 | 54 ++++++++++++++++++++++++++++++++++++++++++++++ tests/qemu-iotests/124.out | 4 ++-- 2 files changed, 56 insertions(+), 2 deletions(-)
tests/qemu-iotests/124 +54 -0
@@ -36,6 +36,23 @@ def try_remove(img): pass +def transaction_action(action, **kwargs): + return { + 'type': action, + 'data': kwargs + } + + +def transaction_bitmap_clear(node, name, **kwargs): + return transaction_action('block-dirty-bitmap-clear', + node=node, name=name, **kwargs) + + +def transaction_drive_backup(device, target, **kwargs): + return transaction_action('drive-backup', device=device, target=target, + **kwargs) + + class Bitmap: def __init__(self, name, drive): self.name = name
@@ -264,6 +281,43 @@ class TestIncrementalBackup(iotests.QMPTestCase): return self.do_incremental_simple(granularity=131072) + def test_incremental_transaction(self): + '''Test: Verify backups made from transactionally created bitmaps. + + Create a bitmap "before" VM execution begins, then create a second + bitmap AFTER writes have already occurred. Use transactions to create + a full backup and synchronize both bitmaps to this backup. + Create an incremental backup through both bitmaps and verify that + both backups match the current drive0 image. + ''' + + drive0 = self.drives[0] + bitmap0 = self.add_bitmap('bitmap0', drive0) + self.hmp_io_writes(drive0['id'], (('0xab', 0, 512), + ('0xfe', '16M', '256k'), + ('0x64', '32736k', '64k'))) + bitmap1 = self.add_bitmap('bitmap1', drive0) + + result = self.vm.qmp('transaction', actions=[ + transaction_bitmap_clear(bitmap0.drive['id'], bitmap0.name), + transaction_bitmap_clear(bitmap1.drive['id'], bitmap1.name), + transaction_drive_backup(drive0['id'], drive0['backup'], + sync='full', format=drive0['fmt']) + ]) + self.assert_qmp(result, 'return', {}) + self.wait_until_completed(drive0['id']) + self.files.append(drive0['backup']) + + self.hmp_io_writes(drive0['id'], (('0x9a', 0, 512), + ('0x55', '8M', '352k'), + ('0x78', '15872k', '1M'))) + # Both bitmaps should be correctly in sync. + self.create_incremental(bitmap0) + self.create_incremental(bitmap1) + self.vm.shutdown() + self.check_backups() + + def test_incremental_failure(self): '''Test: Verify backups made after a failure are correct.
tests/qemu-iotests/124.out +2 -2
@@ -1,5 +1,5 @@ -....... +........ ---------------------------------------------------------------------- -Ran 7 tests +Ran 8 tests OK
Signature · 1 line
2.4.3
Re: [Qemu-devel] [PATCH v2 02/10] iotests: add transactional incremental backup test
Quoted 101 lines · Stefan Hajnoczi
From: John Snow <[email protected]>
Test simple usage cases for using transactions to create and synchronize incremental backups.
Signed-off-by John Snow <[email protected]>Reviewed-by Max Reitz <[email protected]>Reviewed-by Stefan Hajnoczi <[email protected]>Signed-off-by Stefan Hajnoczi <[email protected]>--- tests/qemu-iotests/124 | 54 ++++++++++++++++++++++++++++++++++++++++++++++ tests/qemu-iotests/124.out | 4 ++-- 2 files changed, 56 insertions(+), 2 deletions(-)tests/qemu-iotests/124 +54
-0@@ -36,6 +36,23 @@ def try_remove(img): pass +def transaction_action(action, **kwargs): + return { + 'type': action, + 'data': kwargs + } + + +def transaction_bitmap_clear(node, name, **kwargs): + return transaction_action('block-dirty-bitmap-clear', + node=node, name=name, **kwargs) + + +def transaction_drive_backup(device, target, **kwargs): + return transaction_action('drive-backup', device=device, target=target, + **kwargs) + + class Bitmap: def __init__(self, name, drive): self.name = name@@ -264,6 +281,43 @@ class TestIncrementalBackup(iotests.QMPTestCase): return self.do_incremental_simple(granularity=131072) + def test_incremental_transaction(self): + '''Test: Verify backups made from transactionally created bitmaps. + + Create a bitmap "before" VM execution begins, then create a second + bitmap AFTER writes have already occurred. Use transactions to create + a full backup and synchronize both bitmaps to this backup. + Create an incremental backup through both bitmaps and verify that + both backups match the current drive0 image. + ''' + + drive0 = self.drives[0] + bitmap0 = self.add_bitmap('bitmap0', drive0) + self.hmp_io_writes(drive0['id'], (('0xab', 0, 512), + ('0xfe', '16M', '256k'), + ('0x64', '32736k', '64k'))) + bitmap1 = self.add_bitmap('bitmap1', drive0) + + result = self.vm.qmp('transaction', actions=[ + transaction_bitmap_clear(bitmap0.drive['id'], bitmap0.name), + transaction_bitmap_clear(bitmap1.drive['id'], bitmap1.name), + transaction_drive_backup(drive0['id'], drive0['backup'], + sync='full', format=drive0['fmt']) + ]) + self.assert_qmp(result, 'return', {}) + self.wait_until_completed(drive0['id']) + self.files.append(drive0['backup']) + + self.hmp_io_writes(drive0['id'], (('0x9a', 0, 512), + ('0x55', '8M', '352k'), + ('0x78', '15872k', '1M'))) + # Both bitmaps should be correctly in sync. + self.create_incremental(bitmap0) + self.create_incremental(bitmap1) + self.vm.shutdown() + self.check_backups() + + def test_incremental_failure(self): '''Test: Verify backups made after a failure are correct.tests/qemu-iotests/124.out +2
-2@@ -1,5 +1,5 @@ -....... +........ ---------------------------------------------------------------------- -Ran 7 tests +Ran 8 tests OKSignature · 1 line
2.4.3
PATCH v2 3/10 block: rename BlkTransactionState and BdrvActionOps
In reply to Stefan HajnocziFrom: John Snow <[email protected]>
These structures are misnomers, somewhat.
(1) BlockTransactionState is not state for a transaction, but is rather state for a single transaction action. Rename it "BlkActionState" to be more accurate.
(2) The BdrvActionOps describes operations for the BlkActionState, above. This name might imply a 'BdrvAction' or a 'BdrvActionState', which there isn't.
Rename this to 'BlkActionOps' to match 'BlkActionState'.
Lastly, update the surrounding in-line documentation and comments to reflect the current nature of how Transactions operate.
This patch changes only comments and names, and should not affect behavior in any way.
--- blockdev.c | 116 ++++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 65 insertions(+), 51 deletions(-)
blockdev.c +65 -51
@@ -1240,43 +1240,57 @@ static BdrvDirtyBitmap *block_dirty_bitmap_lookup(const char *node,/* New and old BlockDriverState structs for atomic group operations */ -typedef struct BlkTransactionState BlkTransactionState ; +typedef struct BlkActionState BlkActionState ; -/* Only prepare() may fail. In a single transaction, only one of commit() or -abort() will be called, clean() will always be called if it present. */ -typedef struct BdrvActionOps { -/* Size of state struct, in bytes. */ +/** +* BlkActionOps: +* Table of operations that define an Action. +* +* @instance_size: Size of state struct, in bytes. +* @prepare: Prepare the work, must NOT be NULL. +* @commit: Commit the changes, can be NULL. +* @abort: Abort the changes on fail, can be NULL. +* @clean: Clean up resources after all transaction actions have called +* commit() or abort(). Can be NULL. +* +* Only prepare() may fail. In a single transaction, only one of commit() or +* abort() will be called. clean() will always be called if it is present. +*/ +typedef struct BlkActionOps {size_t instance_size; -/* Prepare the work, must NOT be NULL. */ -void (*prepare)(BlkTransactionState *common,Error **errp); -/* Commit the changes, can be NULL. */ -void (*commit)(BlkTransactionState *common); -/* Abort the changes on fail, can be NULL. */ -void (*abort)(BlkTransactionState *common); -/* Clean up resource in the end, can be NULL. */ -void (*clean)(BlkTransactionState *common); -}BdrvActionOps ; +void (*prepare)(BlkActionState *common,Error **errp); +void (*commit)(BlkActionState *common); +void (*abort)(BlkActionState *common); +void (*clean)(BlkActionState *common); +}BlkActionOps ; -/* -* This structure must be arranged as first member in child type, assuming -* that compiler will also arrange it to the same address with parent instance. -* Later it will be used in free(). +/** +* BlkActionState: +* Describes one Action's state within a Transaction. +* +* @action: QAPI-defined enum identifying which Action to perform. +* @ops: Table of ActionOps this Action can perform. +* @entry: List membership for all Actions in this Transaction. +* +* This structure must be arranged as first member in a subclassed type, +* assuming that the compiler will also arrange it to the same offsets as the +* base class. */ -struct BlkTransactionState { +struct BlkActionState {TransactionAction *action; -const BdrvActionOps *ops; -QSIMPLEQ_ENTRY (BlkTransactionState) entry; +const BlkActionOps *ops; +QSIMPLEQ_ENTRY (BlkActionState) entry; };/* internal snapshot private data */ typedef struct InternalSnapshotState { -BlkTransactionState common; +BlkActionState common;BlockDriverState *bs;AioContext *aio_context;QEMUSnapshotInfo sn; }InternalSnapshotState ; -static void internal_snapshot_prepare (BlkTransactionState *common, +static void internal_snapshot_prepare (BlkActionState *common,Error **errp) {Error *local_err =NULL ;
@@ -1372,7 +1386,7 @@ static void internal_snapshot_prepare(BlkTransactionState *common, state->bs = bs; } -static void internal_snapshot_abort (BlkTransactionState *common) +static void internal_snapshot_abort (BlkActionState *common) {InternalSnapshotState *state =DO_UPCAST (InternalSnapshotState, common, common);
@@ -1395,7 +1409,7 @@ static void internal_snapshot_abort(BlkTransactionState *common) } } -static void internal_snapshot_clean (BlkTransactionState *common) +static void internal_snapshot_clean (BlkActionState *common) {InternalSnapshotState *state =DO_UPCAST (InternalSnapshotState, common, common);
@@ -1407,13 +1421,13 @@ static void internal_snapshot_clean(BlkTransactionState *common)/* external snapshot private data */ typedef struct ExternalSnapshotState { -BlkTransactionState common; +BlkActionState common;BlockDriverState *old_bs;BlockDriverState *new_bs;AioContext *aio_context; }ExternalSnapshotState ; -static void external_snapshot_prepare (BlkTransactionState *common, +static void external_snapshot_prepare (BlkActionState *common,Error **errp) {BlockDriver *drv;
@@ -1534,7 +1548,7 @@ static void external_snapshot_prepare(BlkTransactionState *common, } } -static void external_snapshot_commit (BlkTransactionState *common) +static void external_snapshot_commit (BlkActionState *common) {ExternalSnapshotState *state =DO_UPCAST (ExternalSnapshotState, common, common);
@@ -1552,7 +1566,7 @@ static void external_snapshot_commit(BlkTransactionState *common)aio_context_release (state->aio_context); } -static void external_snapshot_abort (BlkTransactionState *common) +static void external_snapshot_abort (BlkActionState *common) {ExternalSnapshotState *state =DO_UPCAST (ExternalSnapshotState, common, common);
@@ -1565,13 +1579,13 @@ static void external_snapshot_abort(BlkTransactionState *common) }typedef struct DriveBackupState { -BlkTransactionState common; +BlkActionState common;BlockDriverState *bs;AioContext *aio_context;BlockJob *job; }DriveBackupState ; -static void drive_backup_prepare (BlkTransactionState *common,Error **errp) +static void drive_backup_prepare (BlkActionState *common,Error **errp) {DriveBackupState *state =DO_UPCAST (DriveBackupState, common, common);BlockDriverState *bs;
@@ -1612,7 +1626,7 @@ static void drive_backup_prepare(BlkTransactionState *common, Error **errp) state->job = state->bs->job; } -static void drive_backup_abort (BlkTransactionState *common) +static void drive_backup_abort (BlkActionState *common) {DriveBackupState *state =DO_UPCAST (DriveBackupState, common, common);BlockDriverState *bs = state->bs;
@@ -1623,7 +1637,7 @@ static void drive_backup_abort(BlkTransactionState *common) } } -static void drive_backup_clean (BlkTransactionState *common) +static void drive_backup_clean (BlkActionState *common) {DriveBackupState *state =DO_UPCAST (DriveBackupState, common, common);
@@ -1633,13 +1647,13 @@ static void drive_backup_clean(BlkTransactionState *common) }typedef struct BlockdevBackupState { -BlkTransactionState common; +BlkActionState common;BlockDriverState *bs;BlockJob *job;AioContext *aio_context; }BlockdevBackupState ; -static void blockdev_backup_prepare (BlkTransactionState *common,Error **errp) +static void blockdev_backup_prepare (BlkActionState *common,Error **errp) {BlockdevBackupState *state =DO_UPCAST (BlockdevBackupState, common, common);BlockdevBackup *backup;
@@ -1688,7 +1702,7 @@ static void blockdev_backup_prepare(BlkTransactionState *common, Error **errp) state->job = state->bs->job; } -static void blockdev_backup_abort (BlkTransactionState *common) +static void blockdev_backup_abort (BlkActionState *common) {BlockdevBackupState *state =DO_UPCAST (BlockdevBackupState, common, common);BlockDriverState *bs = state->bs;
@@ -1699,7 +1713,7 @@ static void blockdev_backup_abort(BlkTransactionState *common) } } -static void blockdev_backup_clean (BlkTransactionState *common) +static void blockdev_backup_clean (BlkActionState *common) {BlockdevBackupState *state =DO_UPCAST (BlockdevBackupState, common, common);
@@ -1709,7 +1723,7 @@ static void blockdev_backup_clean(BlkTransactionState *common) } typedef struct BlockDirtyBitmapState { - BlkTransactionState common; + BlkActionState common; BdrvDirtyBitmap *bitmap; BlockDriverState *bs; AioContext *aio_context;
@@ -1717,7 +1731,7 @@ typedef struct BlockDirtyBitmapState {bool prepared; } BlockDirtyBitmapState; -static void block_dirty_bitmap_add_prepare (BlkTransactionState *common, +static void block_dirty_bitmap_add_prepare (BlkActionState *common,Error **errp) {Error *local_err =NULL ;
@@ -1738,7 +1752,7 @@ static void block_dirty_bitmap_add_prepare(BlkTransactionState *common, } } -static void block_dirty_bitmap_add_abort (BlkTransactionState *common) +static void block_dirty_bitmap_add_abort (BlkActionState *common) {BlockDirtyBitmapAdd *action; BlockDirtyBitmapState *state = DO_UPCAST(BlockDirtyBitmapState,
@@ -1753,7 +1767,7 @@ static void block_dirty_bitmap_add_abort(BlkTransactionState *common) } } -static void block_dirty_bitmap_clear_prepare (BlkTransactionState *common, +static void block_dirty_bitmap_clear_prepare (BlkActionState *common,Error **errp) { BlockDirtyBitmapState *state = DO_UPCAST(BlockDirtyBitmapState,
@@ -1782,7 +1796,7 @@ static void block_dirty_bitmap_clear_prepare(BlkTransactionState *common,/* AioContext is released in .clean() */ } -static void block_dirty_bitmap_clear_abort (BlkTransactionState *common) +static void block_dirty_bitmap_clear_abort (BlkActionState *common) {BlockDirtyBitmapState *state =DO_UPCAST (BlockDirtyBitmapState, common, common);
@@ -1790,7 +1804,7 @@ static void block_dirty_bitmap_clear_abort(BlkTransactionState *common)bdrv_undo_clear_dirty_bitmap (state->bitmap, state->backup); } -static void block_dirty_bitmap_clear_commit (BlkTransactionState *common) +static void block_dirty_bitmap_clear_commit (BlkActionState *common) {BlockDirtyBitmapState *state =DO_UPCAST (BlockDirtyBitmapState, common, common);
@@ -1798,7 +1812,7 @@ static void block_dirty_bitmap_clear_commit(BlkTransactionState *common)hbitmap_free (state->backup); } -static void block_dirty_bitmap_clear_clean (BlkTransactionState *common) +static void block_dirty_bitmap_clear_clean (BlkActionState *common) {BlockDirtyBitmapState *state =DO_UPCAST (BlockDirtyBitmapState, common, common);
@@ -1808,17 +1822,17 @@ static void block_dirty_bitmap_clear_clean(BlkTransactionState *common) } } -static void abort_prepare (BlkTransactionState *common,Error **errp) +static void abort_prepare (BlkActionState *common,Error **errp) {error_setg (errp,"Transaction aborted using Abort action" ); } -static void abort_commit (BlkTransactionState *common) +static void abort_commit (BlkActionState *common) {g_assert_not_reached ();/* this action never succeeds */ } -static const BdrvActionOps actions[] = { +static const BlkActionOps actions[] = { [TRANSACTION_ACTION_KIND_BLOCKDEV_SNAPSHOT_SYNC ] = { .instance_size =sizeof (ExternalSnapshotState), .prepare = external_snapshot_prepare,
@@ -1838,7 +1852,7 @@ static const BdrvActionOps actions[] = { .clean = blockdev_backup_clean, }, [TRANSACTION_ACTION_KIND_ABORT] = { - .instance_size = sizeof(BlkTransactionState), + .instance_size = sizeof(BlkActionState), .prepare = abort_prepare, .commit = abort_commit, },
@@ -1869,10 +1883,10 @@ static const BdrvActionOps actions[] = {void qmp_transaction (TransactionActionList *dev_list,Error **errp) {TransactionActionList *dev_entry = dev_list; -BlkTransactionState *state, *next; +BlkActionState *state, *next;Error *local_err =NULL ; - QSIMPLEQ_HEAD(snap_bdrv_states, BlkTransactionState) snap_bdrv_states; + QSIMPLEQ_HEAD(snap_bdrv_states, BlkActionState) snap_bdrv_states;QSIMPLEQ_INIT (&snap_bdrv_states);/* drain all i/o before any operations */
@@ -1881,7 +1895,7 @@ void qmp_transaction(TransactionActionList *dev_list, Error **errp)/* We don't do anything in this loop that commits us to the operations */ while (NULL != dev_entry) {TransactionAction *dev_info =NULL ; -const BdrvActionOps *ops; +const BlkActionOps *ops; dev_info = dev_entry->value; dev_entry = dev_entry->next;
Signature · 1 line
2.4.3
Re: [Qemu-devel] [PATCH v2 03/10] block: rename BlkTransactionState and BdrvActionOps
Quoted 16 lines · Stefan Hajnoczi
From: John Snow <[email protected]>
These structures are misnomers, somewhat.
(1) BlockTransactionState is not state for a transaction, but is rather state for a single transaction action. Rename it "BlkActionState" to be more accurate.
(2) The BdrvActionOps describes operations for the BlkActionState, above. This name might imply a 'BdrvAction' or a 'BdrvActionState', which there isn't.
Rename this to 'BlkActionOps' to match 'BlkActionState'.Lastly, update the surrounding in-line documentation and comments to reflect the current nature of how Transactions operate.
Quoted 7 lines
This patch changes only comments and names, and should not affect behavior in any way.
Signed-off-by John Snow <[email protected]>Reviewed-by Max Reitz <[email protected]>Reviewed-by Stefan Hajnoczi <[email protected]>Signed-off-by Stefan Hajnoczi <[email protected]>
Quoted 327 lines
--- blockdev.c | 116 ++++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 65 insertions(+), 51 deletions(-)blockdev.c +65
-51@@ -1240,43 +1240,57 @@ static BdrvDirtyBitmap *block_dirty_bitmap_lookup(const char *node,/* New and old BlockDriverState structs for atomic group operations */ -typedef struct BlkTransactionState BlkTransactionState ; +typedef struct BlkActionState BlkActionState ; -/* Only prepare() may fail. In a single transaction, only one of commit() or -abort() will be called, clean() will always be called if it present. */ -typedef struct BdrvActionOps { -/* Size of state struct, in bytes. */ +/** +* BlkActionOps: +* Table of operations that define an Action. +* +* @instance_size: Size of state struct, in bytes. +* @prepare: Prepare the work, must NOT be NULL. +* @commit: Commit the changes, can be NULL. +* @abort: Abort the changes on fail, can be NULL. +* @clean: Clean up resources after all transaction actions have called +* commit() or abort(). Can be NULL. +* +* Only prepare() may fail. In a single transaction, only one of commit() or +* abort() will be called. clean() will always be called if it is present. +*/ +typedef struct BlkActionOps {size_t instance_size; -/* Prepare the work, must NOT be NULL. */ -void (*prepare)(BlkTransactionState *common,Error **errp); -/* Commit the changes, can be NULL. */ -void (*commit)(BlkTransactionState *common); -/* Abort the changes on fail, can be NULL. */ -void (*abort)(BlkTransactionState *common); -/* Clean up resource in the end, can be NULL. */ -void (*clean)(BlkTransactionState *common); -}BdrvActionOps ; +void (*prepare)(BlkActionState *common,Error **errp); +void (*commit)(BlkActionState *common); +void (*abort)(BlkActionState *common); +void (*clean)(BlkActionState *common); +}BlkActionOps ; -/* -* This structure must be arranged as first member in child type, assuming -* that compiler will also arrange it to the same address with parent instance. -* Later it will be used in free(). +/** +* BlkActionState: +* Describes one Action's state within a Transaction. +* +* @action: QAPI-defined enum identifying which Action to perform. +* @ops: Table of ActionOps this Action can perform. +* @entry: List membership for all Actions in this Transaction. +* +* This structure must be arranged as first member in a subclassed type, +* assuming that the compiler will also arrange it to the same offsets as the +* base class. */ -struct BlkTransactionState { +struct BlkActionState {TransactionAction *action; -const BdrvActionOps *ops; -QSIMPLEQ_ENTRY (BlkTransactionState) entry; +const BlkActionOps *ops; +QSIMPLEQ_ENTRY (BlkActionState) entry; };/* internal snapshot private data */ typedef struct InternalSnapshotState { -BlkTransactionState common; +BlkActionState common;BlockDriverState *bs;AioContext *aio_context;QEMUSnapshotInfo sn; }InternalSnapshotState ; -static void internal_snapshot_prepare (BlkTransactionState *common, +static void internal_snapshot_prepare (BlkActionState *common,Error **errp) {Error *local_err =NULL ;@@ -1372,7 +1386,7 @@ static void internal_snapshot_prepare(BlkTransactionState *common, state->bs = bs; } -static void internal_snapshot_abort (BlkTransactionState *common) +static void internal_snapshot_abort (BlkActionState *common) {InternalSnapshotState *state =DO_UPCAST (InternalSnapshotState, common, common);@@ -1395,7 +1409,7 @@ static void internal_snapshot_abort(BlkTransactionState *common) } } -static void internal_snapshot_clean (BlkTransactionState *common) +static void internal_snapshot_clean (BlkActionState *common) {InternalSnapshotState *state =DO_UPCAST (InternalSnapshotState, common, common);@@ -1407,13 +1421,13 @@ static void internal_snapshot_clean(BlkTransactionState *common)/* external snapshot private data */ typedef struct ExternalSnapshotState { -BlkTransactionState common; +BlkActionState common;BlockDriverState *old_bs;BlockDriverState *new_bs;AioContext *aio_context; }ExternalSnapshotState ; -static void external_snapshot_prepare (BlkTransactionState *common, +static void external_snapshot_prepare (BlkActionState *common,Error **errp) {BlockDriver *drv;@@ -1534,7 +1548,7 @@ static void external_snapshot_prepare(BlkTransactionState *common, } } -static void external_snapshot_commit (BlkTransactionState *common) +static void external_snapshot_commit (BlkActionState *common) {ExternalSnapshotState *state =DO_UPCAST (ExternalSnapshotState, common, common);@@ -1552,7 +1566,7 @@ static void external_snapshot_commit(BlkTransactionState *common)aio_context_release (state->aio_context); } -static void external_snapshot_abort (BlkTransactionState *common) +static void external_snapshot_abort (BlkActionState *common) {ExternalSnapshotState *state =DO_UPCAST (ExternalSnapshotState, common, common);@@ -1565,13 +1579,13 @@ static void external_snapshot_abort(BlkTransactionState *common) }typedef struct DriveBackupState { -BlkTransactionState common; +BlkActionState common;BlockDriverState *bs;AioContext *aio_context;BlockJob *job; }DriveBackupState ; -static void drive_backup_prepare (BlkTransactionState *common,Error **errp) +static void drive_backup_prepare (BlkActionState *common,Error **errp) {DriveBackupState *state =DO_UPCAST (DriveBackupState, common, common);BlockDriverState *bs;@@ -1612,7 +1626,7 @@ static void drive_backup_prepare(BlkTransactionState *common, Error **errp) state->job = state->bs->job; } -static void drive_backup_abort (BlkTransactionState *common) +static void drive_backup_abort (BlkActionState *common) {DriveBackupState *state =DO_UPCAST (DriveBackupState, common, common);BlockDriverState *bs = state->bs;@@ -1623,7 +1637,7 @@ static void drive_backup_abort(BlkTransactionState *common) } } -static void drive_backup_clean (BlkTransactionState *common) +static void drive_backup_clean (BlkActionState *common) {DriveBackupState *state =DO_UPCAST (DriveBackupState, common, common);@@ -1633,13 +1647,13 @@ static void drive_backup_clean(BlkTransactionState *common) }typedef struct BlockdevBackupState { -BlkTransactionState common; +BlkActionState common;BlockDriverState *bs;BlockJob *job;AioContext *aio_context; }BlockdevBackupState ; -static void blockdev_backup_prepare (BlkTransactionState *common,Error **errp) +static void blockdev_backup_prepare (BlkActionState *common,Error **errp) {BlockdevBackupState *state =DO_UPCAST (BlockdevBackupState, common, common);BlockdevBackup *backup;@@ -1688,7 +1702,7 @@ static void blockdev_backup_prepare(BlkTransactionState *common, Error **errp) state->job = state->bs->job; } -static void blockdev_backup_abort (BlkTransactionState *common) +static void blockdev_backup_abort (BlkActionState *common) {BlockdevBackupState *state =DO_UPCAST (BlockdevBackupState, common, common);BlockDriverState *bs = state->bs;@@ -1699,7 +1713,7 @@ static void blockdev_backup_abort(BlkTransactionState *common) } } -static void blockdev_backup_clean (BlkTransactionState *common) +static void blockdev_backup_clean (BlkActionState *common) {BlockdevBackupState *state =DO_UPCAST (BlockdevBackupState, common, common);@@ -1709,7 +1723,7 @@ static void blockdev_backup_clean(BlkTransactionState *common) } typedef struct BlockDirtyBitmapState { - BlkTransactionState common; + BlkActionState common; BdrvDirtyBitmap *bitmap; BlockDriverState *bs; AioContext *aio_context;@@ -1717,7 +1731,7 @@ typedef struct BlockDirtyBitmapState {bool prepared; } BlockDirtyBitmapState; -static void block_dirty_bitmap_add_prepare (BlkTransactionState *common, +static void block_dirty_bitmap_add_prepare (BlkActionState *common,Error **errp) {Error *local_err =NULL ;@@ -1738,7 +1752,7 @@ static void block_dirty_bitmap_add_prepare(BlkTransactionState *common, } } -static void block_dirty_bitmap_add_abort (BlkTransactionState *common) +static void block_dirty_bitmap_add_abort (BlkActionState *common) {BlockDirtyBitmapAdd *action; BlockDirtyBitmapState *state = DO_UPCAST(BlockDirtyBitmapState,@@ -1753,7 +1767,7 @@ static void block_dirty_bitmap_add_abort(BlkTransactionState *common) } } -static void block_dirty_bitmap_clear_prepare (BlkTransactionState *common, +static void block_dirty_bitmap_clear_prepare (BlkActionState *common,Error **errp) { BlockDirtyBitmapState *state = DO_UPCAST(BlockDirtyBitmapState,@@ -1782,7 +1796,7 @@ static void block_dirty_bitmap_clear_prepare(BlkTransactionState *common,/* AioContext is released in .clean() */ } -static void block_dirty_bitmap_clear_abort (BlkTransactionState *common) +static void block_dirty_bitmap_clear_abort (BlkActionState *common) {BlockDirtyBitmapState *state =DO_UPCAST (BlockDirtyBitmapState, common, common);@@ -1790,7 +1804,7 @@ static void block_dirty_bitmap_clear_abort(BlkTransactionState *common)bdrv_undo_clear_dirty_bitmap (state->bitmap, state->backup); } -static void block_dirty_bitmap_clear_commit (BlkTransactionState *common) +static void block_dirty_bitmap_clear_commit (BlkActionState *common) {BlockDirtyBitmapState *state =DO_UPCAST (BlockDirtyBitmapState, common, common);@@ -1798,7 +1812,7 @@ static void block_dirty_bitmap_clear_commit(BlkTransactionState *common)hbitmap_free (state->backup); } -static void block_dirty_bitmap_clear_clean (BlkTransactionState *common) +static void block_dirty_bitmap_clear_clean (BlkActionState *common) {BlockDirtyBitmapState *state =DO_UPCAST (BlockDirtyBitmapState, common, common);@@ -1808,17 +1822,17 @@ static void block_dirty_bitmap_clear_clean(BlkTransactionState *common) } } -static void abort_prepare (BlkTransactionState *common,Error **errp) +static void abort_prepare (BlkActionState *common,Error **errp) {error_setg (errp,"Transaction aborted using Abort action" ); } -static void abort_commit (BlkTransactionState *common) +static void abort_commit (BlkActionState *common) {g_assert_not_reached ();/* this action never succeeds */ } -static const BdrvActionOps actions[] = { +static const BlkActionOps actions[] = { [TRANSACTION_ACTION_KIND_BLOCKDEV_SNAPSHOT_SYNC ] = { .instance_size =sizeof (ExternalSnapshotState), .prepare = external_snapshot_prepare,@@ -1838,7 +1852,7 @@ static const BdrvActionOps actions[] = { .clean = blockdev_backup_clean, }, [TRANSACTION_ACTION_KIND_ABORT] = { - .instance_size = sizeof(BlkTransactionState), + .instance_size = sizeof(BlkActionState), .prepare = abort_prepare, .commit = abort_commit, },@@ -1869,10 +1883,10 @@ static const BdrvActionOps actions[] = {void qmp_transaction (TransactionActionList *dev_list,Error **errp) {TransactionActionList *dev_entry = dev_list; -BlkTransactionState *state, *next; +BlkActionState *state, *next;Error *local_err =NULL ; - QSIMPLEQ_HEAD(snap_bdrv_states, BlkTransactionState) snap_bdrv_states; + QSIMPLEQ_HEAD(snap_bdrv_states, BlkActionState) snap_bdrv_states;QSIMPLEQ_INIT (&snap_bdrv_states);/* drain all i/o before any operations */ @@ -1881,7 +1895,7 @@ void qmp_transaction(TransactionActionList *dev_list, Error **errp)/* We don't do anything in this loop that commits us to the operations */ while (NULL != dev_entry) {TransactionAction *dev_info =NULL ; -const BdrvActionOps *ops; +const BlkActionOps *ops; dev_info = dev_entry->value; dev_entry = dev_entry->next;Signature · 1 line
2.4.3
PATCH v2 4/10 block: keep bitmap if incremental backup job is cancelled
In reply to Stefan HajnocziReclaim the dirty bitmap if an incremental backup block job is cancelled. The ret variable may be 0 when the job is cancelled so it's not enough to check ret < 0.
--- block/backup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
block/backup.c +1 -1
@@ -431,7 +431,7 @@ static void coroutine_fn backup_run(void *opaque)if (job->sync_bitmap) {BdrvDirtyBitmap *bm; -if (ret <0 ) { +if (ret <0 ||block_job_is_cancelled (&job->common)) {/* Merge the successor back into the parent, delete nothing. */ bm =bdrv_reclaim_dirty_bitmap (bs, job->sync_bitmap,NULL );assert (bm);
Signature · 1 line
2.4.3
Re: [Qemu-devel] [PATCH v2 04/10] block: keep bitmap if incremental backup job is cancelled
Quoted 25 lines · Stefan Hajnoczi
Reclaim the dirty bitmap if an incremental backup block job is cancelled. The ret variable may be 0 when the job is cancelled so it's not enough to check ret < 0.
Signed-off-by Stefan Hajnoczi <[email protected]>--- block/backup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)block/backup.c +1
-1@@ -431,7 +431,7 @@ static void coroutine_fn backup_run(void *opaque)if (job->sync_bitmap) {BdrvDirtyBitmap *bm; -if (ret <0 ) { +if (ret <0 ||block_job_is_cancelled (&job->common)) {/* Merge the successor back into the parent, delete nothing. */ bm =bdrv_reclaim_dirty_bitmap (bs, job->sync_bitmap,NULL );assert (bm);Signature · 1 line
2.4.3
PATCH v2 5/10 block: add block job transactions
In reply to Stefan HajnocziSometimes block jobs must execute as a transaction group. Finishing jobs wait until all other jobs are ready to complete successfully. Failure or cancellation of one job cancels the other jobs in the group.
---
v2:
* Set txn pointer to NULL in block_job_txn_begin() [jsnow]
* Rename block_job_txn_prepare_to_complete to block_job_txn_job_done [jsnow]
* Rename block_job_txn_complete to block_job_txn_kick [jsnow]
* Add BLOCK_JOB_TXN_CANCEL_PENDING to solve race condition on cancel [jsnow]
* Document when txn may be NULL
--- blockjob.c | 193 +++++++++++++++++++++++++++++++++++++++++++++++ include/block/block.h | 1 + include/block/blockjob.h | 52 +++++++++++++ trace-events | 4 + 4 files changed, 250 insertions(+)
blockjob.c +193 -0
@@ -400,3 +400,196 @@ void block_job_defer_to_main_loop(BlockJob *job,qemu_bh_schedule (data->bh); } + +typedef enum { +BLOCK_JOB_TXN_OK ,/* no job failed yet */ +BLOCK_JOB_TXN_CANCEL_PENDING ,/* kick scheduled to cancel jobs */ +BLOCK_JOB_TXN_CANCEL_DONE ,/* cancelled jobs can terminate now */ +}BlockJobTxnState ; + +/* Transactional group of block jobs */ +struct BlockJobTxn { +/* Jobs may be in different AioContexts so protect all fields */ +QemuMutex lock; + +/* Reference count for txn object */ +unsigned int ref; + +/* Is this txn ok or are jobs being cancelled? */ +BlockJobTxnState state; + +/* Number of jobs still running */ +unsigned int jobs_pending; + +/* List of jobs */ + QLIST_HEAD(, BlockJob) jobs; +}; + +BlockJobTxn *block_job_txn_new (void ) +{ +BlockJobTxn *txn =g_new (BlockJobTxn,1 ); +qemu_mutex_init (&txn->lock); + txn->ref =1 ;/* dropped by block_job_txn_begin() */ + txn->state =BLOCK_JOB_TXN_OK ; + txn->jobs_pending =0 ; +QLIST_INIT (&txn->jobs); +return txn; +} + +static void block_job_txn_unref (BlockJobTxn *txn) +{ +qemu_mutex_lock (&txn->lock); + +if (--txn->ref >0 ) { +qemu_mutex_unlock (&txn->lock); +return ; + } + +qemu_mutex_unlock (&txn->lock); +qemu_mutex_destroy (&txn->lock); +g_free (txn); +} + +/* The purpose of this is to keep txn alive until all jobs have been added */ +void block_job_txn_begin (BlockJobTxn **txn) +{ +block_job_txn_unref (*txn); + *txn =NULL ; +} + +void block_job_txn_add_job (BlockJobTxn *txn,BlockJob *job) +{ +if (!txn) { +return ; + } + +assert (!job->txn); + job->txn = txn; + +qemu_mutex_lock (&txn->lock); + txn->ref++; + txn->jobs_pending++; +QLIST_INSERT_HEAD (&txn->jobs, job, txn_list); +qemu_mutex_unlock (&txn->lock); +} + +/* Cancel all other jobs in case of abort, wake all waiting jobs in case of +* successful completion. Runs from main loop. +*/ +static void block_job_txn_kick (BlockJob *job,void *opaque) +{ +BlockJobTxn *txn = opaque; +BlockJob *other_job; +GSList *ctxs =NULL ; +GSList *ctxs_iter; +bool cancel = false; + +qemu_mutex_lock (&txn->lock); + txn->ref++;/* keep txn alive until the end of this loop */ + +/* Acquire AioContexts so jobs cannot race with us */ + QLIST_FOREACH(other_job, &txn->jobs, txn_list) { +AioContext *ctx; + +qemu_mutex_unlock (&txn->lock); + ctx =bdrv_get_aio_context (other_job->bs); +aio_context_acquire (ctx); + ctxs =g_slist_prepend (ctxs, ctx); +qemu_mutex_lock (&txn->lock); + } + +/* From here on block_job_txn_job_done() callers should not wait */ +if (txn->state ==BLOCK_JOB_TXN_CANCEL_PENDING ) { + txn->state =BLOCK_JOB_TXN_CANCEL_DONE ; + cancel = true; + } + +/* Kick jobs */ + QLIST_FOREACH(other_job, &txn->jobs, txn_list) { +qemu_mutex_unlock (&txn->lock); + +/* Don't cancel our own failed job since cancellation throws away the +* error value. +*/ +if (cancel && other_job != job) { +block_job_cancel (other_job); + }else { +block_job_enter (other_job); + } + +qemu_mutex_lock (&txn->lock); + } + +qemu_mutex_unlock (&txn->lock); +block_job_txn_unref (txn); + +/* Release AioContexts */ +for (ctxs_iter = ctxs; ctxs_iter; ctxs_iter = ctxs_iter->next) { +aio_context_release (ctxs_iter->data); + } +g_slist_free (ctxs); +} + +void coroutine_fn block_job_txn_job_done(BlockJobTxn *txn, +BlockJob *job, +int ret) +{ +if (!txn) { +return ; + } + +qemu_mutex_lock (&txn->lock); + +/* This function is entered in 4 cases: +* +* 1. Successful job completion - wait for other jobs +* 2. First failed/cancelled job in txn - cancel other jobs and wait +* 3. Subsequent cancelled jobs - finish immediately, don't wait +* 4. While kick is pending - wait for kick to cancel or wake us +*/ +trace_block_job_txn_job_done_entry (txn, job, ret, +block_job_is_cancelled (job), + txn->state, + txn->jobs_pending); + +if (txn->state ==BLOCK_JOB_TXN_CANCEL_DONE ) {/* Case 3 */ +assert (block_job_is_cancelled (job)); + goto out;/* already cancelled, don't yield */ + } + +if (txn->state ==BLOCK_JOB_TXN_OK ) { +if (ret !=0 ||block_job_is_cancelled (job)) {/* Case 2 */ + txn->state =BLOCK_JOB_TXN_CANCEL_PENDING ; +block_job_defer_to_main_loop (job, block_job_txn_kick, txn); + }else {/* Case 1 */ +if (--txn->jobs_pending ==0 ) { +block_job_defer_to_main_loop (job, block_job_txn_kick, txn); + } + } + } + +/* Wait for block_job_txn_kick() in cases 1, 2, and 4 */ +do { +qemu_mutex_unlock (&txn->lock); + job->busy = false; +qemu_coroutine_yield (); + job->busy = true; +qemu_mutex_lock (&txn->lock); + +/* Did the user just cancel this job? */ +if (block_job_is_cancelled (job) && txn->state ==BLOCK_JOB_TXN_OK ) { + txn->state =BLOCK_JOB_TXN_CANCEL_PENDING ; +block_job_defer_to_main_loop (job, block_job_txn_kick, txn); + } + }while (txn->state !=BLOCK_JOB_TXN_CANCEL_DONE && + txn->jobs_pending >0 ); + +out: +trace_block_job_txn_job_done_return (txn, job, ret, +block_job_is_cancelled (job), + txn->state, + txn->jobs_pending); + +qemu_mutex_unlock (&txn->lock); +block_job_txn_unref (txn); +}
include/block/block.h +1 -0
@@ -13,6 +13,7 @@typedef struct BlockDriver BlockDriver ;typedef struct BlockJob BlockJob ;typedef struct BdrvChildRole BdrvChildRole ; +typedef struct BlockJobTxn BlockJobTxn ; typedef struct BlockDriverInfo { /* in bytes, 0 if irrelevant */
include/block/blockjob.h +52 -0
62 lines not on this page · raw message
trace-events +4 -0
@@ -123,6 +123,10 @@ virtio_blk_data_plane_start(void *s) "dataplane %p" virtio_blk_data_plane_stop(void *s) "dataplane %p" virtio_blk_data_plane_process_request(void *s, unsigned int out_num, unsigned int in_num, unsigned int head) "dataplane %p out_num %u in_num %u head %u" +# blockjob.c +block_job_txn_job_done_entry(void *txn, void *job, int ret, bool cancelled, int status, unsigned int jobs_pending) "txn %p job %p ret %d cancelled %d status %d jobs_pending %u" +block_job_txn_job_done_return(void *txn, void *job, int ret, bool cancelled, int status, unsigned int jobs_pending) "txn %p job %p ret %d cancelled %d status %d jobs_pending %u" + # hw/virtio/dataplane/vring.c vring_setup(uint64_t physical, void *desc, void *avail, void *used) "vring physical %#"PRIx64" desc %p avail %p used %p"
Signature · 1 line
2.4.3
Re: [Qemu-devel] [PATCH v2 05/10] block: add block job transactions
Quoted 7 lines · Stefan Hajnoczi
+/**
+ *block_job_txn_add_job:
+ * @txn: The transaction (may be NULL)
+ * @job: Job to add to the transaction
+ *
+ * Add @job to the transaction. The @job must not already be in a transaction.
+ * The block job driver must callblock_job_txn_prepare_to_complete()before
s/block_job_txn_prepare_to_complete/block_job_txn_job_done/
Reading this for a second time I start to feel it too complicated for the good.
I have another idea: in block_job_completed, check if other jobs have failed, and call this job driver's (imaginary) "abort()" callback accordingly; if all jobs has succeeded, call a "commit" callback during last block_job_completed.
Does that make sense?
Fam
Re: [Qemu-devel] [PATCH v2 05/10] block: add block job transactions
Quoted 11 lines · Fam Zheng
Quoted 7 lines · Stefan Hajnoczi
+/**
+ *block_job_txn_add_job:
+ * @txn: The transaction (may be NULL)
+ * @job: Job to add to the transaction
+ *
+ * Add @job to the transaction. The @job must not already be in a transaction.
+ * The block job driver must callblock_job_txn_prepare_to_complete()befores/block_job_txn_prepare_to_complete/block_job_txn_job_done/
Quoted 7 lines
Reading this for a second time I start to feel it too complicated for the good.
I have another idea: in
block_job_completed, check if other jobs have failed, and call this job driver's (imaginary) "abort()" callback accordingly; if all jobs has succeeded, call a "commit" callback during lastblock_job_completed.Does that make sense?
I think you've skipped the hard part: immediate cancellation. If a job is cancelled by the user or a job fails, then all other jobs are cancelled immediately.
Immediate cancellation has the problem that jobs could be running in any AioContext, so you need to handle concurrency. That's where the locking, juggling AioContexts, and interaction between blockjobs comes in.
If immediate cancellation is removed then this patch becomes simple:block_job_txn_job_done() becomes a yield and until the jobs_pending counter reaches 0.
But now the user must handle cancellation and error cases manually by invoking QMP block-job-cancel on all the other jobs. In other words, we're requiring that the user implements their own BlockJobTxn struct that keeps track of related jobs. If they don't keep track then they may not be able to terminate jobs after failure.
This is why QEMU should be the one to complete or fail all block jobs in the transaction. It's simpler if we don't do that but the API then requires more complexity in the user to be used correctly.
Stefan
Re: [Qemu-devel] [PATCH v2 05/10] block: add block job transactions
Quoted 20 lines · Stefan Hajnoczi
Quoted 11 lines · Fam Zheng
Quoted 7 lines · Stefan Hajnoczi
+/**
+ *block_job_txn_add_job:
+ * @txn: The transaction (may be NULL)
+ * @job: Job to add to the transaction
+ *
+ * Add @job to the transaction. The @job must not already be in a transaction.
+ * The block job driver must callblock_job_txn_prepare_to_complete()befores/block_job_txn_prepare_to_complete/block_job_txn_job_done/
Quoted 7 lines
Reading this for a second time I start to feel it too complicated for the good.
I have another idea: in
block_job_completed, check if other jobs have failed, and call this job driver's (imaginary) "abort()" callback accordingly; if all jobs has succeeded, call a "commit" callback during lastblock_job_completed.Does that make sense?
Quoted 8 lines
I think you've skipped the hard part: immediate cancellation. If a job is cancelled by the user or a job fails, then all other jobs are cancelled immediately.
Immediate cancellation has the problem that jobs could be running in any AioContext, so you need to handle concurrency. That's where the locking, juggling AioContexts, and interaction between blockjobs comes in.
OK, let me try again:
The idea is intercepting job->cb so we can handle jobs completely in block_job_completed (which is in main loop), rather than the coroutines that can be any AioContext.
1) If a job is cancelled or failed, it goes to block_job_completed immediately, with block_job_is_cancelled() == true. In this case, we call block_job_cancel_sync on all other jobs, and then call "abort()" callbacks to reclaim any bitmaps, then emit QMP events. Some other jobs may have already completed before this point, but it's not a problem because we always defer the actual completions (abort/commit and QMP) altogether.
2) If there is no job failed or canceled, in the last block_job_completed, we call "commit()" to abdicate bitmaps, and emit the QMP events.
This would still require BlockJobTxn to track the block jobs in a group, but hopefully it could reduce the complexity of interactions between block jobs.
I can prototype it if this isn't missing anything obvious.
Fam
Quoted 14 lines
If immediate cancellation is removed then this patch becomes simple:
block_job_txn_job_done()becomes a yield and until thejobs_pendingcounter reaches 0.But now the user must handle cancellation and error cases manually by invoking QMP block-job-cancel on all the other jobs. In other words, we're requiring that the user implements their own BlockJobTxn struct that keeps track of related jobs. If they don't keep track then they may not be able to terminate jobs after failure.
This is why QEMU should be the one to complete or fail all block jobs in the transaction. It's simpler if we don't do that but the API then requires more complexity in the user to be used correctly.
Re: [Qemu-devel] [PATCH v2 05/10] block: add block job transactions
Quoted 43 lines · Fam Zheng
Quoted 20 lines · Stefan Hajnoczi
Quoted 11 lines · Fam Zheng
Quoted 7 lines · Stefan Hajnoczi
+/**
+ *block_job_txn_add_job:
+ * @txn: The transaction (may be NULL)
+ * @job: Job to add to the transaction
+ *
+ * Add @job to the transaction. The @job must not already be in a transaction.
+ * The block job driver must callblock_job_txn_prepare_to_complete()befores/block_job_txn_prepare_to_complete/block_job_txn_job_done/
Quoted 7 lines
Reading this for a second time I start to feel it too complicated for the good.
I have another idea: in
block_job_completed, check if other jobs have failed, and call this job driver's (imaginary) "abort()" callback accordingly; if all jobs has succeeded, call a "commit" callback during lastblock_job_completed.Does that make sense?
Quoted 8 lines
I think you've skipped the hard part: immediate cancellation. If a job is cancelled by the user or a job fails, then all other jobs are cancelled immediately.
Immediate cancellation has the problem that jobs could be running in any AioContext, so you need to handle concurrency. That's where the locking, juggling AioContexts, and interaction between blockjobs comes in.
OK, let me try again:
The idea is intercepting
job->cbso we can handle jobs completely inblock_job_completed(which is in main loop), rather than the coroutines that can be any AioContext.1) If a job is cancelled or failed, it goes to
block_job_completedimmediately, withblock_job_is_cancelled()== true. In this case, we callblock_job_cancel_syncon all other jobs, and then call "abort()" callbacks to reclaim any bitmaps, then emit QMP events. Some other jobs may have already completed before this point, but it's not a problem because we always defer the actual completions (abort/commit and QMP) altogether.
Quoted 7 lines
2) If there is no job failed or canceled, in the last
block_job_completed, we call "commit()" to abdicate bitmaps, and emit the QMP events.This would still require BlockJobTxn to track the block jobs in a group, but hopefully it could reduce the complexity of interactions between block jobs.
I can prototype it if this isn't missing anything obvious.
Yes, please try it. It's half-way between what John originally did and what I did. It might be the simplest solution.
Be careful with the final piece of code used to complete jobs from block_job_defer_to_main_loop(). It runs from a BH in the main loop after the coroutine has terminated. In the fail/cancel case you might need to protect against race conditions - especially if two jobs finish in the same event loop iteration.
I didn't handle that since block_job_txn_job_done() is called while the coroutine is still alive.
PATCH v2 6/10 blockdev: make BlockJobTxn available to qmp 'transaction'
In reply to Stefan HajnocziProvide a BlockJobTxn to actions executed in a qmp 'transaction' command. This allows actions to make their block jobs either complete as a group or fail/cancel together.
The next patch adds the first user.
--- blockdev.c | 9 +++++++++ 1 file changed, 9 insertions(+)
blockdev.c +9 -0
@@ -1279,6 +1279,7 @@ typedef struct BlkActionOps {struct BlkActionState {TransactionAction *action;const BlkActionOps *ops; +BlockJobTxn *block_job_txn;QSIMPLEQ_ENTRY (BlkActionState) entry; };
@@ -1883,12 +1884,15 @@ static const BlkActionOps actions[] = {void qmp_transaction (TransactionActionList *dev_list,Error **errp) {TransactionActionList *dev_entry = dev_list; +BlockJobTxn *block_job_txn;BlkActionState *state, *next;Error *local_err =NULL ; QSIMPLEQ_HEAD(snap_bdrv_states, BlkActionState) snap_bdrv_states;QSIMPLEQ_INIT (&snap_bdrv_states); + block_job_txn =block_job_txn_new (); +/* drain all i/o before any operations */ bdrv_drain_all ();
@@ -1908,6 +1912,7 @@ void qmp_transaction(TransactionActionList *dev_list, Error **errp) state =g_malloc0 (ops->instance_size); state->ops = ops; state->action = dev_info; + state->block_job_txn = block_job_txn;QSIMPLEQ_INSERT_TAIL (&snap_bdrv_states, state, entry); state->ops->prepare (state, &local_err);
@@ -1917,6 +1922,8 @@ void qmp_transaction(TransactionActionList *dev_list, Error **errp) } } +block_job_txn_begin (&block_job_txn); + QSIMPLEQ_FOREACH(state, &snap_bdrv_states, entry) {if (state->ops->commit) { state->ops->commit (state);
@@ -1927,6 +1934,8 @@ void qmp_transaction(TransactionActionList *dev_list, Error **errp) goto exit; delete_and_fail: +block_job_txn_begin (&block_job_txn); +/* failure, and it is all-or-none; roll back all operations */ QSIMPLEQ_FOREACH(state, &snap_bdrv_states, entry) {if (state->ops->abort) {
Signature · 1 line
2.4.3
PATCH v2 7/10 block/backup: support block job transactions
In reply to Stefan HajnocziJoin the transaction when the 'transactional-cancel' QMP argument is true.
This ensures that the sync bitmap is not thrown away if another block job in the transaction is cancelled or fails. This is critical so incremental backup with multiple disks can be retried in case of cancellation/failure.
---
v2:
* Convert blockdev-backup in addition to drive-backup
* Add 'transactional-cancel' argument so users can enable/disable transactional behavior. This preserves semantics for existing users and allows fine-grained control over when to use transaction semantics. [jsnow]
--- block/backup.c | 5 +- blockdev.c | 139 ++++++++++++++++++++++++++++++++++++---------- hmp.c | 2 +- include/block/block_int.h | 3 +- qapi/block-core.json | 14 ++++- 5 files changed, 130 insertions(+), 33 deletions(-)
block/backup.c +4 -1
@@ -429,6 +429,8 @@ static void coroutine_fn backup_run(void *opaque)qemu_co_rwlock_wrlock (&job->flush_rwlock);qemu_co_rwlock_unlock (&job->flush_rwlock); +block_job_txn_job_done (job->common.txn, &job->common, ret); +if (job->sync_bitmap) {BdrvDirtyBitmap *bm;if (ret <0 ||block_job_is_cancelled (&job->common)) {
@@ -457,7 +459,7 @@ void backup_start(BlockDriverState *bs, BlockDriverState *target,BlockdevOnError on_source_error, BlockdevOnError on_target_error, BlockCompletionFunc *cb, void *opaque, - Error **errp) + BlockJobTxn *txn, Error **errp) { int64_t len;
@@ -539,6 +541,7 @@ void backup_start(BlockDriverState *bs, BlockDriverState *target, sync_bitmap :NULL ; job->common.len = len; job->common.co =qemu_coroutine_create (backup_run); +block_job_txn_add_job (txn, &job->common);qemu_coroutine_enter (job->common.co, job);return ;
blockdev.c +111 -28
216 lines not on this page · raw message
hmp.c +1 -1
@@ -1090,7 +1090,7 @@ void hmp_drive_backup(Monitor *mon, const QDict *qdict)qmp_drive_backup (device, filename, !!format, format, full ?MIRROR_SYNC_MODE_FULL :MIRROR_SYNC_MODE_TOP , true, mode, false,0 , false,NULL , - false,0 , false,0 , &err); + false,0 , false,0 , false, false, &err);hmp_handle_error (mon, &err); }
include/block/block_int.h +2 -1
@@ -642,6 +642,7 @@ void mirror_start(BlockDriverState *bs, BlockDriverState *target,* @on_target_error: The action to take upon error writing to the target. * @cb: Completion function for the job. * @opaque: Opaque pointer value passed to @cb. +* @txn: Transaction that this job is part of (may be NULL). * * Start a backup operation on @bs. Clusters in @bs are written to @target * until the job is cancelled or manually completed.
@@ -652,7 +653,7 @@ void backup_start(BlockDriverState *bs, BlockDriverState *target,BlockdevOnError on_source_error, BlockdevOnError on_target_error, BlockCompletionFunc *cb, void *opaque, - Error **errp); + BlockJobTxn *txn, Error **errp);void blk_dev_change_media_cb (BlockBackend *blk,bool load);bool blk_dev_has_removable_media (BlockBackend *blk);
qapi/block-core.json +12 -2
@@ -736,6 +736,10 @@ # default 'report' (no limitations, since this applies to # a different block device than @device). # +# @transactional-cancel: #optional whether failure or cancellation of other +# block jobs with @transactional-cancel true causes the +# whole group to cancel. +# # Note that @on-source-error and @on-target-error only affect background I/O. # If an error occurs during a guest write request, the device's rerror/werror # actions will be used.
@@ -747,7 +751,8 @@ 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode', '*speed': 'int', '*bitmap': 'str', '*on-source-error': 'BlockdevOnError', - '*on-target-error': 'BlockdevOnError' } } + '*on-target-error': 'BlockdevOnError', + '*transactional-cancel': 'bool' } } ## # @BlockdevBackup
@@ -771,6 +776,10 @@ # default 'report' (no limitations, since this applies to # a different block device than @device). # +# @transactional-cancel: #optional whether failure or cancellation of other +# block jobs with @transactional-cancel true causes the +# whole group to cancel. +# # Note that @on-source-error and @on-target-error only affect background I/O. # If an error occurs during a guest write request, the device's rerror/werror # actions will be used.
@@ -782,7 +791,8 @@ 'sync': 'MirrorSyncMode', '*speed': 'int', '*on-source-error': 'BlockdevOnError', - '*on-target-error': 'BlockdevOnError' } } + '*on-target-error': 'BlockdevOnError', + '*transactional-cancel': 'bool' } } ## # @blockdev-snapshot-sync
Signature · 1 line
2.4.3
PATCH v2 8/10 iotests: 124 - transactional failure test
In reply to Stefan HajnocziFrom: John Snow <[email protected]>
Use a transaction to request an incremental backup across two drives. Coerce one of the jobs to fail, and then re-run the transaction.
Verify that no bitmap data was lost due to the partial transaction failure.
To support the 'transactional-cancel' QMP argument name it's necessary for transaction_action() to convert underscores in Python argument names to hyphens for QMP argument names.
--- tests/qemu-iotests/124 | 130 ++++++++++++++++++++++++++++++++++++++++++++- tests/qemu-iotests/124.out | 4 +- 2 files changed, 130 insertions(+), 4 deletions(-)
tests/qemu-iotests/124 +128 -2
@@ -39,7 +39,7 @@ def try_remove(img): def transaction_action(action, **kwargs): return { 'type': action, - 'data': kwargs + 'data': dict((k.replace('_', '-'), v) for k, v in kwargs.iteritems()) }
@@ -139,9 +139,12 @@ class TestIncrementalBackup(iotests.QMPTestCase): def do_qmp_backup(self, error='Input/output error', **kwargs): res = self.vm.qmp('drive-backup', **kwargs) self.assert_qmp(res, 'return', {}) + return self.wait_qmp_backup(kwargs['device'], error) + + def wait_qmp_backup(self, device, error='Input/output error'): event = self.vm.event_wait(name="BLOCK_JOB_COMPLETED", - match={'data': {'device': kwargs['device']}}) + match={'data': {'device': device}}) self.assertNotEqual(event, None) try:
@@ -156,6 +159,12 @@ class TestIncrementalBackup(iotests.QMPTestCase): return False + def wait_qmp_backup_cancelled(self, device): + event = self.vm.event_wait(name='BLOCK_JOB_CANCELLED', + match={'data': {'device': device}}) + self.assertNotEqual(event, None) + + def create_anchor_backup(self, drive=None): if drive is None: drive = self.drives[-1]
@@ -375,6 +384,123 @@ class TestIncrementalBackup(iotests.QMPTestCase): self.check_backups() + def test_transaction_failure(self): + '''Test: Verify backups made from a transaction that partially fails. + + Add a second drive with its own unique pattern, and add a bitmap to each + drive. Use blkdebug to interfere with the backup on just one drive and + attempt to create a coherent incremental backup across both drives. + + verify a failure in one but not both, then delete the failed stubs and + re-run the same transaction. + + verify that both incrementals are created successfully. + ''' + + # Create a second drive, with pattern: + drive1 = self.add_node('drive1') + self.img_create(drive1['file'], drive1['fmt']) + io_write_patterns(drive1['file'], (('0x14', 0, 512), + ('0x5d', '1M', '32k'), + ('0xcd', '32M', '124k'))) + + # Create a blkdebug interface to this img as 'drive1' + result = self.vm.qmp('blockdev-add', options={ + 'id': drive1['id'], + 'driver': drive1['fmt'], + 'file': { + 'driver': 'blkdebug', + 'image': { + 'driver': 'file', + 'filename': drive1['file'] + }, + 'set-state': [{ + 'event': 'flush_to_disk', + 'state': 1, + 'new_state': 2 + }], + 'inject-error': [{ + 'event': 'read_aio', + 'errno': 5, + 'state': 2, + 'immediately': False, + 'once': True + }], + } + }) + self.assert_qmp(result, 'return', {}) + + # Create bitmaps and full backups for both drives + drive0 = self.drives[0] + dr0bm0 = self.add_bitmap('bitmap0', drive0) + dr1bm0 = self.add_bitmap('bitmap0', drive1) + self.create_anchor_backup(drive0) + self.create_anchor_backup(drive1) + self.assert_no_active_block_jobs() + self.assertFalse(self.vm.get_qmp_events(wait=False)) + + # Emulate some writes + self.hmp_io_writes(drive0['id'], (('0xab', 0, 512), + ('0xfe', '16M', '256k'), + ('0x64', '32736k', '64k'))) + self.hmp_io_writes(drive1['id'], (('0xba', 0, 512), + ('0xef', '16M', '256k'), + ('0x46', '32736k', '64k'))) + + # Create incremental backup targets + target0 = self.prepare_backup(dr0bm0) + target1 = self.prepare_backup(dr1bm0) + + # Ask for a new incremental backup per-each drive, + # expecting drive1's backup to fail: + transaction = [ + transaction_drive_backup(drive0['id'], target0, sync='incremental', + format=drive0['fmt'], mode='existing', + bitmap=dr0bm0.name, + transactional_cancel=True), + transaction_drive_backup(drive1['id'], target1, sync='incremental', + format=drive1['fmt'], mode='existing', + bitmap=dr1bm0.name, + transactional_cancel=True), + ] + result = self.vm.qmp('transaction', actions=transaction) + self.assert_qmp(result, 'return', {}) + + # Observe that drive0's backup is cancelled and drive1 completes with + # an error. + self.wait_qmp_backup_cancelled(drive0['id']) + self.assertFalse(self.wait_qmp_backup(drive1['id'])) + error = self.vm.event_wait('BLOCK_JOB_ERROR') + self.assert_qmp(error, 'data', {'device': drive1['id'], + 'action': 'report', + 'operation': 'read'}) + self.assertFalse(self.vm.get_qmp_events(wait=False)) + self.assert_no_active_block_jobs() + + # Delete drive0's successful target and eliminate our record of the + # unsuccessful drive1 target. Then re-run the same transaction. + dr0bm0.del_target() + dr1bm0.del_target() + target0 = self.prepare_backup(dr0bm0) + target1 = self.prepare_backup(dr1bm0) + + # Re-run the exact same transaction. + result = self.vm.qmp('transaction', actions=transaction) + self.assert_qmp(result, 'return', {}) + + # Both should complete successfully this time. + self.assertTrue(self.wait_qmp_backup(drive0['id'])) + self.assertTrue(self.wait_qmp_backup(drive1['id'])) + self.make_reference_backup(dr0bm0) + self.make_reference_backup(dr1bm0) + self.assertFalse(self.vm.get_qmp_events(wait=False)) + self.assert_no_active_block_jobs() + + # And the images should of course validate. + self.vm.shutdown() + self.check_backups() + + def test_sync_dirty_bitmap_missing(self): self.assert_no_active_block_jobs() self.files.append(self.err_img)
tests/qemu-iotests/124.out +2 -2
@@ -1,5 +1,5 @@ -........ +......... ---------------------------------------------------------------------- -Ran 8 tests +Ran 9 tests OK
Signature · 1 line
2.4.3
PATCH v2 9/10 qmp-commands.hx: Update the supported 'transaction' operations
In reply to Stefan HajnocziFrom: Kashyap Chamarthy <[email protected]>
Although the canonical source of reference for QMP commands is qapi-schema.json, for consistency's sake, update qmp-commands.hx to state the list of supported transactionable operations, namely:
drive-backup
blockdev-backup
blockdev-snapshot-internal-sync
abort
block-dirty-bitmap-add
block-dirty-bitmap-clear
--- qmp-commands.hx | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-)
qmp-commands.hx +16 -5
@@ -1238,11 +1238,22 @@ SQMP transaction ----------- -Atomically operate on one or more block devices. The only supported operations -for now are drive-backup, internal and external snapshotting. A list of -dictionaries is accepted, that contains the actions to be performed. -If there is any failure performing any of the operations, all operations -for the group are abandoned. +Atomically operate on one or more block devices. Operations that are +currently supported: + + - drive-backup + - blockdev-backup + - blockdev-snapshot-sync + - blockdev-snapshot-internal-sync + - abort + - block-dirty-bitmap-add + - block-dirty-bitmap-clear + +Refer to the qemu/qapi-schema.json file for minimum required QEMU +versions for these operations. A list of dictionaries is accepted, +that contains the actions to be performed. If there is any failure +performing any of the operations, all operations for the group are +abandoned. For external snapshots, the dictionary contains the device, the file to use for the new snapshot, and the format. The default format, if not specified, is
Signature · 1 line
2.4.3
PATCH v2 10/10 tests: add BlockJobTxn unit test
In reply to Stefan HajnocziThe BlockJobTxn unit test verifies that both single jobs and pairs of jobs behave as a transaction group. Either all jobs complete successfully or the group is cancelled.
---
v2:
* Test fail/cancel race condition [jsnow]
* Use new 'transactional-cancel' QMP argument
--- tests/Makefile | 3 + tests/test-blockjob-txn.c | 233 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 236 insertions(+) create mode 100644 tests/test-blockjob-txn.c
tests/Makefile +3 -0
@@ -45,6 +45,8 @@ check-unit-y += tests/test-thread-pool$(EXESUF) gcov-files-test-thread-pool-y = thread-pool.c gcov-files-test-hbitmap-y = util/hbitmap.c check-unit-y += tests/test-hbitmap$(EXESUF) +gcov-files-test-hbitmap-y = blockjob.c +check-unit-y += tests/test-blockjob-txn$(EXESUF) check-unit-y += tests/test-x86-cpuid$(EXESUF) # all code tested by test-x86-cpuid is inside topology.h gcov-files-test-x86-cpuid-y =
@@ -283,6 +285,7 @@ tests/test-coroutine$(EXESUF): tests/test-coroutine.o $(block-obj-y) libqemuutil tests/test-aio$(EXESUF): tests/test-aio.o $(block-obj-y) libqemuutil.a libqemustub.a tests/test-rfifolock$(EXESUF): tests/test-rfifolock.o libqemuutil.a libqemustub.a tests/test-throttle$(EXESUF): tests/test-throttle.o $(block-obj-y) libqemuutil.a libqemustub.a +tests/test-blockjob-txn$(EXESUF): tests/test-blockjob-txn.o $(block-obj-y) libqemuutil.a libqemustub.a tests/test-thread-pool$(EXESUF): tests/test-thread-pool.o $(block-obj-y) libqemuutil.a libqemustub.a tests/test-iov$(EXESUF): tests/test-iov.o libqemuutil.a tests/test-hbitmap$(EXESUF): tests/test-hbitmap.o libqemuutil.a libqemustub.a
tests/test-blockjob-txn.c new file +233 -0
233 lines not on this page · raw message
Signature · 1 line
2.4.3