monitor: Fix tracepoint crash on JSON syntax error
[qemu/armbru.git] / include / hw / misc / vmcoreinfo.h
blobc3aa8565451458899e777717480877df00e90ad1
1 /*
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.
12 #ifndef VMCOREINFO_H
13 #define VMCOREINFO_H
15 #include "hw/qdev.h"
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;
27 uint32_t size;
28 uint64_t paddr;
29 } QEMU_PACKED FWCfgVMCoreInfo;
31 typedef struct VMCoreInfoState {
32 DeviceClass parent_obj;
34 bool has_vmcoreinfo;
35 FWCfgVMCoreInfo vmcoreinfo;
36 } VMCoreInfoState;
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;
46 #endif