Re: adding tests to qemu_driver

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

 



On Thu, Nov 12, 2015 at 23:47:54 +0200, noxdafox wrote:
> Greetings,
> 
> I was investigating on an issue in which QEMU's dynamic ownership was 
> not properly working when calling qemuDomainCoreDumpWithFormat().

Could describe this issue you are investigating?

> The core of the issue seems to be the qemuOpenFileAs() function which 
> does not handle the dynamic ownership. This might affect other libvirt's 
> features within as well.

Because you are most likely looking at a wrong place; qemuOpenFileAs is
a quite low level function which is just supposed to open/create a file
accessible to a given user. It's up to the caller to decide what the
user should be.

...
> The issue is that all the functions within the qemu_driver.c module are 
> static. I could indeed include the module itself in my tests but I'm not 
> sure whether this is acceptable.

We solve this kind of issues by removing "static" from the functions and
adding a new header file (if it doesn't exist yet) called *priv.h
(qemu_driverpriv.h in this case) with the prototypes for such functions.
Only tests are allowed to include such header files.

> Furthermore I'd like to have some clarification about the NFS related 
> code. It seems that some effort has been put in order to tackle 
> something I'm not aware of. Could someone briefly explain how to 
> reproduce NFS failing scenarios?

The main problem with NFS which this ugly function is trying to handle
is called "root-squash". This feature maps all access from UID 0 to an
unprivileged UID. That is, libvirtd (even though it is running as root)
will not be able to access the desired file.

Jirka

--
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]