2 * Virtual Machine coreinfo device
4 * Copyright (C) 2017 Red Hat, Inc.
6 * Authors: Marc-André Lureau <marcandre.lureau@redhat.com>
8 * This work is licensed under the terms of the GNU GPL, version 2 or later.
9 * See the COPYING file in the top-level directory.
17 #define VMCOREINFO_DEVICE "vmcoreinfo"
18 #define VMCOREINFO(obj) OBJECT_CHECK(VMCoreInfoState, (obj), VMCOREINFO_DEVICE)
20 #define VMCOREINFO_FORMAT_NONE 0x0
21 #define VMCOREINFO_FORMAT_ELF 0x1
23 /* all fields are little-endian */
24 typedef struct FWCfgVMCoreInfo
{
25 uint16_t host_format
; /* set on reset */
26 uint16_t guest_format
;
29 } QEMU_PACKED FWCfgVMCoreInfo
;
31 typedef struct VMCoreInfoState
{
32 DeviceClass parent_obj
;
35 FWCfgVMCoreInfo vmcoreinfo
;
38 /* returns NULL unless there is exactly one device */
39 static inline VMCoreInfoState
*vmcoreinfo_find(void)
41 Object
*o
= object_resolve_path_type("", VMCOREINFO_DEVICE
, NULL
);
43 return o
? VMCOREINFO(o
) : NULL
;