]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util: replace IS_ABSOLUTE_FILE_NAME with g_path_is_absolute
authorDaniel P. Berrangé <berrange@redhat.com>
Mon, 23 Dec 2019 15:54:41 +0000 (15:54 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Fri, 3 Jan 2020 15:42:13 +0000 (15:42 +0000)
Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/qemu/qemu_domain.c
src/util/virfile.c

index 187aaf5737b9b3ab45651e56cabde5e8955e3cf3..f545d0b8885cd1c5fde28a84232acc5fc60314a3 100644 (file)
@@ -77,8 +77,6 @@
 # include <selinux/selinux.h>
 #endif
 
-#include "dosname.h"
-
 #define QEMU_QXL_VGAMEM_DEFAULT 16 * 1024
 
 #define VIR_FROM_THIS VIR_FROM_QEMU
@@ -14340,7 +14338,7 @@ qemuDomainCreateDeviceRecursive(const char *device,
          *   (want /dev/disk/by-id/../../sda)
          * /dev/stdout -> /proc/self/fd/1 (no change needed)
          */
-        if (IS_RELATIVE_FILE_NAME(target)) {
+        if (!g_path_is_absolute(target)) {
             char *c = NULL, *tmp = NULL, *devTmp = NULL;
 
             devTmp = g_strdup(device);
@@ -15312,7 +15310,7 @@ qemuDomainAttachDeviceMknodRecursive(virQEMUDriverPtr driver,
             return ret;
         }
 
-        if (IS_RELATIVE_FILE_NAME(target)) {
+        if (!g_path_is_absolute(target)) {
             char *c = NULL, *tmp = NULL, *fileTmp = NULL;
 
             fileTmp = g_strdup(file);
index 97f86a46e985614cd6c3006f684c84e967ae982e..1ce909b033bf162520fc4ad275d68e6b4b8d9b9b 100644 (file)
@@ -1562,7 +1562,7 @@ virFileResolveLinkHelper(const char *linkpath,
     /* We don't need the full canonicalization of intermediate
      * directories, if linkpath is absolute and the basename is
      * already a non-symlink.  */
-    if (IS_ABSOLUTE_FILE_NAME(linkpath) && !intermediatePaths) {
+    if (g_path_is_absolute(linkpath) && !intermediatePaths) {
         if (g_lstat(linkpath, &st) < 0)
             return -1;
 
@@ -1640,7 +1640,7 @@ virFindFileInPath(const char *file)
     /* if we are passed an absolute path (starting with /), return a
      * copy of that path, after validating that it is executable
      */
-    if (IS_ABSOLUTE_FILE_NAME(file)) {
+    if (g_path_is_absolute(file)) {
         if (!virFileIsExecutable(file))
             return NULL;