qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [Qemu-devel] [PATCH v2 3/3] block: get max_transfer lim


From: Eric Farman
Subject: Re: [Qemu-block] [Qemu-devel] [PATCH v2 3/3] block: get max_transfer limit for char (scsi-generic) devices
Date: Fri, 20 Jan 2017 06:34:52 -0500
User-agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Thunderbird/45.5.1



On 01/20/2017 04:53 AM, Fam Zheng wrote:
On Fri, 01/20 17:31, Fam Zheng wrote:
diff --git a/block/file-posix.c b/block/file-posix.c
index 2115155..94068ca 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -657,9 +657,11 @@ static int hdev_get_max_transfer_length(BlockDriverState 
*bs, int fd)
     int max_sectors = 0;
     short max_sectors_short = 0;
     if (bs->sg && ioctl(fd, BLKSECTGET, &max_sectors) == 0) {
+        /* sg returns a value in bytes */
         return max_sectors;

The variable name is now misleading, maybe use "bytes" instead?

BTW patch 2 should already make the function return bytes consistently.  Doing
it here is meaningless code churn.

Excellent points.  Spinning v3 now.

 - Eric




reply via email to

[Prev in Thread] Current Thread [Next in Thread]