Re: [PATCH 04/11] xm: Remove redundant validity checks

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

 



On 2013年01月31日 02:51, John Ferlan wrote:
Arguments for driver entry points are checked in libvirt.c, so no need to
check again.
---
  src/xen/xm_internal.c | 76 ++++++++++++---------------------------------------
  1 file changed, 17 insertions(+), 59 deletions(-)

diff --git a/src/xen/xm_internal.c b/src/xen/xm_internal.c
index 003e8f7..1c1db54 100644
--- a/src/xen/xm_internal.c
+++ b/src/xen/xm_internal.c
@@ -481,7 +481,8 @@ int xenXMDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info) {
      xenUnifiedPrivatePtr priv;
      const char *filename;
      xenXMConfCachePtr entry;
-    if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
+
+    if (domain->name == NULL) {

IMHO this checking can also be removed. Domain name is mandatory when
parsing. So I don't think it can be NULL.

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