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

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

 




On 08/12/2015 05:27 PM, 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...
> 
> Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
> ---
>  src/conf/domain_conf.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 

Ping - also see https://bugzilla.redhat.com/show_bug.cgi?id=1253108

Tks -

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

--
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]