qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: Eric Blake <eblake@redhat.com>,
	Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"qemu-block@nongnu.org" <qemu-block@nongnu.org>
Cc: "kwolf@redhat.com" <kwolf@redhat.com>,
	"fam@euphon.net" <fam@euphon.net>,
	Denis Lunev <den@virtuozzo.com>,
	"armbru@redhat.com" <armbru@redhat.com>,
	"dgilbert@redhat.com" <dgilbert@redhat.com>,
	"stefanha@redhat.com" <stefanha@redhat.com>,
	"mreitz@redhat.com" <mreitz@redhat.com>,
	"jsnow@redhat.com" <jsnow@redhat.com>
Subject: Re: [PATCH 4/6] qemu-nbd: add compression flag support
Date: Wed, 2 Oct 2019 10:29:50 +0000	[thread overview]
Message-ID: <9a1c32f9-811a-d286-440e-a66bd64b3889@virtuozzo.com> (raw)
In-Reply-To: <4afd7d6c-7e38-c325-b009-c798186715bd@redhat.com>

01.10.2019 23:47, Eric Blake wrote:
> On 10/1/19 2:27 PM, Andrey Shinkevich wrote:
>> Added possibility to write compressed data by using the
>> blk_write_compressed. This action has the limitations of the format
>> driver. For example we can't write compressed data over other.
>>
> 
>> +++ b/blockdev-nbd.c
>> @@ -191,7 +191,7 @@ void qmp_nbd_server_add(const char *device, bool has_name, const char *name,
>>       }
>>       exp = nbd_export_new(bs, 0, len, name, NULL, bitmap, !writable, !writable,
>> -                         NULL, false, on_eject_blk, errp);
>> +                         0, NULL, false, on_eject_blk, errp);
> 
> This is a lot of parameters.  Should we be combining some of them into a struct, or even at least the booleans into a flags parameter?
> 
> 
>> +++ b/include/block/nbd.h
>> @@ -25,6 +25,10 @@
>>   #include "crypto/tlscreds.h"
>>   #include "qapi/error.h"
>> +enum {
>> +  NBD_INTERNAL_FLAG_COMPRESS = 1 << 1, /* Use write compressed */
>> +};
> 
> What happened to flag 1 << 0?  What other flags do you anticipate adding?

Hmm, any way, creating flags parameter for only one flag seems useless.

I think, I'd prefer to cover all nbd_export_new parameters to a structure
with boolean fields, to avoid extra &/| arithmetic.

nbd_export_new is called from qmp_nbd_server_add and qemu-nbd main(), and
both places seems to benefit, if they will fill structure instead of local
variables.

-- 
Best regards,
Vladimir

  reply	other threads:[~2019-10-02 10:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-01 19:27 [PATCH 0/6] qcow2: advanced compression options Andrey Shinkevich
2019-10-01 19:27 ` [PATCH 1/6] qcow2: multiple clusters write compressed Andrey Shinkevich
2019-10-01 19:27 ` [PATCH 2/6] tests/qemu-iotests: add case of writing compressed data to multiple clusters Andrey Shinkevich
2019-10-01 19:27 ` [PATCH 3/6] block: support compressed write for copy-on-read Andrey Shinkevich
2019-10-01 19:27 ` [PATCH 4/6] qemu-nbd: add compression flag support Andrey Shinkevich
2019-10-01 20:47   ` Eric Blake
2019-10-02 10:29     ` Vladimir Sementsov-Ogievskiy [this message]
2019-10-01 19:27 ` [PATCH 5/6] block-stream: add compress option Andrey Shinkevich
2019-10-01 20:50   ` Eric Blake
2019-10-01 19:27 ` [PATCH 6/6] tests/qemu-iotests: add case for block-stream compress Andrey Shinkevich
2019-10-02  2:23 ` [PATCH 0/6] qcow2: advanced compression options no-reply
2019-10-02  2:25 ` no-reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9a1c32f9-811a-d286-440e-a66bd64b3889@virtuozzo.com \
    --to=vsementsov@virtuozzo.com \
    --cc=andrey.shinkevich@virtuozzo.com \
    --cc=armbru@redhat.com \
    --cc=den@virtuozzo.com \
    --cc=dgilbert@redhat.com \
    --cc=eblake@redhat.com \
    --cc=fam@euphon.net \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).