mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 09:13:55 -06:00
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:
parent
1dae12e6d0
commit
3b0ba92793
3 changed files with 43 additions and 71 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue