]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Don't pass mode when opening domain log file for reading
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 23 Oct 2020 17:39:03 +0000 (19:39 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 26 Oct 2020 07:52:13 +0000 (08:52 +0100)
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 <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/qemu/qemu_domain.c

index 161b369712e602cc6457961ff75ad5a3cfd83ad5..d7dbca487a5a1a55f03759912f7b7c039a28d895 100644 (file)
@@ -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;