[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC 5/9] block: add block job transactions
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [RFC 5/9] block: add block job transactions |
Date: |
Thu, 25 Jun 2015 13:50:01 +0100 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Wed, Jun 24, 2015 at 08:37:43PM +0200, Max Reitz wrote:
> On 12.06.2015 12:09, Stefan Hajnoczi wrote:
> >+void block_job_txn_add_job(BlockJobTxn *txn, BlockJob *job)
> >+{
> >+ if (!txn) {
> >+ return;
> >+ }
>
> Do you plan on making use of this case? I'm asking because while I'm usually
> in favor of handling everything gracefully as long as it's easy to
> implement, here I can't think of a case where using NULL with this function
> makes sense, that is to me it would seem like the caller made some bad
> mistake. This in turn would mean that dereferencing a NULL pointer or
> failing an assertion were preferable to hiding that mistake.
>
> Other than this small thing and that it doesn't compile (until patch 7, I
> presume), looks good.
Yes. It is used by backup_start(), which may be called with txn == NULL
by do_drive_backup() from qmp_drive_backup().
It means that blockjob code never needs to check whether it is running
inside a transaction or not. Blockjob code always calls add_job() and
prepare_to_complete() regardless.
Stefan
pgpEDBj3UlJv3.pgp
Description: PGP signature
- [Qemu-devel] [RFC 1/9] qapi: Add transaction support to block-dirty-bitmap operations, (continued)
- [Qemu-devel] [RFC 1/9] qapi: Add transaction support to block-dirty-bitmap operations, Stefan Hajnoczi, 2015/06/12
- [Qemu-devel] [RFC 2/9] iotests: add transactional incremental backup test, Stefan Hajnoczi, 2015/06/12
- [Qemu-devel] [RFC 3/9] block: rename BlkTransactionState and BdrvActionOps, Stefan Hajnoczi, 2015/06/12
- [Qemu-devel] [RFC 4/9] block: keep bitmap if incremental backup job is cancelled, Stefan Hajnoczi, 2015/06/12
- [Qemu-devel] [RFC 5/9] block: add block job transactions, Stefan Hajnoczi, 2015/06/12
- [Qemu-devel] [RFC 6/9] blockdev: make BlockJobTxn available to qmp 'transaction', Stefan Hajnoczi, 2015/06/12
- [Qemu-devel] [RFC 7/9] block/backup: support block job transactions, Stefan Hajnoczi, 2015/06/12
- [Qemu-devel] [RFC 8/9] iotests: 124 - transactional failure test, Stefan Hajnoczi, 2015/06/12
- [Qemu-devel] [RFC 9/9] qmp-commands.hx: Update the supported 'transaction' operations, Stefan Hajnoczi, 2015/06/12