Skip to contentSkip to conversation

qemu-io: Make alloc output useful when nb_sectors=1

PATCH Applied Stefan Hajnoczi 2 participants 2 messages Sep 2, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qemu-io: Make alloc output useful when nb_sectors=1

There is no indication whether or not the sector is allocated when nb_sectors=1:

sector allocated at offset 64 KiB

This message is produced whether or not the sector is allocated.

Simply use the same message as the plural case, I don't think the English is so broken that we need special case output here:

0/1 sectors allocated at offset 64 KiB

This change does not affect qemu-iotests since nb_sectors=1 is not used there.

---
 qemu-io.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
qemu-io.c +2 -5
index 2dbe20f..bd3bd16 100644
@@ -1427,11 +1427,8 @@ alloc_f(int argc, char **argv)
 
 	cvtstr(offset, s1, sizeof(s1));
 
-	if (nb_sectors == 1)
-		printf("sector allocated at offset %s\n", s1);
-	else
-		printf("%d/%d sectors allocated at offset %s\n",
-			sum_alloc, nb_sectors, s1);
+	printf("%d/%d sectors allocated at offset %s\n",
+	       sum_alloc, nb_sectors, s1);
 	return 0;
 }
 
Signature · 1 line
1.7.1
Applied
#1 lore raw

Am 02.09.2010 11:38, schrieb Stefan Hajnoczi:

Quoted 10 lines

There is no indication whether or not the sector is allocated when nb_sectors=1:

sector allocated at offset 64 KiB

This message is produced whether or not the sector is allocated.

Simply use the same message as the plural case, I don't think the English is so broken that we need special case output here:

Quoted 6 lines

0/1 sectors allocated at offset 64 KiB

This change does not affect qemu-iotests since nb_sectors=1 is not used there.

Thanks, applied to the block branch.

Kevin