qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: "jsnow@redhat.com" <jsnow@redhat.com>,
	"qemu-block@nongnu.org" <qemu-block@nongnu.org>,
	Kevin Wolf <kwolf@redhat.com>, Max Reitz <mreitz@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 5/6] nbd: Merge nbd_export_bitmap into nbd_export_new
Date: Thu, 10 Jan 2019 08:48:21 -0600	[thread overview]
Message-ID: <fe413449-64d3-e5e8-919d-7140a6d65c84@redhat.com> (raw)
In-Reply-To: <246062a9-2674-00e7-33ac-709c610efad6@virtuozzo.com>

[-- Attachment #1: Type: text/plain, Size: 1677 bytes --]

On 1/10/19 6:25 AM, Vladimir Sementsov-Ogievskiy wrote:
> 10.01.2019 10:13, Eric Blake wrote:
>> We only have one caller that wants to export a bitmap name,
>> which it does right after creation of the export. But there is
>> still a brief window of time where an NBD client could see the
>> export but not the dirty bitmap, which a robust client would
>> have to interpret as meaning the entire image should be treated
>> as dirty.  Better is to eliminate the window entirely, by
>> inlining nbd_export_bitmap() into nbd_export_new(), and refusing
>> to create the bitmap in the first place if the requested bitmap
>> can't be located.
>>
>> We also no longer need logic for setting a different bitmap
>> name compared to the bitmap being exported.
>>

>> +++ b/blockdev-nbd.c
>> @@ -175,7 +175,7 @@ void qmp_nbd_server_add(const char *device, bool has_name, const char *name,
>>           writable = false;
>>       }
>>
>> -    exp = nbd_export_new(bs, 0, -1, name, NULL,
>> +    exp = nbd_export_new(bs, 0, -1, name, NULL, bitmap,
> 
> bitmap is guaranteed to be NULL if has_bitmap is false? Or should we do has_bitmap ? bitmap : NULL?

We fixed our QAPI generators to guarantee that has_foo = false implies
foo == NULL, several years ago.  If you populate a QAPI struct by hand
instead of via the generated visitors, you should use g_malloc0() to
match the same guarantees.  So I don't need the ?:.

> 
> if yes or with fixed:
> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> 
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2019-01-10 14:48 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-10  7:13 [Qemu-devel] [PATCH v2 0/6] Promote x-nbd-server-add-bitmap to stable Eric Blake
2019-01-10  7:13 ` [Qemu-devel] [PATCH v2 1/6] nbd: Only require disabled bitmap for read-only exports Eric Blake
2019-01-10 10:27   ` Vladimir Sementsov-Ogievskiy
2019-01-10 14:38     ` Eric Blake
2019-01-10 14:51       ` Vladimir Sementsov-Ogievskiy
2019-01-10  7:13 ` [Qemu-devel] [PATCH v2 2/6] nbd: Merge nbd_export_set_name into nbd_export_new Eric Blake
2019-01-10 10:40   ` Vladimir Sementsov-Ogievskiy
2019-01-10 14:44     ` Eric Blake
2019-01-10 15:12       ` Vladimir Sementsov-Ogievskiy
2019-01-10  7:13 ` [Qemu-devel] [PATCH v2 3/6] nbd: Allow bitmap export during QMP nbd-server-add Eric Blake
2019-01-10 12:00   ` Vladimir Sementsov-Ogievskiy
2019-01-10 12:02   ` Vladimir Sementsov-Ogievskiy
2019-01-10 15:11     ` Nikolay Shirokovskiy
2019-01-10 22:29       ` Eric Blake
2019-01-10  7:13 ` [Qemu-devel] [PATCH v2 4/6] nbd: Remove x-nbd-server-add-bitmap Eric Blake
2019-01-10 12:08   ` Vladimir Sementsov-Ogievskiy
2019-01-10  7:13 ` [Qemu-devel] [PATCH v2 5/6] nbd: Merge nbd_export_bitmap into nbd_export_new Eric Blake
2019-01-10 12:25   ` Vladimir Sementsov-Ogievskiy
2019-01-10 14:48     ` Eric Blake [this message]
2019-01-10  7:13 ` [Qemu-devel] [PATCH v2 6/6] qemu-nbd: Add --bitmap=NAME option Eric Blake

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=fe413449-64d3-e5e8-919d-7140a6d65c84@redhat.com \
    --to=eblake@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=vsementsov@virtuozzo.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).