mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
qemu: driver: Document qemuOpenFile
The function is nontrivial to follow and has non-standard return values. Recent usage was buggy.
This commit is contained in:
parent
1e9cf6e09c
commit
f7105d0e4a
@ -2862,13 +2862,32 @@ qemuCompressGetCommand(virQEMUSaveFormat compression)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Internal function to properly create or open existing files, with
|
/**
|
||||||
* ownership affected by qemu driver setup and domain DAC label. */
|
* qemuOpenFile:
|
||||||
|
* @driver: driver object
|
||||||
|
* @vm: domain object
|
||||||
|
* @path: path to file to open
|
||||||
|
* @oflags: flags for opening/creation of the file
|
||||||
|
* @needUnlink: set to true if file was created by this function
|
||||||
|
* @bypassSecurityDriver: optional pointer to a boolean that will be set to true
|
||||||
|
* if security driver operations are pointless (due to
|
||||||
|
* NFS mount)
|
||||||
|
*
|
||||||
|
* Internal function to properly create or open existing files, with
|
||||||
|
* ownership affected by qemu driver setup and domain DAC label.
|
||||||
|
*
|
||||||
|
* Returns the file descriptor on success and negative errno on failure.
|
||||||
|
*
|
||||||
|
* This function should not be used on storage sources. Use
|
||||||
|
* qemuDomainStorageFileInit and storage driver APIs if possible.
|
||||||
|
**/
|
||||||
static int
|
static int
|
||||||
qemuOpenFile(virQEMUDriverPtr driver,
|
qemuOpenFile(virQEMUDriverPtr driver,
|
||||||
virDomainObjPtr vm,
|
virDomainObjPtr vm,
|
||||||
const char *path, int oflags,
|
const char *path,
|
||||||
bool *needUnlink, bool *bypassSecurityDriver)
|
int oflags,
|
||||||
|
bool *needUnlink,
|
||||||
|
bool *bypassSecurityDriver)
|
||||||
{
|
{
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
|
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user