[PATCH] lib: fix no zero arg check for iothread_id

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

 



https://bugzilla.redhat.com/show_bug.cgi?id=1251886

We do not allow delete an iothread which id is 0 in
virDomainDelIOThread, but allow it in virDomainAddIOThread,
Also we will output an error when parse an iothread which id
is 0.

Add a check for iothread_id in virDomainAddIOThread to fix
it.

Signed-off-by: Luyao Huang <lhuang@xxxxxxxxxx>
---
Is that okay to fix it in this place ?

 src/libvirt-domain.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index 837933f..8506942 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -7987,6 +7987,7 @@ virDomainAddIOThread(virDomainPtr domain,
 
     virCheckDomainReturn(domain, -1);
     virCheckReadOnlyGoto(domain->conn->flags, error);
+    virCheckNonZeroArgGoto(iothread_id, error);
 
     conn = domain->conn;
 
-- 
1.8.3.1

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