aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2015-11-18 17:07:24 +0000
committerPeter Maydell <peter.maydell@linaro.org>2015-11-18 17:07:24 +0000
commit8f280309030331a912fd8924c129d8bd59e1bdc7 (patch)
tree782e835f9f3cc152c3a868746108df551e38f62a
parent7199c89d8c6bbd0eda2cadb0d3fc7149934202bf (diff)
parentca4fa82fe66076284f702adcfe7c319ebbf909ec (diff)
downloadqemu-8f280309030331a912fd8924c129d8bd59e1bdc7.zip
qemu-8f280309030331a912fd8924c129d8bd59e1bdc7.tar.gz
qemu-8f280309030331a912fd8924c129d8bd59e1bdc7.tar.bz2
Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
Block layer patches # gpg: Signature made Wed 18 Nov 2015 15:28:32 GMT using RSA key ID C88F2FD6 # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" * remotes/kevin/tags/for-upstream: block: Call external_snapshot_clean after blockdev-snapshot blockdev: Add missing bdrv_unref() in drive-backup iotests: fix race in 030 nand: fix address overflow Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--blockdev.c2
-rw-r--r--hw/block/nand.c4
-rwxr-xr-xtests/qemu-iotests/0305
3 files changed, 8 insertions, 3 deletions
diff --git a/blockdev.c b/blockdev.c
index 917ae06..313841b 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -2098,6 +2098,7 @@ static const BlkActionOps actions[] = {
.prepare = external_snapshot_prepare,
.commit = external_snapshot_commit,
.abort = external_snapshot_abort,
+ .clean = external_snapshot_clean,
},
[TRANSACTION_ACTION_KIND_BLOCKDEV_SNAPSHOT_SYNC] = {
.instance_size = sizeof(ExternalSnapshotState),
@@ -3171,6 +3172,7 @@ static void do_drive_backup(const char *device, const char *target,
bmap = bdrv_find_dirty_bitmap(bs, bitmap);
if (!bmap) {
error_setg(errp, "Bitmap '%s' could not be found", bitmap);
+ bdrv_unref(target_bs);
goto out;
}
}
diff --git a/hw/block/nand.c b/hw/block/nand.c
index 61d2cec..a68266f 100644
--- a/hw/block/nand.c
+++ b/hw/block/nand.c
@@ -522,8 +522,8 @@ void nand_setio(DeviceState *dev, uint32_t value)
if (s->ale) {
unsigned int shift = s->addrlen * 8;
- unsigned int mask = ~(0xff << shift);
- unsigned int v = value << shift;
+ uint64_t mask = ~(0xffull << shift);
+ uint64_t v = (uint64_t)value << shift;
s->addr = (s->addr & mask) | v;
s->addrlen ++;
diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030
index 952a524..32469ef 100755
--- a/tests/qemu-iotests/030
+++ b/tests/qemu-iotests/030
@@ -245,6 +245,7 @@ class TestEIO(TestErrors):
while not completed:
for event in self.vm.get_qmp_events(wait=True):
if event['event'] == 'BLOCK_JOB_ERROR':
+ error = True
self.assert_qmp(event, 'data/device', 'drive0')
self.assert_qmp(event, 'data/operation', 'read')
@@ -257,9 +258,11 @@ class TestEIO(TestErrors):
self.assert_qmp(result, 'return', {})
result = self.vm.qmp('query-block-jobs')
+ if result == {'return': []}:
+ # Race; likely already finished. Check.
+ continue
self.assert_qmp(result, 'return[0]/paused', False)
self.assert_qmp(result, 'return[0]/io-status', 'ok')
- error = True
elif event['event'] == 'BLOCK_JOB_COMPLETED':
self.assertTrue(error, 'job completed unexpectedly')
self.assert_qmp(event, 'data/type', 'stream')