[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v6 4/6] block: convert ThrottleGroup to object w
From: |
Alberto Garcia |
Subject: |
Re: [Qemu-devel] [PATCH v6 4/6] block: convert ThrottleGroup to object with QOM |
Date: |
Mon, 21 Aug 2017 14:54:24 +0200 |
User-agent: |
Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu) |
On Mon 21 Aug 2017 11:31:48 AM CEST, Manos Pitsidianakis wrote:
> + switch (info->data_type) {
> + case UINT64:
> + {
> + uint64_t *field = (void *)&cfg.buckets[info->type] +
> info->offset;
> + *field = value;
> + }
> + break;
The rest of the patch looks good, but I still think that these pointer
casts here are a bad idea (plus, pointer arithmetic is not allowed on
void pointers).
If the field ever becomes a 32-bit integer you'd be overwriting someone
else's memory.
Berto
- [Qemu-devel] [PATCH v6 0/6] add throttle block driver filter, Manos Pitsidianakis, 2017/08/21
- [Qemu-devel] [PATCH v6 6/6] qemu-iotests: add 184 for throttle filter driver, Manos Pitsidianakis, 2017/08/21
- [Qemu-devel] [PATCH v6 2/6] block: add aio_context field in ThrottleGroupMember, Manos Pitsidianakis, 2017/08/21
- [Qemu-devel] [PATCH v6 4/6] block: convert ThrottleGroup to object with QOM, Manos Pitsidianakis, 2017/08/21
- Re: [Qemu-devel] [PATCH v6 4/6] block: convert ThrottleGroup to object with QOM,
Alberto Garcia <=
- [Qemu-devel] [PATCH v6 1/6] block: move ThrottleGroup membership to ThrottleGroupMember, Manos Pitsidianakis, 2017/08/21
- [Qemu-devel] [PATCH v6 5/6] block: add throttle block filter driver, Manos Pitsidianakis, 2017/08/21
- [Qemu-devel] [PATCH v6 3/6] block: tidy ThrottleGroupMember initializations, Manos Pitsidianakis, 2017/08/21