[libvirt] [PATCH] conf: Check for attach disk usage of iothread=0

Martin Kletzander mkletzan at redhat.com
Thu Aug 20 13:35:26 UTC 2015


On Wed, Aug 12, 2015 at 05:27:48PM -0400, John Ferlan wrote:
>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...
>

We are very fortunate indeed in this regard.  ACK then.

Martin

>Signed-off-by: John Ferlan <jferlan at redhat.com>
>---
> src/conf/domain_conf.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
>diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
>index b743bdd..10630c0 100644
>--- a/src/conf/domain_conf.c
>+++ b/src/conf/domain_conf.c
>@@ -7448,7 +7448,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);
>--
>2.1.0
>
>--
>libvir-list mailing list
>libvir-list at redhat.com
>https://www.redhat.com/mailman/listinfo/libvir-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150820/528a5c0a/attachment-0001.sig>


More information about the libvir-list mailing list