[libvirt] [PATCH 1/3] qemu: fix block stats for virtio and scsi

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

 



Hi,
0 looks like a valid index as returned by virDiskNameToIndex, so we
should accept it. Also the disk argument can be const.
 -- Guido
>From 084dcc24ce4ec3a7561eaf2a090cdb45a97e9a56 Mon Sep 17 00:00:00 2001
From: Guido Guenther <agx@xxxxxxxxxxx>
Date: Fri, 10 Oct 2008 17:13:33 +0200
Subject: [PATCH] index 0 is valid

---
 src/domain_conf.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/domain_conf.c b/src/domain_conf.c
index cbad43c..1264ed8 100644
--- a/src/domain_conf.c
+++ b/src/domain_conf.c
@@ -3380,12 +3380,12 @@ char *virDomainConfigFile(virConnectPtr conn,
  * @param devIdx parsed device number
  * @return 0 on success, -1 on failure
  */
-int virDiskNameToBusDeviceIndex(virDomainDiskDefPtr disk,
+int virDiskNameToBusDeviceIndex(const virDomainDiskDefPtr disk,
                                 int *busIdx,
                                 int *devIdx) {
 
     int idx = virDiskNameToIndex(disk->dst);
-    if (idx < 1)
+    if (idx < 0)
         return -1;
 
     switch (disk->bus) {
-- 
1.5.6.5

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