]> git.proxmox.com Git - mirror_qemu.git/commit
blkdebug: Refactor error injection
authorEric Blake <eblake@redhat.com>
Sat, 29 Apr 2017 19:14:15 +0000 (14:14 -0500)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Thu, 3 Aug 2017 21:01:08 +0000 (16:01 -0500)
commit138cf638bae7b42fe8d616636585050d88568604
treeefea5dd792eb34165e7608dbc129e7d188190f3c
parenta1a3d603c4484ff06b4338e73713bdea8f298b45
blkdebug: Refactor error injection

Rather than repeat the logic at each caller of checking if a Rule
exists that warrants an error injection, fold that logic into
inject_error(); and rename it to rule_check() for legibility.
This will help the next patch, which adds two more callers that
need to check rules for the potential of injecting errors.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 20170429191419.30051-6-eblake@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
(cherry picked from commit d157ed5f7235f3d2d5596a514ad7507b18e24b88)
* prereq for 81c219a
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
block/blkdebug.c