qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] fix sector overflow for scsi disks >1TB large


From: Jamie Lokier
Subject: Re: [Qemu-devel] [PATCH] fix sector overflow for scsi disks >1TB large
Date: Mon, 26 Jan 2009 23:55:59 +0000
User-agent: Mutt/1.5.13 (2006-08-11)

Rik van Riel wrote:
> @@ -50,7 +50,7 @@
>      /* ??? We should probably keep track of whether the data trasfer is

Not your fault, but I just noticed a typo: "trasfer" :-)

>          if (nb_sectors) {
>              nb_sectors--;
> +            /* Clip to 2TB, instead of returning capacity modulo 2TB. */
> +            if (nb_sectors > UINT_MAX)
> +                nb_sectors = UINT_MAX;
>              outbuf[0] = (nb_sectors >> 24) & 0xff;
>              outbuf[1] = (nb_sectors >> 16) & 0xff;
>              outbuf[2] = (nb_sectors >> 8) & 0xff;

Wouldn't it be clearer andd safer to say 0xffffffff here, or UINT32_MAX?

I know QEMU only runs on hosts with 32-bit unsigned int, and perhaps
that will always be truea, but it's a bit unnecessary to assume it here.

-- JAmie




reply via email to

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