From: Michal Privoznik Date: Fri, 23 Oct 2020 17:39:03 +0000 (+0200) Subject: qemu: Don't pass mode when opening domain log file for reading X-Git-Tag: v6.9.0-rc1~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=57365935000ea9b789d8ed6f15bcd24058da9fa6;p=thirdparty%2Flibvirt.git qemu: Don't pass mode when opening domain log file for reading In qemuDomainLogContextNew() the domain log file is opened. Twice, the first time for writing, and the second time for reading (if required by caller). When opening the log file for reading a mode is provided. This doesn't do much harm, but is unnecessary. Drop the mode. Signed-off-by: Michal Privoznik Reviewed-by: Daniel P. Berrangé --- diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 161b369712..d7dbca487a 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -6251,7 +6251,7 @@ qemuDomainLogContextPtr qemuDomainLogContextNew(virQEMUDriverPtr driver, } if (mode == QEMU_DOMAIN_LOG_CONTEXT_MODE_START) { - if ((ctxt->readfd = open(ctxt->path, O_RDONLY, S_IRUSR | S_IWUSR)) < 0) { + if ((ctxt->readfd = open(ctxt->path, O_RDONLY)) < 0) { virReportSystemError(errno, _("failed to open logfile %s"), ctxt->path); goto error;