void *buffer,
unsigned int flags)
{
+ virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
int fd = -1, ret = -1;
const char *actual;
}
path = actual;
- /* The path is correct, now try to open it and get its size. */
- fd = open(path, O_RDONLY);
- if (fd == -1) {
- virReportSystemError(errno,
- _("%s: failed to open"), path);
+ fd = qemuOpenFile(driver, vm, path, O_RDONLY, NULL, NULL);
+ if (fd == -1)
goto cleanup;
- }
/* Seek and read. */
/* NB. Because we configure with AC_SYS_LARGEFILE, off_t should
path = disk->src;
/* The path is correct, now try to open it and get its size. */
- fd = open(path, O_RDONLY);
- if (fd == -1) {
- virReportSystemError(errno,
- _("failed to open path '%s'"), path);
+ fd = qemuOpenFile(driver, vm, path, O_RDONLY, NULL, NULL);
+ if (fd == -1)
goto cleanup;
- }
/* Probe for magic formats */
if (disk->format) {