summaryrefslogtreecommitdiff
path: root/include/hw/ide
diff options
context:
space:
mode:
authorMao Zhongyi <maozy.fnst@cn.fujitsu.com>2017-09-18 22:05:13 +0800
committerJohn Snow <jsnow@redhat.com>2017-09-18 19:43:38 -0400
commit794939e81d4c61d86298402a2e9913dc74b55a8e (patch)
tree8f4dd3d5bc6e147951bbe957c1c250917d4dd4db /include/hw/ide
parentac8d9f2e4ca290ecc87abb3b09fb10c21c41d281 (diff)
downloadqemu-794939e81d4c61d86298402a2e9913dc74b55a8e.zip
hw/ide: Convert DeviceClass init to realize
Replace init with realize in IDEDeviceClass, which has errp as a parameter. So all the implementations now use error_setg instead of error_report for reporting error. Cc: John Snow <jsnow@redhat.com> Cc: Markus Armbruster <armbru@redhat.com> Cc: Kevin Wolf <kwolf@redhat.com> Cc: Max Reitz <mreitz@redhat.com> Signed-off-by: Mao Zhongyi <maozy.fnst@cn.fujitsu.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: c4d27b4b5d9e37468e63e35214ce4833ca271542.1505737465.git.maozy.fnst@cn.fujitsu.com Signed-off-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'include/hw/ide')
-rw-r--r--include/hw/ide/internal.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/hw/ide/internal.h b/include/hw/ide/internal.h
index 5b30d7a060..7dd0db488e 100644
--- a/include/hw/ide/internal.h
+++ b/include/hw/ide/internal.h
@@ -12,6 +12,7 @@
#include "sysemu/sysemu.h"
#include "hw/block/block.h"
#include "block/scsi.h"
+#include "qapi/error.h"
/* debug IDE devices */
#define USE_DMA_CDROM
@@ -496,7 +497,7 @@ struct IDEBus {
typedef struct IDEDeviceClass {
DeviceClass parent_class;
- int (*init)(IDEDevice *dev);
+ void (*realize)(IDEDevice *dev, Error **errp);
} IDEDeviceClass;
struct IDEDevice {
@@ -606,7 +607,7 @@ int ide_init_drive(IDEState *s, BlockBackend *blk, IDEDriveKind kind,
const char *version, const char *serial, const char *model,
uint64_t wwn,
uint32_t cylinders, uint32_t heads, uint32_t secs,
- int chs_trans);
+ int chs_trans, Error **errp);
void ide_init2(IDEBus *bus, qemu_irq irq);
void ide_exit(IDEState *s);
void ide_init_ioport(IDEBus *bus, ISADevice *isa, int iobase, int iobase2);