[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 10/10] vpc.c: Use get_option_parameter() does the se
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 10/10] vpc.c: Use get_option_parameter() does the search |
Date: |
Wed, 13 Apr 2011 14:05:16 +0200 |
From: Mitnick Lyu <address@hidden>
Use get_option_parameter() to instead of duplicating the loop, and
use BDRV_SECTOR_SIZE to instead of 512
Signed-off-by: Mitnick Lyu <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/vpc.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/block/vpc.c b/block/vpc.c
index 7b025be..56865da 100644
--- a/block/vpc.c
+++ b/block/vpc.c
@@ -505,12 +505,8 @@ static int vpc_create(const char *filename,
QEMUOptionParameter *options)
int ret = -EIO;
// Read out options
- while (options && options->name) {
- if (!strcmp(options->name, "size")) {
- total_sectors = options->value.n / 512;
- }
- options++;
- }
+ total_sectors = get_option_parameter(options, BLOCK_OPT_SIZE)->value.n /
+ BDRV_SECTOR_SIZE;
// Create the file
fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0644);
--
1.7.2.3
- [Qemu-devel] [PULL 00/10] Block patches, Kevin Wolf, 2011/04/13
- [Qemu-devel] [PATCH 01/10] docs: Describe zero data clusters in QED specification, Kevin Wolf, 2011/04/13
- [Qemu-devel] [PATCH 04/10] atapi: Report correct errors on guest eject request, Kevin Wolf, 2011/04/13
- [Qemu-devel] [PATCH 03/10] atapi: Drives can be locked without media present, Kevin Wolf, 2011/04/13
- [Qemu-devel] [PATCH 05/10] atapi: Allow GET_EVENT_STATUS_NOTIFICATION after media change, Kevin Wolf, 2011/04/13
- [Qemu-devel] [PATCH 06/10] atapi: Move GET_EVENT_STATUS_NOTIFICATION command handling to its own function, Kevin Wolf, 2011/04/13
- [Qemu-devel] [PATCH 08/10] atapi: GESN: Standardise event response handling for future additions, Kevin Wolf, 2011/04/13
- [Qemu-devel] [PATCH 10/10] vpc.c: Use get_option_parameter() does the search,
Kevin Wolf <=
- [Qemu-devel] [PATCH 07/10] atapi: GESN: Use structs for commonly-used field types, Kevin Wolf, 2011/04/13
- [Qemu-devel] [PATCH 02/10] qed: Add support for zero clusters, Kevin Wolf, 2011/04/13
- [Qemu-devel] [PATCH 09/10] atapi: GESN: implement 'media' subcommand, Kevin Wolf, 2011/04/13