mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge remote-tracking branch 'remotes/ehabkost/tags/machine-next-pull-request' into staging
QOM boilerplate cleanup Documentation build fix: * memory: Remove kernel-doc comment marker (Eduardo Habkost) QOM cleanups: * Rename QOM macros for consistency between TYPE_* and type checking constants (Eduardo Habkost) QOM new macros: * OBJECT_DECLARE_* and OBJECT_DEFINE_* macros (Daniel P. Berrangé) * DECLARE_*_CHECKER macros (Eduardo Habkost) Automated QOM boilerplate changes: * Automated changes to use DECLARE_*_CHECKER (Eduardo Habkost * Automated changes to use OBJECT_DECLARE* (Eduardo Habkost) # gpg: Signature made Thu 10 Sep 2020 19:17:49 BST # gpg: using RSA key 5A322FD5ABC4D3DBACCFD1AA2807936F984DC5A6 # gpg: issuer "ehabkost@redhat.com" # gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" [full] # Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF D1AA 2807 936F 984D C5A6 * remotes/ehabkost/tags/machine-next-pull-request: (33 commits) virtio-vga: Use typedef name for instance_size vhost-user-vga: Use typedef name for instance_size xilinx_axienet: Use typedef name for instance_size lpc_ich9: Use typedef name for instance_size omap_intc: Use typedef name for instance_size xilinx_axidma: Use typedef name for instance_size tusb6010: Rename TUSB to TUSB6010 pc87312: Rename TYPE_PC87312_SUPERIO to TYPE_PC87312 vfio: Rename PCI_VFIO to VFIO_PCI usb: Rename USB_SERIAL_DEV to USB_SERIAL sabre: Rename SABRE_DEVICE to SABRE rs6000_mc: Rename RS6000MC_DEVICE to RS6000MC filter-rewriter: Rename FILTER_COLO_REWRITER to FILTER_REWRITER esp: Rename ESP_STATE to ESP ahci: Rename ICH_AHCI to ICH9_AHCI vmgenid: Rename VMGENID_DEVICE to TYPE_VMGENID vfio: Rename VFIO_AP_DEVICE_TYPE to TYPE_VFIO_AP_DEVICE dev-smartcard-reader: Rename CCID_DEV_NAME to TYPE_USB_CCID_DEV ap-device: Rename AP_DEVICE_TYPE to TYPE_AP_DEVICE gpex: Fix type checking function name ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
@@ -2423,6 +2423,11 @@ F: tests/check-qom-interface.c
|
||||
F: tests/check-qom-proplist.c
|
||||
F: tests/test-qdev-global-props.c
|
||||
|
||||
QOM boilerplate conversion script
|
||||
M: Eduardo Habkost <ehabkost@redhat.com>
|
||||
S: Maintained
|
||||
F: scripts/codeconverter/
|
||||
|
||||
QMP
|
||||
M: Markus Armbruster <armbru@redhat.com>
|
||||
S: Supported
|
||||
|
||||
+5
-4
@@ -36,17 +36,18 @@
|
||||
#include "hw/boards.h"
|
||||
#include "qapi/qapi-builtin-visit.h"
|
||||
|
||||
typedef struct TCGState {
|
||||
struct TCGState {
|
||||
AccelState parent_obj;
|
||||
|
||||
bool mttcg_enabled;
|
||||
unsigned long tb_size;
|
||||
} TCGState;
|
||||
};
|
||||
typedef struct TCGState TCGState;
|
||||
|
||||
#define TYPE_TCG_ACCEL ACCEL_CLASS_NAME("tcg")
|
||||
|
||||
#define TCG_STATE(obj) \
|
||||
OBJECT_CHECK(TCGState, (obj), TYPE_TCG_ACCEL)
|
||||
DECLARE_INSTANCE_CHECKER(TCGState, TCG_STATE,
|
||||
TYPE_TCG_ACCEL)
|
||||
|
||||
/* mask must never be zero, except for A20 change call */
|
||||
static void tcg_handle_interrupt(CPUState *cpu, int mask)
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "qapi/error.h"
|
||||
#include "standard-headers/linux/virtio_crypto.h"
|
||||
#include "crypto/cipher.h"
|
||||
#include "qom/object.h"
|
||||
|
||||
|
||||
/**
|
||||
@@ -34,12 +35,11 @@
|
||||
*/
|
||||
#define TYPE_CRYPTODEV_BACKEND_BUILTIN "cryptodev-backend-builtin"
|
||||
|
||||
#define CRYPTODEV_BACKEND_BUILTIN(obj) \
|
||||
OBJECT_CHECK(CryptoDevBackendBuiltin, \
|
||||
(obj), TYPE_CRYPTODEV_BACKEND_BUILTIN)
|
||||
|
||||
typedef struct CryptoDevBackendBuiltin
|
||||
CryptoDevBackendBuiltin;
|
||||
DECLARE_INSTANCE_CHECKER(CryptoDevBackendBuiltin, CRYPTODEV_BACKEND_BUILTIN,
|
||||
TYPE_CRYPTODEV_BACKEND_BUILTIN)
|
||||
|
||||
|
||||
typedef struct CryptoDevBackendBuiltinSession {
|
||||
QCryptoCipher *cipher;
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "sysemu/cryptodev-vhost.h"
|
||||
#include "chardev/char-fe.h"
|
||||
#include "sysemu/cryptodev-vhost-user.h"
|
||||
#include "qom/object.h"
|
||||
|
||||
|
||||
/**
|
||||
@@ -38,12 +39,12 @@
|
||||
*/
|
||||
#define TYPE_CRYPTODEV_BACKEND_VHOST_USER "cryptodev-vhost-user"
|
||||
|
||||
#define CRYPTODEV_BACKEND_VHOST_USER(obj) \
|
||||
OBJECT_CHECK(CryptoDevBackendVhostUser, \
|
||||
(obj), TYPE_CRYPTODEV_BACKEND_VHOST_USER)
|
||||
typedef struct CryptoDevBackendVhostUser CryptoDevBackendVhostUser;
|
||||
DECLARE_INSTANCE_CHECKER(CryptoDevBackendVhostUser, CRYPTODEV_BACKEND_VHOST_USER,
|
||||
TYPE_CRYPTODEV_BACKEND_VHOST_USER)
|
||||
|
||||
|
||||
typedef struct CryptoDevBackendVhostUser {
|
||||
struct CryptoDevBackendVhostUser {
|
||||
CryptoDevBackend parent_obj;
|
||||
|
||||
VhostUserState vhost_user;
|
||||
@@ -51,7 +52,7 @@ typedef struct CryptoDevBackendVhostUser {
|
||||
char *chr_name;
|
||||
bool opened;
|
||||
CryptoDevBackendVhost *vhost_crypto[MAX_CRYPTO_QUEUE_NUM];
|
||||
} CryptoDevBackendVhostUser;
|
||||
};
|
||||
|
||||
static int
|
||||
cryptodev_vhost_user_running(
|
||||
|
||||
+3
-11
@@ -19,21 +19,13 @@
|
||||
#include "qapi/qmp/qerror.h"
|
||||
#include "migration/vmstate.h"
|
||||
#include "trace.h"
|
||||
#include "qom/object.h"
|
||||
|
||||
typedef struct DBusVMState DBusVMState;
|
||||
typedef struct DBusVMStateClass DBusVMStateClass;
|
||||
|
||||
#define TYPE_DBUS_VMSTATE "dbus-vmstate"
|
||||
#define DBUS_VMSTATE(obj) \
|
||||
OBJECT_CHECK(DBusVMState, (obj), TYPE_DBUS_VMSTATE)
|
||||
#define DBUS_VMSTATE_GET_CLASS(obj) \
|
||||
OBJECT_GET_CLASS(DBusVMStateClass, (obj), TYPE_DBUS_VMSTATE)
|
||||
#define DBUS_VMSTATE_CLASS(klass) \
|
||||
OBJECT_CLASS_CHECK(DBusVMStateClass, (klass), TYPE_DBUS_VMSTATE)
|
||||
OBJECT_DECLARE_SIMPLE_TYPE(DBusVMState, dbus_vmstate,
|
||||
DBUS_VMSTATE, ObjectClass)
|
||||
|
||||
struct DBusVMStateClass {
|
||||
ObjectClass parent_class;
|
||||
};
|
||||
|
||||
struct DBusVMState {
|
||||
Object parent;
|
||||
|
||||
@@ -17,11 +17,12 @@
|
||||
#include "sysemu/hostmem.h"
|
||||
#include "sysemu/sysemu.h"
|
||||
#include "qom/object_interfaces.h"
|
||||
|
||||
#define MEMORY_BACKEND_FILE(obj) \
|
||||
OBJECT_CHECK(HostMemoryBackendFile, (obj), TYPE_MEMORY_BACKEND_FILE)
|
||||
#include "qom/object.h"
|
||||
|
||||
typedef struct HostMemoryBackendFile HostMemoryBackendFile;
|
||||
DECLARE_INSTANCE_CHECKER(HostMemoryBackendFile, MEMORY_BACKEND_FILE,
|
||||
TYPE_MEMORY_BACKEND_FILE)
|
||||
|
||||
|
||||
struct HostMemoryBackendFile {
|
||||
HostMemoryBackend parent_obj;
|
||||
|
||||
@@ -17,13 +17,14 @@
|
||||
#include "qemu/memfd.h"
|
||||
#include "qemu/module.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qom/object.h"
|
||||
|
||||
#define TYPE_MEMORY_BACKEND_MEMFD "memory-backend-memfd"
|
||||
|
||||
#define MEMORY_BACKEND_MEMFD(obj) \
|
||||
OBJECT_CHECK(HostMemoryBackendMemfd, (obj), TYPE_MEMORY_BACKEND_MEMFD)
|
||||
|
||||
typedef struct HostMemoryBackendMemfd HostMemoryBackendMemfd;
|
||||
DECLARE_INSTANCE_CHECKER(HostMemoryBackendMemfd, MEMORY_BACKEND_MEMFD,
|
||||
TYPE_MEMORY_BACKEND_MEMFD)
|
||||
|
||||
|
||||
struct HostMemoryBackendMemfd {
|
||||
HostMemoryBackend parent_obj;
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
#include "sysemu/rng.h"
|
||||
#include "qemu/main-loop.h"
|
||||
#include "qemu/guest-random.h"
|
||||
#include "qom/object.h"
|
||||
|
||||
#define RNG_BUILTIN(obj) OBJECT_CHECK(RngBuiltin, (obj), TYPE_RNG_BUILTIN)
|
||||
typedef struct RngBuiltin RngBuiltin;
|
||||
DECLARE_INSTANCE_CHECKER(RngBuiltin, RNG_BUILTIN,
|
||||
TYPE_RNG_BUILTIN)
|
||||
|
||||
typedef struct RngBuiltin {
|
||||
struct RngBuiltin {
|
||||
RngBackend parent;
|
||||
QEMUBH *bh;
|
||||
} RngBuiltin;
|
||||
};
|
||||
|
||||
static void rng_builtin_receive_entropy_bh(void *opaque)
|
||||
{
|
||||
|
||||
+6
-4
@@ -16,17 +16,19 @@
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qmp/qerror.h"
|
||||
#include "qemu/module.h"
|
||||
#include "qom/object.h"
|
||||
|
||||
#define TYPE_RNG_EGD "rng-egd"
|
||||
#define RNG_EGD(obj) OBJECT_CHECK(RngEgd, (obj), TYPE_RNG_EGD)
|
||||
typedef struct RngEgd RngEgd;
|
||||
DECLARE_INSTANCE_CHECKER(RngEgd, RNG_EGD,
|
||||
TYPE_RNG_EGD)
|
||||
|
||||
typedef struct RngEgd
|
||||
{
|
||||
struct RngEgd {
|
||||
RngBackend parent;
|
||||
|
||||
CharBackend chr;
|
||||
char *chr_name;
|
||||
} RngEgd;
|
||||
};
|
||||
|
||||
static void rng_egd_request_entropy(RngBackend *b, RngRequest *req)
|
||||
{
|
||||
|
||||
@@ -42,10 +42,12 @@
|
||||
#include "qapi/qapi-visit-tpm.h"
|
||||
#include "chardev/char-fe.h"
|
||||
#include "trace.h"
|
||||
#include "qom/object.h"
|
||||
|
||||
#define TYPE_TPM_EMULATOR "tpm-emulator"
|
||||
#define TPM_EMULATOR(obj) \
|
||||
OBJECT_CHECK(TPMEmulator, (obj), TYPE_TPM_EMULATOR)
|
||||
typedef struct TPMEmulator TPMEmulator;
|
||||
DECLARE_INSTANCE_CHECKER(TPMEmulator, TPM_EMULATOR,
|
||||
TYPE_TPM_EMULATOR)
|
||||
|
||||
#define TPM_EMULATOR_IMPLEMENTS_ALL_CAPS(S, cap) (((S)->caps & (cap)) == (cap))
|
||||
|
||||
@@ -63,7 +65,7 @@ typedef struct TPMBlobBuffers {
|
||||
TPMSizedBuffer savestate;
|
||||
} TPMBlobBuffers;
|
||||
|
||||
typedef struct TPMEmulator {
|
||||
struct TPMEmulator {
|
||||
TPMBackend parent;
|
||||
|
||||
TPMEmulatorOptions *options;
|
||||
@@ -80,7 +82,7 @@ typedef struct TPMEmulator {
|
||||
unsigned int established_flag_cached:1;
|
||||
|
||||
TPMBlobBuffers state_blobs;
|
||||
} TPMEmulator;
|
||||
};
|
||||
|
||||
struct tpm_error {
|
||||
uint32_t tpm_result;
|
||||
|
||||
@@ -33,10 +33,12 @@
|
||||
#include "qapi/clone-visitor.h"
|
||||
#include "qapi/qapi-visit-tpm.h"
|
||||
#include "trace.h"
|
||||
#include "qom/object.h"
|
||||
|
||||
#define TYPE_TPM_PASSTHROUGH "tpm-passthrough"
|
||||
#define TPM_PASSTHROUGH(obj) \
|
||||
OBJECT_CHECK(TPMPassthruState, (obj), TYPE_TPM_PASSTHROUGH)
|
||||
typedef struct TPMPassthruState TPMPassthruState;
|
||||
DECLARE_INSTANCE_CHECKER(TPMPassthruState, TPM_PASSTHROUGH,
|
||||
TYPE_TPM_PASSTHROUGH)
|
||||
|
||||
/* data structures */
|
||||
struct TPMPassthruState {
|
||||
@@ -53,7 +55,6 @@ struct TPMPassthruState {
|
||||
size_t tpm_buffersize;
|
||||
};
|
||||
|
||||
typedef struct TPMPassthruState TPMPassthruState;
|
||||
|
||||
#define TPM_PASSTHROUGH_DEFAULT_DEVICE "/dev/tpm0"
|
||||
|
||||
|
||||
+6
-3
@@ -33,6 +33,7 @@
|
||||
#include <brlapi.h>
|
||||
#include <brlapi_constants.h>
|
||||
#include <brlapi_keycodes.h>
|
||||
#include "qom/object.h"
|
||||
|
||||
#if 0
|
||||
#define DPRINTF(fmt, ...) \
|
||||
@@ -86,7 +87,7 @@
|
||||
|
||||
#define BUF_SIZE 256
|
||||
|
||||
typedef struct {
|
||||
struct BaumChardev {
|
||||
Chardev parent;
|
||||
|
||||
brlapi_handle_t *brlapi;
|
||||
@@ -100,10 +101,12 @@ typedef struct {
|
||||
uint8_t out_buf_used, out_buf_ptr;
|
||||
|
||||
QEMUTimer *cellCount_timer;
|
||||
} BaumChardev;
|
||||
};
|
||||
typedef struct BaumChardev BaumChardev;
|
||||
|
||||
#define TYPE_CHARDEV_BRAILLE "chardev-braille"
|
||||
#define BAUM_CHARDEV(obj) OBJECT_CHECK(BaumChardev, (obj), TYPE_CHARDEV_BRAILLE)
|
||||
DECLARE_INSTANCE_CHECKER(BaumChardev, BAUM_CHARDEV,
|
||||
TYPE_CHARDEV_BRAILLE)
|
||||
|
||||
/* Let's assume NABCC by default */
|
||||
enum way {
|
||||
|
||||
+6
-3
@@ -33,17 +33,20 @@
|
||||
#include "qemu/qemu-print.h"
|
||||
|
||||
#include "chardev/char-io.h"
|
||||
#include "qom/object.h"
|
||||
|
||||
typedef struct {
|
||||
struct PtyChardev {
|
||||
Chardev parent;
|
||||
QIOChannel *ioc;
|
||||
int read_bytes;
|
||||
|
||||
int connected;
|
||||
GSource *timer_src;
|
||||
} PtyChardev;
|
||||
};
|
||||
typedef struct PtyChardev PtyChardev;
|
||||
|
||||
#define PTY_CHARDEV(obj) OBJECT_CHECK(PtyChardev, (obj), TYPE_CHARDEV_PTY)
|
||||
DECLARE_INSTANCE_CHECKER(PtyChardev, PTY_CHARDEV,
|
||||
TYPE_CHARDEV_PTY)
|
||||
|
||||
static void pty_chr_state(Chardev *chr, int connected);
|
||||
|
||||
|
||||
@@ -29,19 +29,21 @@
|
||||
#include "qemu/base64.h"
|
||||
#include "qemu/module.h"
|
||||
#include "qemu/option.h"
|
||||
#include "qom/object.h"
|
||||
|
||||
/* Ring buffer chardev */
|
||||
|
||||
typedef struct {
|
||||
struct RingBufChardev {
|
||||
Chardev parent;
|
||||
size_t size;
|
||||
size_t prod;
|
||||
size_t cons;
|
||||
uint8_t *cbuf;
|
||||
} RingBufChardev;
|
||||
};
|
||||
typedef struct RingBufChardev RingBufChardev;
|
||||
|
||||
#define RINGBUF_CHARDEV(obj) \
|
||||
OBJECT_CHECK(RingBufChardev, (obj), TYPE_CHARDEV_RINGBUF)
|
||||
DECLARE_INSTANCE_CHECKER(RingBufChardev, RINGBUF_CHARDEV,
|
||||
TYPE_CHARDEV_RINGBUF)
|
||||
|
||||
static size_t ringbuf_count(const Chardev *chr)
|
||||
{
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include "qapi/qapi-visit-sockets.h"
|
||||
|
||||
#include "chardev/char-io.h"
|
||||
#include "qom/object.h"
|
||||
|
||||
/***********************************************************/
|
||||
/* TCP Net console */
|
||||
@@ -53,7 +54,7 @@ typedef enum {
|
||||
TCP_CHARDEV_STATE_CONNECTED,
|
||||
} TCPChardevState;
|
||||
|
||||
typedef struct {
|
||||
struct SocketChardev {
|
||||
Chardev parent;
|
||||
QIOChannel *ioc; /* Client I/O channel */
|
||||
QIOChannelSocket *sioc; /* Client master channel */
|
||||
@@ -84,10 +85,11 @@ typedef struct {
|
||||
bool connect_err_reported;
|
||||
|
||||
QIOTask *connect_task;
|
||||
} SocketChardev;
|
||||
};
|
||||
typedef struct SocketChardev SocketChardev;
|
||||
|
||||
#define SOCKET_CHARDEV(obj) \
|
||||
OBJECT_CHECK(SocketChardev, (obj), TYPE_CHARDEV_SOCKET)
|
||||
DECLARE_INSTANCE_CHECKER(SocketChardev, SOCKET_CHARDEV,
|
||||
TYPE_CHARDEV_SOCKET)
|
||||
|
||||
static gboolean socket_reconnect_timeout(gpointer opaque);
|
||||
static void tcp_chr_telnet_init(Chardev *chr);
|
||||
|
||||
+6
-3
@@ -30,20 +30,23 @@
|
||||
#include "qemu/option.h"
|
||||
|
||||
#include "chardev/char-io.h"
|
||||
#include "qom/object.h"
|
||||
|
||||
/***********************************************************/
|
||||
/* UDP Net console */
|
||||
|
||||
typedef struct {
|
||||
struct UdpChardev {
|
||||
Chardev parent;
|
||||
QIOChannel *ioc;
|
||||
uint8_t buf[CHR_READ_BUF_LEN];
|
||||
int bufcnt;
|
||||
int bufptr;
|
||||
int max_size;
|
||||
} UdpChardev;
|
||||
};
|
||||
typedef struct UdpChardev UdpChardev;
|
||||
|
||||
#define UDP_CHARDEV(obj) OBJECT_CHECK(UdpChardev, (obj), TYPE_CHARDEV_UDP)
|
||||
DECLARE_INSTANCE_CHECKER(UdpChardev, UDP_CHARDEV,
|
||||
TYPE_CHARDEV_UDP)
|
||||
|
||||
/* Called with chr_write_lock held. */
|
||||
static int udp_chr_write(Chardev *chr, const uint8_t *buf, int len)
|
||||
|
||||
@@ -28,18 +28,20 @@
|
||||
#include "qemu/module.h"
|
||||
#include "chardev/char-win.h"
|
||||
#include "chardev/char-win-stdio.h"
|
||||
#include "qom/object.h"
|
||||
|
||||
typedef struct {
|
||||
struct WinStdioChardev {
|
||||
Chardev parent;
|
||||
HANDLE hStdIn;
|
||||
HANDLE hInputReadyEvent;
|
||||
HANDLE hInputDoneEvent;
|
||||
HANDLE hInputThread;
|
||||
uint8_t win_stdio_buf;
|
||||
} WinStdioChardev;
|
||||
};
|
||||
typedef struct WinStdioChardev WinStdioChardev;
|
||||
|
||||
#define WIN_STDIO_CHARDEV(obj) \
|
||||
OBJECT_CHECK(WinStdioChardev, (obj), TYPE_CHARDEV_WIN_STDIO)
|
||||
DECLARE_INSTANCE_CHECKER(WinStdioChardev, WIN_STDIO_CHARDEV,
|
||||
TYPE_CHARDEV_WIN_STDIO)
|
||||
|
||||
static void win_stdio_wait_func(void *opaque)
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#define MUX_BUFFER_SIZE 32 /* Must be a power of 2. */
|
||||
#define MUX_BUFFER_MASK (MUX_BUFFER_SIZE - 1)
|
||||
|
||||
typedef struct MuxChardev {
|
||||
struct MuxChardev {
|
||||
Chardev parent;
|
||||
CharBackend *backends[MAX_MUX];
|
||||
CharBackend chr;
|
||||
@@ -51,9 +51,11 @@ typedef struct MuxChardev {
|
||||
/* Protected by the Chardev chr_write_lock. */
|
||||
int linestart;
|
||||
int64_t timestamps_start;
|
||||
} MuxChardev;
|
||||
};
|
||||
typedef struct MuxChardev MuxChardev;
|
||||
|
||||
#define MUX_CHARDEV(obj) OBJECT_CHECK(MuxChardev, (obj), TYPE_CHARDEV_MUX)
|
||||
DECLARE_INSTANCE_CHECKER(MuxChardev, MUX_CHARDEV,
|
||||
TYPE_CHARDEV_MUX)
|
||||
#define CHARDEV_IS_MUX(chr) \
|
||||
object_dynamic_cast(OBJECT(chr), TYPE_CHARDEV_MUX)
|
||||
|
||||
|
||||
+6
-4
@@ -27,11 +27,12 @@
|
||||
#include "chardev/char.h"
|
||||
#include "ui/console.h"
|
||||
#include "ui/input.h"
|
||||
#include "qom/object.h"
|
||||
|
||||
#define MSMOUSE_LO6(n) ((n) & 0x3f)
|
||||
#define MSMOUSE_HI2(n) (((n) & 0xc0) >> 6)
|
||||
|
||||
typedef struct {
|
||||
struct MouseChardev {
|
||||
Chardev parent;
|
||||
|
||||
QemuInputHandlerState *hs;
|
||||
@@ -40,11 +41,12 @@ typedef struct {
|
||||
bool btnc[INPUT_BUTTON__MAX];
|
||||
uint8_t outbuf[32];
|
||||
int outlen;
|
||||
} MouseChardev;
|
||||
};
|
||||
typedef struct MouseChardev MouseChardev;
|
||||
|
||||
#define TYPE_CHARDEV_MSMOUSE "chardev-msmouse"
|
||||
#define MOUSE_CHARDEV(obj) \
|
||||
OBJECT_CHECK(MouseChardev, (obj), TYPE_CHARDEV_MSMOUSE)
|
||||
DECLARE_INSTANCE_CHECKER(MouseChardev, MOUSE_CHARDEV,
|
||||
TYPE_CHARDEV_MSMOUSE)
|
||||
|
||||
static void msmouse_chr_accept_input(Chardev *chr)
|
||||
{
|
||||
|
||||
+6
-4
@@ -27,19 +27,21 @@
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/module.h"
|
||||
#include "chardev/char.h"
|
||||
#include "qom/object.h"
|
||||
|
||||
#define BUF_SIZE 32
|
||||
|
||||
typedef struct {
|
||||
struct TestdevChardev {
|
||||
Chardev parent;
|
||||
|
||||
uint8_t in_buf[32];
|
||||
int in_buf_used;
|
||||
} TestdevChardev;
|
||||
};
|
||||
typedef struct TestdevChardev TestdevChardev;
|
||||
|
||||
#define TYPE_CHARDEV_TESTDEV "chardev-testdev"
|
||||
#define TESTDEV_CHARDEV(obj) \
|
||||
OBJECT_CHECK(TestdevChardev, (obj), TYPE_CHARDEV_TESTDEV)
|
||||
DECLARE_INSTANCE_CHECKER(TestdevChardev, TESTDEV_CHARDEV,
|
||||
TYPE_CHARDEV_TESTDEV)
|
||||
|
||||
/* Try to interpret a whole incoming packet */
|
||||
static int testdev_eat_packet(TestdevChardev *testdev)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user