2f0b3b1 qemuDomainDetachDeviceUnlink: Don't unlink files we haven't created

Authored and Committed by mprivozn 6 years ago
    qemuDomainDetachDeviceUnlink: Don't unlink files we haven't created
    
    Even though there are several checks before calling this function
    and for some scenarios we don't call it at all (e.g. on disk hot
    unplug), it may be possible to sneak in some weird files (e.g. if
    domain would have RNG with /dev/shm/some_file as its backend). No
    matter how improbable, we shouldn't unlink it as we would be
    unlinking a file from the host which we haven't created in the
    first place.
    
    Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
    Reviewed-by: Cedric Bosdonnat <cbosdonnat@suse.com>
    
        
file modified
+76 -10