conf: Check for attach disk usage of iothread=0

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...
This commit is contained in:
John Ferlan 2015-08-12 15:02:47 -04:00
parent e5470dd0e0
commit cb5d0193aa

View 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);