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.