Hi, There are 7 sources still call basename() directly and block/vvfat.c define its own static basename() function. Please see the grep below: ➜ qemu git:(patch-v4) ✗ grep "basename(" **/*.c | grep -v get_basename fsdev/virtfs-proxy-helper.c: basename(prog)); hw/vfio/pci.c: group_name = basename(iommu_group_path); hw/vfio/platform.c: group_name = basename(iommu_group_path); linux-user/elfload.c: base_filename = strdup(basename(filename)); qemu-io.c: progname = basename(argv[0]); qemu-nbd.c: snprintf(sockpath, 128, SOCKET_PATH, basename(device)); qga/commands-posix.c: driver = g_strdup(basename(buf)); qga/commands-posix.c: fs->name = g_strdup(basename(syspath)); ➜ qemu git:(patch-v4) ✗ grep get_basename **/*.c block/vvfat.c:static const char* get_basename(const char* path) block/vvfat.c: basename2 = get_basename(path); block/vvfat.c: basename = get_basename(mapping->path); block/vvfat.c: const char* basename = get_basename(mapping->path); block/vvfat.c: const char* basename = get_basename(mapping->path); block/vvfat.c: const char* basename2 = get_basename(path); block/vvfat.c: - strlen(get_basename(commit->path)) - 1; linux-user/elfload.c: base_filename = 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 <pbonzini@xxxxxxxxxx>: > > > 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 -- Best regards, Houcheng Lin -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html