[PATCH 1/3] qemu: Drop needless check in virDomainFSInfoFormat()

Michal Privoznik mprivozn at redhat.com
Mon Feb 15 16:29:32 UTC 2021


As the very first thing, this function checks whether the number
of items inside @agentinfo array is not negative. This is
redundant as the only caller - qemuDomainGetFSInfo() already
checked for that and would not even call this function if that
was the case.

Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
---
 src/qemu/qemu_driver.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 3d54653217..f59f9e13ba 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -18966,8 +18966,6 @@ virDomainFSInfoFormat(qemuAgentFSInfoPtr *agentinfo,
     virDomainFSInfoPtr *info_ret = NULL;
     size_t i;
 
-    if (nagentinfo < 0)
-        return ret;
     info_ret = g_new0(virDomainFSInfoPtr, nagentinfo);
 
     for (i = 0; i < nagentinfo; i++) {
-- 
2.26.2




More information about the libvir-list mailing list