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...
}
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);