Re: [PATCHv2] Don't allow two or more disks to be mapped to the same image file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/24/2011 02:45 PM, Eric Blake wrote:
> On 03/24/2011 02:46 AM, Hu Tao wrote:
>> If two or more disks are mapped to the same image file, operating
>> on these disks at the same time may corrupt data stored in the
>> image file.
>>
>> changes:
>>
>> v2:
>>
>> - allow it for read-only disks
>> - compare source files by inode number
>>
>> +
>> +    if (stat(disk->src, &stat1)) {
>> +        if (errno != ENOENT) {
>> +            /* Can't stat file, for safety treate it as conflicted */
> 
> s/treate/treat/
> 
> Won't this will fail on root-squash NFS from qemu:///system?  (Or does
> root-squash meant that root can still stat() but just not open() a file?)

This won't work for network disks, which aren't files. To check
for network disk conflicts, you'd need to check that whether any
host and port are the same as well. This won't be perfect, since
hosts and ports can be implicit or referred to by different
names, but it won't have false positives.

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]