mirror of https://gitee.com/openkylin/qemu.git
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1 iQEcBAABAgAGBQJVAeRmAAoJEJykq7OBq3PIL7UH/3Og5WOPQg92h0BoXyJlYjs5 VWu/3y7rhp83IXi+jn7FwWc/1JcRiR5ztOhZvOx+jVRq2cpdJ3iEKrMvKVIaFUQw BaoEq4mGgjMnY7bEuSHZeSs1K54hI6NvVYj/qMB0+rIDBYhPceuUUjx/ujM1aQt6 3R93vzA32OgNfWCZNPsVOkRwNSA8sqiipG1abdzEbq/yOScTYKv/M7a3fNEoIABu NukvZkuZBRKUlBgDzOa4dHOJ3dhWE1g6yz8kdQT6BzUdAwmzrPgeRILJZjZ/YkDw Bo2bvMV9jkSf6BCix+TYSWBLk3JvBrZ5agD0n+bMmmtj4DZh9ySMnqc9tXkKuPU= =+ZKs -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging # gpg: Signature made Thu Mar 12 19:09:26 2015 GMT using RSA key ID 81AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" * remotes/stefanha/tags/block-pull-request: qcow2: fix the macro QCOW_MAX_L1_SIZE's use queue: fix QSLIST_INSERT_HEAD_ATOMIC race Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
f9f141b747
|
@ -702,7 +702,7 @@ int qcow2_snapshot_load_tmp(BlockDriverState *bs,
|
|||
sn = &s->snapshots[snapshot_index];
|
||||
|
||||
/* Allocate and read in the snapshot's L1 table */
|
||||
if (sn->l1_size > QCOW_MAX_L1_SIZE) {
|
||||
if (sn->l1_size > QCOW_MAX_L1_SIZE / sizeof(uint64_t)) {
|
||||
error_setg(errp, "Snapshot L1 table too large");
|
||||
return -EFBIG;
|
||||
}
|
||||
|
|
|
@ -742,7 +742,7 @@ static int qcow2_open(BlockDriverState *bs, QDict *options, int flags,
|
|||
}
|
||||
|
||||
/* read the level 1 table */
|
||||
if (header.l1_size > QCOW_MAX_L1_SIZE) {
|
||||
if (header.l1_size > QCOW_MAX_L1_SIZE / sizeof(uint64_t)) {
|
||||
error_setg(errp, "Active L1 table too large");
|
||||
ret = -EFBIG;
|
||||
goto fail;
|
||||
|
|
|
@ -197,11 +197,12 @@ struct { \
|
|||
(head)->slh_first = (elm); \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define QSLIST_INSERT_HEAD_ATOMIC(head, elm, field) do { \
|
||||
do { \
|
||||
(elm)->field.sle_next = (head)->slh_first; \
|
||||
} while (atomic_cmpxchg(&(head)->slh_first, (elm)->field.sle_next, \
|
||||
(elm)) != (elm)->field.sle_next); \
|
||||
#define QSLIST_INSERT_HEAD_ATOMIC(head, elm, field) do { \
|
||||
typeof(elm) save_sle_next; \
|
||||
do { \
|
||||
save_sle_next = (elm)->field.sle_next = (head)->slh_first; \
|
||||
} while (atomic_cmpxchg(&(head)->slh_first, save_sle_next, (elm)) != \
|
||||
save_sle_next); \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define QSLIST_MOVE_ATOMIC(dest, src) do { \
|
||||
|
|
Loading…
Reference in New Issue