[libvirt] [PATCH] Fix vm define error with back compat console device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If you define a domain with serial devs > 0 && parallel devs >= serial
devs, libvirtd segfaults when trying to set up the back compat console
device. We were using a previous loop counter where we shouldn't. The
attached patch fixes this.

Thanks,
Cole
diff --git a/src/domain_conf.c b/src/domain_conf.c
index 8bb51f7..890afe0 100644
--- a/src/domain_conf.c
+++ b/src/domain_conf.c
@@ -3320,8 +3320,9 @@ char *virDomainDefFormat(virConnectPtr conn,
         if (virDomainChrDefFormat(conn, &buf, def->console, "console") < 0)
             goto cleanup;
     } else if (def->nserials != 0) {
-        /* ..else for legacy compat duplicate the serial device as a console */
-        if (virDomainChrDefFormat(conn, &buf, def->serials[n], "console") < 0)
+        /* ..else for legacy compat duplicate the first serial device as a
+         * console */
+        if (virDomainChrDefFormat(conn, &buf, def->serials[0], "console") < 0)
             goto cleanup;
     }
 
--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]