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 <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
Gerd Hoffmann 2009-07-22 16:42:59 +02:00 committed by Anthony Liguori
parent 1dae12e6d0
commit 3b0ba92793
3 changed files with 43 additions and 71 deletions

View file

@ -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;
}