From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56350) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xei2E-00046k-Oo for qemu-devel@nongnu.org; Thu, 16 Oct 2014 06:11:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xei29-00072u-UR for qemu-devel@nongnu.org; Thu, 16 Oct 2014 06:11:54 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:6011) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xei29-00070C-49 for qemu-devel@nongnu.org; Thu, 16 Oct 2014 06:11:49 -0400 Message-ID: <543F99C5.100@huawei.com> Date: Thu, 16 Oct 2014 18:11:17 +0800 From: Gonglei MIME-Version: 1.0 References: <1413363967-2489-1-git-send-email-kraxel@redhat.com> <1413363967-2489-4-git-send-email-kraxel@redhat.com> In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PULL 03/34] bootindex: add del_boot_device_path function List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: "chenliang (T)" , Gerd Hoffmann , QEMU Developers On 2014/10/16 18:04, Peter Maydell wrote: > On 15 October 2014 11:05, Gerd Hoffmann wrote: >> From: Gonglei >> >> Introduce del_boot_device_path() to clean up fw_cfg content when >> hot-unplugging a device that refers to a bootindex or update a >> existent devcie's bootindex. > >> +void del_boot_device_path(DeviceState *dev, const char *suffix) >> +{ >> + FWBootEntry *i; >> + >> + if (dev == NULL) { >> + return; >> + } >> + >> + QTAILQ_FOREACH(i, &fw_boot_order, link) { >> + if ((!suffix || !g_strcmp0(i->suffix, suffix)) && > > I've just noticed that this won't build with our minimum > required glib version: g_strcmp0 wasn't introduced > until glib 2.16. > > It should be fairly easy to provide a back-compat implementation > in our glib-compat.h header, or you could just rephrase this > to work with the usual strcmp, since you're already doing a > manual NULL check on one of the arguments. > OK, thanks for your point, Peter. I'll post a patch to fix this problem :) Best regards, -Gonglei