aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2010-06-02 13:31:55 +0200
committerKevin Wolf <kwolf@redhat.com>2010-06-04 11:43:40 +0200
commita803cb8eb8ada1add74f1b393b8a553a7e7f3acf (patch)
treef2fff551c60a4f49060e2d4d7b8d3edbce8dfb87 /vl.c
parent7cdb1f6d305e1000b5f882257cbee71b8bb08ef5 (diff)
blockdev: Hide QEMUMachine from drive_init()
To pave the way for moving it out of vl.c. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/vl.c b/vl.c
index 551138f0cc..db1fefd3ff 100644
--- a/vl.c
+++ b/vl.c
@@ -767,8 +767,7 @@ static int parse_block_error_action(const char *buf, int is_read)
}
}
-DriveInfo *drive_init(QemuOpts *opts, void *opaque,
- int *fatal_error)
+DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi, int *fatal_error)
{
const char *buf;
const char *file = NULL;
@@ -780,7 +779,6 @@ DriveInfo *drive_init(QemuOpts *opts, void *opaque,
int bus_id, unit_id;
int cyls, heads, secs, translation;
BlockDriver *drv = NULL;
- QEMUMachine *machine = opaque;
int max_devs;
int index;
int ro = 0;
@@ -795,7 +793,7 @@ DriveInfo *drive_init(QemuOpts *opts, void *opaque,
translation = BIOS_ATA_TRANSLATION_AUTO;
- if (machine && machine->use_scsi) {
+ if (default_to_scsi) {
type = IF_SCSI;
max_devs = MAX_SCSI_DEVS;
pstrcpy(devname, sizeof(devname), "scsi");
@@ -1135,10 +1133,10 @@ DriveInfo *drive_init(QemuOpts *opts, void *opaque,
static int drive_init_func(QemuOpts *opts, void *opaque)
{
- QEMUMachine *machine = opaque;
+ int *use_scsi = opaque;
int fatal_error = 0;
- if (drive_init(opts, machine, &fatal_error) == NULL) {
+ if (drive_init(opts, *use_scsi, &fatal_error) == NULL) {
if (fatal_error)
return 1;
}
@@ -3641,7 +3639,7 @@ int main(int argc, char **argv, char **envp)
/* open the virtual block devices */
if (snapshot)
qemu_opts_foreach(&qemu_drive_opts, drive_enable_snapshot, NULL, 0);
- if (qemu_opts_foreach(&qemu_drive_opts, drive_init_func, machine, 1) != 0)
+ if (qemu_opts_foreach(&qemu_drive_opts, drive_init_func, &machine->use_scsi, 1) != 0)
exit(1);
register_savevm_live("ram", 0, 3, NULL, ram_save_live, NULL,