From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: pannengyuan <pannengyuan@huawei.com>,
"eblake@redhat.com" <eblake@redhat.com>,
"kwolf@redhat.com" <kwolf@redhat.com>,
"mreitz@redhat.com" <mreitz@redhat.com>,
"sgarzare@redhat.com" <sgarzare@redhat.com>
Cc: "liyiting@huawei.com" <liyiting@huawei.com>,
"kuhn.chenqun@huawei.com" <kuhn.chenqun@huawei.com>,
"zhang.zhanghailiang@huawei.com" <zhang.zhanghailiang@huawei.com>,
"qemu-block@nongnu.org" <qemu-block@nongnu.org>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [PATCH V3 1/2] block/nbd: extract the common cleanup code
Date: Wed, 4 Dec 2019 07:19:01 +0000 [thread overview]
Message-ID: <08870274-7a29-26ec-e057-b796d11eac4d@virtuozzo.com> (raw)
In-Reply-To: <7d06d51d-12a5-03e1-d695-8f4faf754bec@huawei.com>
04.12.2019 6:12, pannengyuan wrote:
>
>
> On 2019/12/4 1:38, Vladimir Sementsov-Ogievskiy wrote:
>> Hi!
>>
>> First, please, when sending more than one patch, create a cover-letter. Also,
>> summarize (in cover letter) what was changed since previous version.
> In previous version, I only send one patch(2/2 in this version), so I
> only add a change summarize in 2/2 patch in this version. should I add a
> summarize in 1/2 patch too if 1/2 patch is a new one?
Yes, something simple like:
01: new patch
02: rebased on 01
(also, If you didn't read https://wiki.qemu.org/Contribute/SubmitAPatch, do it)
>
>>
>> 29.11.2019 10:25, pannengyuan@huawei.com wrote:
>>> From: PanNengyuan <pannengyuan@huawei.com>
>>
>> Strange line. Check you git preferences. Such line appears (and make sense)
>> when you are sending patches authored by someone else.. But here is your name,
>> the same as in email's From:.
>
> Thanks for your reminding. I will correct it in next version.
>
>>
>>>
>>> The BDRVNBDState cleanup code is common in two places, add
>>> nbd_free_bdrvstate_prop() function to do these cleanups (suggested by
>>> Stefano Garzarella).
>>>
>>> Signed-off-by: PanNengyuan <pannengyuan@huawei.com>
>>
>> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
>>
>>> ---
>>> block/nbd.c | 23 +++++++++++++----------
>>> 1 file changed, 13 insertions(+), 10 deletions(-)
>>>
>>> diff --git a/block/nbd.c b/block/nbd.c
>>> index 1239761..5805979 100644
>>> --- a/block/nbd.c
>>> +++ b/block/nbd.c
>>> @@ -94,6 +94,8 @@ typedef struct BDRVNBDState {
>>>
>>> static int nbd_client_connect(BlockDriverState *bs, Error **errp);
>>>
>>> +static void nbd_free_bdrvstate_prop(BDRVNBDState *s);
>>> +
>>> static void nbd_channel_error(BDRVNBDState *s, int ret)
>>> {
>>> if (ret == -EIO) {
>>> @@ -1486,6 +1488,15 @@ static int nbd_client_connect(BlockDriverState *bs, Error **errp)
>>> }
>>> }
>>>
>>> +static void nbd_free_bdrvstate_prop(BDRVNBDState *s)
>>> +{
>>> + object_unref(OBJECT(s->tlscreds));
>>> + qapi_free_SocketAddress(s->saddr);
>>> + g_free(s->export);
>>> + g_free(s->tlscredsid);
>>> + g_free(s->x_dirty_bitmap);
>>> +}
>>> +
>>> /*
>>> * Parse nbd_open options
>>> */
>>> @@ -1855,10 +1866,7 @@ static int nbd_process_options(BlockDriverState *bs, QDict *options,
>>>
>>> error:
>>> if (ret < 0) {
>>> - object_unref(OBJECT(s->tlscreds));
>>> - qapi_free_SocketAddress(s->saddr);
>>> - g_free(s->export);
>>> - g_free(s->tlscredsid);
>>> + nbd_free_bdrvstate_prop(s);
>>> }
>>> qemu_opts_del(opts);
>>> return ret;
>>> @@ -1937,12 +1945,7 @@ static void nbd_close(BlockDriverState *bs)
>>> BDRVNBDState *s = bs->opaque;
>>>
>>> nbd_client_close(bs);
>>> -
>>> - object_unref(OBJECT(s->tlscreds));
>>> - qapi_free_SocketAddress(s->saddr);
>>> - g_free(s->export);
>>> - g_free(s->tlscredsid);
>>> - g_free(s->x_dirty_bitmap);
>>> + nbd_free_bdrvstate_prop(s);
>>> }
>>>
>>> static int64_t nbd_getlength(BlockDriverState *bs)
>>>
>>
>>
>
--
Best regards,
Vladimir
next prev parent reply other threads:[~2019-12-04 7:45 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-29 7:25 [PATCH V3 1/2] block/nbd: extract the common cleanup code pannengyuan
2019-11-29 7:25 ` [PATCH V3 2/2] block/nbd: fix memory leak in nbd_open() pannengyuan
2019-12-03 17:52 ` for 4.2 ??? " Vladimir Sementsov-Ogievskiy
2019-12-03 18:54 ` Eric Blake
2019-12-03 21:59 ` Eric Blake
2019-12-04 3:30 ` pannengyuan
2019-12-03 17:38 ` [PATCH V3 1/2] block/nbd: extract the common cleanup code Vladimir Sementsov-Ogievskiy
2019-12-04 3:12 ` pannengyuan
2019-12-04 7:19 ` Vladimir Sementsov-Ogievskiy [this message]
2019-12-04 7:24 ` Pan Nengyuan
2019-12-03 19:00 ` Eric Blake
2019-12-04 3:20 ` pannengyuan
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=08870274-7a29-26ec-e057-b796d11eac4d@virtuozzo.com \
--to=vsementsov@virtuozzo.com \
--cc=eblake@redhat.com \
--cc=kuhn.chenqun@huawei.com \
--cc=kwolf@redhat.com \
--cc=liyiting@huawei.com \
--cc=mreitz@redhat.com \
--cc=pannengyuan@huawei.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=sgarzare@redhat.com \
--cc=zhang.zhanghailiang@huawei.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).