Revision 3b0ba927 hw/device-hotplug.c
b/hw/device-hotplug.c | ||
---|---|---|
30 | 30 |
|
31 | 31 |
DriveInfo *add_init_drive(const char *opts) |
32 | 32 |
{ |
33 |
int drive_opt_idx; |
|
34 | 33 |
int fatal_error; |
35 | 34 |
DriveInfo *dinfo; |
35 |
DriveOpt *dopt; |
|
36 | 36 |
|
37 |
drive_opt_idx = drive_add(NULL, "%s", opts);
|
|
38 |
if (!drive_opt_idx)
|
|
37 |
dopt = drive_add(NULL, "%s", opts);
|
|
38 |
if (!dopt)
|
|
39 | 39 |
return NULL; |
40 | 40 |
|
41 |
dinfo = drive_init(&drives_opt[drive_opt_idx], 0, current_machine, &fatal_error);
|
|
41 |
dinfo = drive_init(dopt, 0, current_machine, &fatal_error);
|
|
42 | 42 |
if (!dinfo) { |
43 |
drive_remove(drive_opt_idx);
|
|
43 |
drive_remove(dopt);
|
|
44 | 44 |
return NULL; |
45 | 45 |
} |
46 | 46 |
|
Also available in: Unified diff