Comment 4 for bug 1752361

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Actually realpath can resolve non existing file, as long as it is on existing paths

$ ll /var/run/symlinkdisk /var/run/foobar/symlinkdisk
ls: cannot access '/var/run/symlinkdisk': No such file or directory
ls: cannot access '/var/run/foobar/symlinkdisk': No such file or directory

$ realpath /var/run/symlinkdisk /var/run/foobar/symlinkdisk
/run/symlinkdisk
realpath: /var/run/foobar/symlinkdisk: No such file or directory

So the virFileExists guard in the code can be weakened just a bit to make it work in general.
That also matches what qemu will do, it will create a socket or file, but would not mkdir.