Merge remote-tracking branch 'remotes/palmer/tags/riscv-for-master-4.1-sf1-v3' into...
[qemu/ar7.git] / include / hw / s390x / storage-attributes.h
blobd6403a0a7eda212faac5f0613421487a4ff37f64
1 /*
2 * s390 storage attributes device
4 * Copyright 2016 IBM Corp.
5 * Author(s): Claudio Imbrenda <imbrenda@linux.vnet.ibm.com>
7 * This work is licensed under the terms of the GNU GPL, version 2 or (at
8 * your option) any later version. See the COPYING file in the top-level
9 * directory.
12 #ifndef S390_STORAGE_ATTRIBUTES_H
13 #define S390_STORAGE_ATTRIBUTES_H
15 #include "hw/qdev.h"
16 #include "monitor/monitor.h"
18 #define TYPE_S390_STATTRIB "s390-storage_attributes"
19 #define TYPE_QEMU_S390_STATTRIB "s390-storage_attributes-qemu"
20 #define TYPE_KVM_S390_STATTRIB "s390-storage_attributes-kvm"
22 #define S390_STATTRIB(obj) \
23 OBJECT_CHECK(S390StAttribState, (obj), TYPE_S390_STATTRIB)
25 typedef struct S390StAttribState {
26 DeviceState parent_obj;
27 uint64_t migration_cur_gfn;
28 bool migration_enabled;
29 } S390StAttribState;
31 #define S390_STATTRIB_CLASS(klass) \
32 OBJECT_CLASS_CHECK(S390StAttribClass, (klass), TYPE_S390_STATTRIB)
33 #define S390_STATTRIB_GET_CLASS(obj) \
34 OBJECT_GET_CLASS(S390StAttribClass, (obj), TYPE_S390_STATTRIB)
36 typedef struct S390StAttribClass {
37 DeviceClass parent_class;
38 /* Return value: < 0 on error, or new count */
39 int (*get_stattr)(S390StAttribState *sa, uint64_t *start_gfn,
40 uint32_t count, uint8_t *values);
41 int (*peek_stattr)(S390StAttribState *sa, uint64_t start_gfn,
42 uint32_t count, uint8_t *values);
43 int (*set_stattr)(S390StAttribState *sa, uint64_t start_gfn,
44 uint32_t count, uint8_t *values);
45 void (*synchronize)(S390StAttribState *sa);
46 int (*set_migrationmode)(S390StAttribState *sa, bool value);
47 int (*get_active)(S390StAttribState *sa);
48 long long (*get_dirtycount)(S390StAttribState *sa);
49 } S390StAttribClass;
51 #define QEMU_S390_STATTRIB(obj) \
52 OBJECT_CHECK(QEMUS390StAttribState, (obj), TYPE_QEMU_S390_STATTRIB)
54 typedef struct QEMUS390StAttribState {
55 S390StAttribState parent_obj;
56 } QEMUS390StAttribState;
58 #define KVM_S390_STATTRIB(obj) \
59 OBJECT_CHECK(KVMS390StAttribState, (obj), TYPE_KVM_S390_STATTRIB)
61 typedef struct KVMS390StAttribState {
62 S390StAttribState parent_obj;
63 uint64_t still_dirty;
64 uint8_t *incoming_buffer;
65 } KVMS390StAttribState;
67 void s390_stattrib_init(void);
69 #ifdef CONFIG_KVM
70 Object *kvm_s390_stattrib_create(void);
71 #else
72 static inline Object *kvm_s390_stattrib_create(void)
74 return NULL;
76 #endif
78 void hmp_info_cmma(Monitor *mon, const QDict *qdict);
79 void hmp_migrationmode(Monitor *mon, const QDict *qdict);
81 #endif /* S390_STORAGE_ATTRIBUTES_H */