]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: Check for attach disk usage of iothread=0
authorJohn Ferlan <jferlan@redhat.com>
Wed, 12 Aug 2015 19:02:47 +0000 (15:02 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 20 Aug 2015 16:10:21 +0000 (12:10 -0400)
Since iothreadid = 0 is invalid, we need to check for it when attempting
to add a disk; otherwise, someone would think/believe their attempt to
add an IOThread to the disk would succeed. Luckily other code ignored
things when ->iothread == 0...

src/conf/domain_conf.c

index d440eb31f70dbe69fae5940202b44a1e47667815..c5e9653c83f89652594ec7d8fbad7e315b9aef14 100644 (file)
@@ -7483,7 +7483,8 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlopt,
     }
 
     if (driverIOThread) {
-        if (virStrToLong_uip(driverIOThread, NULL, 10, &def->iothread) < 0) {
+        if (virStrToLong_uip(driverIOThread, NULL, 10, &def->iothread) < 0 ||
+            def->iothread == 0) {
             virReportError(VIR_ERR_XML_ERROR,
                            _("Invalid iothread attribute in disk driver "
                              "element: %s"), driverIOThread);