[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH 11/18] nbd: BLOCK_STATUS for bitmap export: serv
From: |
Denis V. Lunev |
Subject: |
Re: [Qemu-block] [PATCH 11/18] nbd: BLOCK_STATUS for bitmap export: server part |
Date: |
Thu, 16 Feb 2017 16:00:15 +0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 |
On 02/03/2017 06:47 PM, Vladimir Sementsov-Ogievskiy wrote:
> Only one meta context type is defined: qemu-bitmap:<bitmap-name>.
> Maximum one query is allowed for NBD_OPT_{SET,LIST}_META_CONTEXT,
> NBD_REP_ERR_TOO_BIG is returned otherwise.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
...
> +static int nbd_negotiate_opt_meta_context_start(NBDClient *client, uint32_t
> opt,
> + uint32_t length,
> + uint32_t *nb_queries,
> + BlockDriverState **bs)
> +{
> + int ret;
> + NBDExport *exp;
> + char *export_name;
> + int nb_read = 0;
> +
> + if (!client->structured_reply) {
> + uint32_t tail = length - nb_read;
> + LOG("Structured reply is not negotiated");
> +
> + if (nbd_negotiate_drop_sync(client->ioc, tail) != tail) {
> + return -EIO;
> + }
> + ret = nbd_negotiate_send_rep_err(client->ioc, NBD_REP_ERR_INVALID,
> opt,
> + "Structured reply is not
> negotiated");
> + g_free(export_name);
export_name is not initialized here! for me there is no need to free
anything here
> +
> + if (ret < 0) {
> + return ret;
> + } else {
> + *bs = NULL;
> + *nb_queries = 0;
> + return length;
> + }
> + }
> +
> + nb_read = nbd_negotiate_read_size_string(client->ioc, &export_name,
> + NBD_MAX_NAME_SIZE);
> + if (nb_read < 0) {
> + return nb_read;
> + }
> +
> + exp = nbd_export_find(export_name);
> + if (exp == NULL) {
> + uint32_t tail = length - nb_read;
> + LOG("export '%s' is not found", export_name);
> +
> + if (nbd_negotiate_drop_sync(client->ioc, tail) != tail) {
export_name is leaked on this path
> + return -EIO;
> + }
> + ret = nbd_negotiate_send_rep_err(client->ioc, NBD_REP_ERR_INVALID,
> opt,
> + "export '%s' is not found",
> + export_name);
> + g_free(export_name);
> +
- Re: [Qemu-block] [PATCH 01/18] nbd: rename NBD_REPLY_MAGIC to NBD_SIMPLE_REPLY_MAGIC, (continued)
- [Qemu-block] [PATCH 04/18] nbd/client: refactor nbd_receive_starttls, Vladimir Sementsov-Ogievskiy, 2017/02/03
- Re: [Qemu-block] [PATCH 04/18] nbd/client: refactor nbd_receive_starttls, Eric Blake, 2017/02/07
- Re: [Qemu-block] [PATCH 04/18] nbd/client: refactor nbd_receive_starttls, Vladimir Sementsov-Ogievskiy, 2017/02/09
- Re: [Qemu-block] [PATCH 04/18] nbd/client: refactor nbd_receive_starttls, Eric Blake, 2017/02/09
- Re: [Qemu-block] [PATCH 04/18] nbd/client: refactor nbd_receive_starttls, Vladimir Sementsov-Ogievskiy, 2017/02/10
- Re: [Qemu-block] [PATCH 04/18] nbd/client: refactor nbd_receive_starttls, Eric Blake, 2017/02/13
- Re: [Qemu-block] [Qemu-devel] [PATCH 04/18] nbd/client: refactor nbd_receive_starttls, Eric Blake, 2017/02/20
[Qemu-block] [PATCH 11/18] nbd: BLOCK_STATUS for bitmap export: server part, Vladimir Sementsov-Ogievskiy, 2017/02/03
[Qemu-block] [PATCH 07/18] nbd: Minimal structured read for client, Vladimir Sementsov-Ogievskiy, 2017/02/03
[Qemu-block] [PATCH 09/18] block/dirty-bitmap: add bdrv_dirty_bitmap_next(), Vladimir Sementsov-Ogievskiy, 2017/02/03
[Qemu-block] [PATCH 17/18] nbd: BLOCK_STATUS for standard get_block_status function: server part, Vladimir Sementsov-Ogievskiy, 2017/02/03
[Qemu-block] [PATCH 14/18] qmp: add x-debug-block-dirty-bitmap-sha256, Vladimir Sementsov-Ogievskiy, 2017/02/03
[Qemu-block] [PATCH 03/18] nbd: Minimal structured read for server, Vladimir Sementsov-Ogievskiy, 2017/02/03