From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: Alberto Garcia <berto@igalia.com>, qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, mreitz@redhat.com, kwolf@redhat.com
Subject: Re: [PATCH v2 4/5] block: simplify bdrv_child_user_desc()
Date: Mon, 10 May 2021 18:35:34 +0300 [thread overview]
Message-ID: <9b2dc45d-5aab-0aba-6fc2-f99bf8b34b84@virtuozzo.com> (raw)
In-Reply-To: <w51im3qwqlo.fsf@maestria.local.igalia.com>
10.05.2021 18:33, Alberto Garcia wrote:
> On Tue 04 May 2021 11:45:09 AM CEST, Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> wrote:
>> All existing parent types (block nodes, block devices, jobs) has the
>> realization. So, drop unreachable code.
>
> s/has/have/ , and I'm not sure what "have the realization" means
>
>> static char *bdrv_child_user_desc(BdrvChild *c)
>> {
>> - if (c->klass->get_parent_desc) {
>> - return c->klass->get_parent_desc(c);
>> - }
>> -
>> - return g_strdup("another user");
>> + return c->klass->get_parent_desc(c);
>> }
>
> Should we also assert(c->klass->get_parent_desc) ?
>
No, as crash on calling zero pointer is practically not worse than crash on failed assertion.
--
Best regards,
Vladimir
next prev parent reply other threads:[~2021-05-10 15:37 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-04 9:45 [PATCH v2 0/5] block permission updated follow-up Vladimir Sementsov-Ogievskiy
2021-05-04 9:45 ` [PATCH v2 1/5] block: document child argument of bdrv_attach_child_common() Vladimir Sementsov-Ogievskiy
2021-05-04 9:45 ` [PATCH v2 2/5] block-backend: improve blk_root_get_parent_desc() Vladimir Sementsov-Ogievskiy
2021-05-31 15:45 ` Kevin Wolf
2021-05-31 16:18 ` Vladimir Sementsov-Ogievskiy
2021-05-04 9:45 ` [PATCH v2 3/5] block: improve bdrv_child_get_parent_desc() Vladimir Sementsov-Ogievskiy
2021-05-10 15:30 ` Alberto Garcia
2021-05-04 9:45 ` [PATCH v2 4/5] block: simplify bdrv_child_user_desc() Vladimir Sementsov-Ogievskiy
2021-05-10 15:33 ` Alberto Garcia
2021-05-10 15:35 ` Vladimir Sementsov-Ogievskiy [this message]
2021-05-31 15:50 ` Kevin Wolf
2021-05-31 16:22 ` Vladimir Sementsov-Ogievskiy
2021-05-04 9:45 ` [PATCH v2 5/5] block: improve permission conflict error message Vladimir Sementsov-Ogievskiy
2021-05-31 16:07 ` Kevin Wolf
2021-05-31 16:18 ` Vladimir Sementsov-Ogievskiy
2021-05-31 16:35 ` Kevin Wolf
2021-05-31 16:44 ` Vladimir Sementsov-Ogievskiy
2021-05-24 14:24 ` [PATCH v2 0/5] block permission updated follow-up Vladimir Sementsov-Ogievskiy
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=9b2dc45d-5aab-0aba-6fc2-f99bf8b34b84@virtuozzo.com \
--to=vsementsov@virtuozzo.com \
--cc=berto@igalia.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/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).