[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PULL 18/31] block/core: add generic infrastructure for x-blockdev-a
From: |
Peter Maydell |
Subject: |
Re: [PULL 18/31] block/core: add generic infrastructure for x-blockdev-amend qmp command |
Date: |
Thu, 9 Jul 2020 16:09:29 +0100 |
On Mon, 6 Jul 2020 at 11:05, Max Reitz <mreitz@redhat.com> wrote:
>
> From: Maxim Levitsky <mlevitsk@redhat.com>
>
> blockdev-amend will be used similiar to blockdev-create
> to allow on the fly changes of the structure of the format based block
> devices.
>
> Current plan is to first support encryption keyslot management for luks
> based formats (raw and embedded in qcow2)
>
> Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
> Message-Id: <20200608094030.670121-12-mlevitsk@redhat.com>
> Signed-off-by: Max Reitz <mreitz@redhat.com>
Hi; Coverity reports a possible issue with this function
(CID 1430268):
> +void qmp_x_blockdev_amend(const char *job_id,
> + const char *node_name,
> + BlockdevAmendOptions *options,
> + bool has_force,
> + bool force,
> + Error **errp)
> +{
> + BlockdevAmendJob *s;
> + const char *fmt = BlockdevDriver_str(options->driver);
> + BlockDriver *drv = bdrv_find_format(fmt);
> + BlockDriverState *bs = bdrv_find_node(node_name);
bdrv_find_node() can return NULL (we check for this
in almost all callsites)...
> + if (bs->drv != drv) {
...but here we dereference it unconditionally.
> + error_setg(errp,
> + "x-blockdev-amend doesn't support changing the block
> driver");
> + return;
> + }
thanks
-- PMM
- [PULL 06/31] iotests.py: Add qemu_img_pipe_and_status(), (continued)
- [PULL 06/31] iotests.py: Add qemu_img_pipe_and_status(), Max Reitz, 2020/07/06
- [PULL 09/31] qcrypto/core: add generic infrastructure for crypto options amendment, Max Reitz, 2020/07/06
- [PULL 10/31] qcrypto/luks: implement encryption key management, Max Reitz, 2020/07/06
- [PULL 11/31] block/amend: add 'force' option, Max Reitz, 2020/07/06
- [PULL 12/31] block/amend: separate amend and create options for qemu-img, Max Reitz, 2020/07/06
- [PULL 14/31] block/crypto: rename two functions, Max Reitz, 2020/07/06
- [PULL 13/31] block/amend: refactor qcow2 amend options, Max Reitz, 2020/07/06
- [PULL 15/31] block/crypto: implement the encryption key management, Max Reitz, 2020/07/06
- [PULL 16/31] block/qcow2: extend qemu-img amend interface with crypto options, Max Reitz, 2020/07/06
- [PULL 18/31] block/core: add generic infrastructure for x-blockdev-amend qmp command, Max Reitz, 2020/07/06
- Re: [PULL 18/31] block/core: add generic infrastructure for x-blockdev-amend qmp command,
Peter Maydell <=
- [PULL 20/31] block/qcow2: implement blockdev-amend, Max Reitz, 2020/07/06
- [PULL 17/31] iotests: qemu-img tests for luks key management, Max Reitz, 2020/07/06
- [PULL 19/31] block/crypto: implement blockdev-amend, Max Reitz, 2020/07/06
- [PULL 22/31] qemu-img: convert: don't use unallocated_blocks_are_zero, Max Reitz, 2020/07/06
- [PULL 21/31] iotests: add tests for blockdev-amend, Max Reitz, 2020/07/06
- [PULL 23/31] block: inline bdrv_unallocated_blocks_are_zero(), Max Reitz, 2020/07/06
- [PULL 24/31] block/vdi: return ZERO block-status when appropriate, Max Reitz, 2020/07/06
- [PULL 26/31] block/crypto: drop unallocated_blocks_are_zero, Max Reitz, 2020/07/06
- [PULL 27/31] block/iscsi: drop unallocated_blocks_are_zero, Max Reitz, 2020/07/06