Skip to content

Commit

Permalink
ahci: Move QOM macros to header
Browse files Browse the repository at this point in the history
The TYPE_* constants and the typedefs are defined in ahci.h, so
we can move the type checking macros there too.

This will make future conversion to OBJECT_DECLARE* easier.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Tested-By: Roman Bolshakov <r.bolshakov@yadro.com>
Message-Id: <20200825192110.3528606-31-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
  • Loading branch information
ehabkost committed Aug 27, 2020
1 parent 2504f86 commit 5e748ff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 0 additions & 5 deletions hw/ide/ahci_internal.h
Expand Up @@ -332,9 +332,6 @@ struct AHCIPCIState {
AHCIState ahci;
};

#define ICH_AHCI(obj) \
OBJECT_CHECK(AHCIPCIState, (obj), TYPE_ICH9_AHCI)

extern const VMStateDescription vmstate_ahci;

#define VMSTATE_AHCI(_field, _state) { \
Expand Down Expand Up @@ -394,6 +391,4 @@ void ahci_uninit(AHCIState *s);

void ahci_reset(AHCIState *s);

#define SYSBUS_AHCI(obj) OBJECT_CHECK(SysbusAHCIState, (obj), TYPE_SYSBUS_AHCI)

#endif /* HW_IDE_AHCI_INTERNAL_H */
3 changes: 3 additions & 0 deletions include/hw/ide/ahci.h
Expand Up @@ -53,11 +53,14 @@ typedef struct AHCIState {
typedef struct AHCIPCIState AHCIPCIState;

#define TYPE_ICH9_AHCI "ich9-ahci"
#define ICH_AHCI(obj) \
OBJECT_CHECK(AHCIPCIState, (obj), TYPE_ICH9_AHCI)

int32_t ahci_get_num_ports(PCIDevice *dev);
void ahci_ide_create_devs(PCIDevice *dev, DriveInfo **hd);

#define TYPE_SYSBUS_AHCI "sysbus-ahci"
#define SYSBUS_AHCI(obj) OBJECT_CHECK(SysbusAHCIState, (obj), TYPE_SYSBUS_AHCI)

typedef struct SysbusAHCIState {
/*< private >*/
Expand Down

0 comments on commit 5e748ff

Please sign in to comment.