From 3b0ba927931925f0f76509747ae145df30c97a05 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Wed, 22 Jul 2009 16:42:59 +0200 Subject: kill drives_opt cleanup pretty simliar to the drives_table removal patch: - drop the table and make a linked list out of it. - pass around struct pointers instead of table indices. Signed-off-by: Gerd Hoffmann Signed-off-by: Anthony Liguori --- hw/device-hotplug.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'hw') diff --git a/hw/device-hotplug.c b/hw/device-hotplug.c index 5257274efd..8f0dec8b09 100644 --- a/hw/device-hotplug.c +++ b/hw/device-hotplug.c @@ -30,17 +30,17 @@ DriveInfo *add_init_drive(const char *opts) { - int drive_opt_idx; int fatal_error; DriveInfo *dinfo; + DriveOpt *dopt; - drive_opt_idx = drive_add(NULL, "%s", opts); - if (!drive_opt_idx) + dopt = drive_add(NULL, "%s", opts); + if (!dopt) return NULL; - dinfo = drive_init(&drives_opt[drive_opt_idx], 0, current_machine, &fatal_error); + dinfo = drive_init(dopt, 0, current_machine, &fatal_error); if (!dinfo) { - drive_remove(drive_opt_idx); + drive_remove(dopt); return NULL; } -- cgit v1.2.3