return -1;
if ((fd = open(path, O_WRONLY|O_TRUNC|O_CREAT, 0600)) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("failed to open domain master key file for write"));
+ virReportSystemError(errno, "%s",
+ _("failed to open domain master key file for write"));
return -1;
}
}
if ((fd = open(path, O_RDONLY)) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("failed to open domain master key file for read"));
+ virReportSystemError(errno, "%s",
+ _("failed to open domain master key file for read"));
goto error;
}
int fd;
if ((fd = open(vsock_path, O_RDWR)) < 0) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- "%s", _("unable to open vhost-vsock device"));
+ virReportSystemError(errno, "%s",
+ _("unable to open vhost-vsock device"));
return -1;
}