]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu_namespace: Rename variable
authorMartin Kletzander <mkletzan@redhat.com>
Tue, 15 Oct 2024 12:48:01 +0000 (14:48 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Wed, 16 Oct 2024 13:07:10 +0000 (15:07 +0200)
The boolean actually tells whether the file existed when the function
was called and using it in more places later on makes them
confusing (e.g. do something with a file if it does not exist).  To
better reflect the above and prepare for next patch rename this
variable.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/qemu/qemu_namespace.c

index bbe3d5a1f78a9379096c7b6ed08b56612705e0c9..71e29b4ba4f68a9d2058af44fc177c856ad62d95 100644 (file)
@@ -1002,10 +1002,10 @@ qemuNamespaceMknodOne(qemuNamespaceMknodItem *data)
     bool isDev = S_ISCHR(data->sb.st_mode) || S_ISBLK(data->sb.st_mode);
     bool isReg = S_ISREG(data->sb.st_mode) || S_ISFIFO(data->sb.st_mode) || S_ISSOCK(data->sb.st_mode);
     bool isDir = S_ISDIR(data->sb.st_mode);
-    bool exists = false;
+    bool existed = false;
 
     if (virFileExists(data->file))
-        exists = true;
+        existed = true;
 
     if (virFileMakeParentPath(data->file) < 0) {
         virReportSystemError(errno,
@@ -1131,7 +1131,7 @@ qemuNamespaceMknodOne(qemuNamespaceMknodItem *data)
         virFileMoveMount(data->target, data->file) < 0)
         goto cleanup;
 
-    ret = exists;
+    ret = existed;
  cleanup:
     if (ret < 0 && delDevice) {
         if (isDir)