[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 12/43] block: simplify default_drive
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 12/43] block: simplify default_drive |
Date: |
Thu, 13 Dec 2012 16:10:19 +0100 |
From: Christian Borntraeger <address@hidden>
Markus Armbruster pointed out that there is only one caller
to default_drive with IF_DEFAULT as a type. Lets get rid
of the block_default_type parameter and adopt the caller
to do the right thing (asking the machine struct).
Signed-off-by: Christian Borntraeger <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
vl.c | 20 ++++++--------------
1 files changed, 6 insertions(+), 14 deletions(-)
diff --git a/vl.c b/vl.c
index ee10d21..6b3827c 100644
--- a/vl.c
+++ b/vl.c
@@ -899,17 +899,11 @@ static int drive_enable_snapshot(QemuOpts *opts, void
*opaque)
return 0;
}
-static void default_drive(int enable, int snapshot,
- BlockInterfaceType block_default_type,
- BlockInterfaceType type, int index,
- const char *optstr)
+static void default_drive(int enable, int snapshot, BlockInterfaceType type,
+ int index, const char *optstr)
{
QemuOpts *opts;
- if (type == IF_DEFAULT) {
- type = block_default_type;
- }
-
if (!enable || drive_get_by_index(type, index)) {
return;
}
@@ -3776,12 +3770,10 @@ int main(int argc, char **argv, char **envp)
exit(1);
}
- default_drive(default_cdrom, snapshot, machine->block_default_type,
- IF_DEFAULT, 2, CDROM_OPTS);
- default_drive(default_floppy, snapshot, machine->block_default_type,
- IF_FLOPPY, 0, FD_OPTS);
- default_drive(default_sdcard, snapshot, machine->block_default_type,
- IF_SD, 0, SD_OPTS);
+ default_drive(default_cdrom, snapshot, machine->block_default_type, 2,
+ CDROM_OPTS);
+ default_drive(default_floppy, snapshot, IF_FLOPPY, 0, FD_OPTS);
+ default_drive(default_sdcard, snapshot, IF_SD, 0, SD_OPTS);
register_savevm_live(NULL, "ram", 0, 4, &savevm_ram_handlers, NULL);
--
1.7.6.5
- [Qemu-devel] [PULL 00/43] Block patches, Kevin Wolf, 2012/12/13
- [Qemu-devel] [PATCH 01/43] tests: use aio_poll() instead of aio_flush() in test-aio.c, Kevin Wolf, 2012/12/13
- [Qemu-devel] [PATCH 04/43] aio: Get rid of qemu_aio_flush(), Kevin Wolf, 2012/12/13
- [Qemu-devel] [PATCH 03/43] block: Improve bdrv_aio_co_cancel_em, Kevin Wolf, 2012/12/13
- [Qemu-devel] [PATCH 02/43] tests: avoid qemu_aio_flush() in test-thread-pool.c, Kevin Wolf, 2012/12/13
- [Qemu-devel] [PATCH 06/43] block: Avoid second open for format probing, Kevin Wolf, 2012/12/13
- [Qemu-devel] [PATCH 09/43] block: vpc support for ~2 TB disks, Kevin Wolf, 2012/12/13
- [Qemu-devel] [PATCH 12/43] block: simplify default_drive,
Kevin Wolf <=
- [Qemu-devel] [PATCH 07/43] virtio-blk: Remove duplicate property definition, Kevin Wolf, 2012/12/13
- [Qemu-devel] [PATCH 05/43] block: Factor out bdrv_open_flags, Kevin Wolf, 2012/12/13
- [Qemu-devel] [PATCH 10/43] raw-posix: inline paio_ioctl into hdev_aio_ioctl, Kevin Wolf, 2012/12/13
- [Qemu-devel] [PATCH 16/43] qmp: qmp_transaction(): pass Error object to bdrv_img_create(), Kevin Wolf, 2012/12/13
- [Qemu-devel] [PATCH 13/43] block: bdrv_img_create(): add Error ** argument, Kevin Wolf, 2012/12/13
- [Qemu-devel] [PATCH 14/43] qemu-img: img_create(): pass Error object to bdrv_img_create(), Kevin Wolf, 2012/12/13
- [Qemu-devel] [PATCH 08/43] block: vpc initialize the uuid footer field, Kevin Wolf, 2012/12/13
- [Qemu-devel] [PATCH 17/43] qmp: qmp_drive_mirror(): pass Error object to bdrv_img_create(), Kevin Wolf, 2012/12/13
- [Qemu-devel] [PATCH 11/43] Support default block interfaces per QEMUMachine, Kevin Wolf, 2012/12/13
- [Qemu-devel] [PATCH 22/43] Fix error code checking for SetFilePointer() call, Kevin Wolf, 2012/12/13