From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47202) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zje6W-0001Fr-C3 for qemu-devel@nongnu.org; Tue, 06 Oct 2015 22:05:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zje6V-0003h4-94 for qemu-devel@nongnu.org; Tue, 06 Oct 2015 22:05:16 -0400 Received: from mail-io0-x235.google.com ([2607:f8b0:4001:c06::235]:35752) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zje6V-0003e9-4T for qemu-devel@nongnu.org; Tue, 06 Oct 2015 22:05:15 -0400 Received: by ioiz6 with SMTP id z6so7124274ioi.2 for ; Tue, 06 Oct 2015 19:05:14 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <5613CB01.6020107@redhat.com> References: <1443847454-20406-1-git-send-email-houcheng@gmail.com> <20151006094713.GD19089@stefanha-thinkpad> <5613BAD6.9090605@redhat.com> <5613CB01.6020107@redhat.com> Date: Wed, 7 Oct 2015 10:05:14 +0800 Message-ID: From: Houcheng Lin Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC PATCH v4] os-android: Add support to android platform List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Peter Maydell , Fam Zheng , kvm@vger.kernel.org, linhaocheng@itri.org.tw, Stefan Hajnoczi , qemu-devel@nongnu.org, =?UTF-8?B?QWxleCBCZW5uw6ll?= Hi, There are 7 sources still call basename() directly and block/vvfat.c define its own static basename() function. Please see the grep below: =E2=9E=9C qemu git:(patch-v4) =E2=9C=97 grep "basename(" **/*.c | grep -= v get_basename fsdev/virtfs-proxy-helper.c: basename(prog)); hw/vfio/pci.c: group_name =3D basename(iommu_group_path); hw/vfio/platform.c: group_name =3D basename(iommu_group_path); linux-user/elfload.c: base_filename =3D strdup(basename(filename)); qemu-io.c: progname =3D basename(argv[0]); qemu-nbd.c: snprintf(sockpath, 128, SOCKET_PATH, basename(device)); qga/commands-posix.c: driver =3D g_strdup(basename(buf)); qga/commands-posix.c: fs->name =3D g_strdup(basename(syspath)); =E2=9E=9C qemu git:(patch-v4) =E2=9C=97 grep get_basename **/*.c block/vvfat.c:static const char* get_basename(const char* path) block/vvfat.c: basename2 =3D get_basename(path); block/vvfat.c: basename =3D get_basename(mapping->path); block/vvfat.c: const char* basename =3D get_basename(mapping->path); block/vvfat.c: const char* basename =3D get_basename(mapping->path); block/vvfat.c: const char* basename2 =3D get_basename(path); block/vvfat.c: - strlen(get_basename(commit->path)) - 1; linux-user/elfload.c: base_filename =3D g_path_get_basename(ts->bprm->filename); Directly change all of them to g_path_get_basename ? 2015-10-06 21:22 GMT+08:00 Paolo Bonzini : > > > On 06/10/2015 14:13, Eric Blake wrote: >> >> If you are already writing code to be ported to both Unixy and >> windows systems, you are better off rolling your own alternative to >> basename (or better, using something else that has already rolled a >> portable version for you - while I know gnulib does that, we aren't >> using gnulib; but I assume glib has something along those lines >> even though I haven't looked for it). > > Yes, there is g_path_get_basename (and g_path_get_dirname). Added to > http://wiki.qemu.org/BiteSizedTasks#API_conversion. > > Paolo --=20 Best regards, Houcheng Lin