qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 4/5] block: simplify bdrv_child_user_desc()


From: Vladimir Sementsov-Ogievskiy
Subject: Re: [PATCH v2 4/5] block: simplify bdrv_child_user_desc()
Date: Mon, 10 May 2021 18:35:34 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]