diff options
author | Claudio Imbrenda <imbrenda@linux.vnet.ibm.com> | 2016-08-15 18:43:14 +0200 |
---|---|---|
committer | Christian Borntraeger <borntraeger@de.ibm.com> | 2017-07-14 12:29:47 +0200 |
commit | 903fd80b03243476a97522b79d4a7c8546dfe3df (patch) | |
tree | 2b9df26b330e6e77a71b52e42a6564daf54474dd /include/hw/s390x/storage-attributes.h | |
parent | 3272f0e22fefa4a364cdbdb01975f9178177ab37 (diff) |
s390x/migration: Storage attributes device
Storage attributes device, like we have for storage keys.
Signed-off-by: Claudio Imbrenda <imbrenda@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'include/hw/s390x/storage-attributes.h')
-rw-r--r-- | include/hw/s390x/storage-attributes.h | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/include/hw/s390x/storage-attributes.h b/include/hw/s390x/storage-attributes.h new file mode 100644 index 0000000000..678df958e8 --- /dev/null +++ b/include/hw/s390x/storage-attributes.h @@ -0,0 +1,77 @@ +/* + * s390 storage attributes device + * + * Copyright 2016 IBM Corp. + * Author(s): Claudio Imbrenda <imbrenda@linux.vnet.ibm.com> + * + * This work is licensed under the terms of the GNU GPL, version 2 or (at + * your option) any later version. See the COPYING file in the top-level + * directory. + */ + +#ifndef S390_STORAGE_ATTRIBUTES_H +#define S390_STORAGE_ATTRIBUTES_H + +#include <hw/qdev.h> + +#define TYPE_S390_STATTRIB "s390-storage_attributes" +#define TYPE_QEMU_S390_STATTRIB "s390-storage_attributes-qemu" +#define TYPE_KVM_S390_STATTRIB "s390-storage_attributes-kvm" + +#define S390_STATTRIB(obj) \ + OBJECT_CHECK(S390StAttribState, (obj), TYPE_S390_STATTRIB) + +typedef struct S390StAttribState { + DeviceState parent_obj; + uint64_t migration_cur_gfn; + bool migration_enabled; +} S390StAttribState; + +#define S390_STATTRIB_CLASS(klass) \ + OBJECT_CLASS_CHECK(S390StAttribClass, (klass), TYPE_S390_STATTRIB) +#define S390_STATTRIB_GET_CLASS(obj) \ + OBJECT_GET_CLASS(S390StAttribClass, (obj), TYPE_S390_STATTRIB) + +typedef struct S390StAttribClass { + DeviceClass parent_class; + /* Return value: < 0 on error, or new count */ + int (*get_stattr)(S390StAttribState *sa, uint64_t *start_gfn, + uint32_t count, uint8_t *values); + int (*peek_stattr)(S390StAttribState *sa, uint64_t start_gfn, + uint32_t count, uint8_t *values); + int (*set_stattr)(S390StAttribState *sa, uint64_t start_gfn, + uint32_t count, uint8_t *values); + void (*synchronize)(S390StAttribState *sa); + int (*set_migrationmode)(S390StAttribState *sa, bool value); + int (*get_active)(S390StAttribState *sa); + long long (*get_dirtycount)(S390StAttribState *sa); +} S390StAttribClass; + +#define QEMU_S390_STATTRIB(obj) \ + OBJECT_CHECK(QEMUS390StAttribState, (obj), TYPE_QEMU_S390_STATTRIB) + +typedef struct QEMUS390StAttribState { + S390StAttribState parent_obj; +} QEMUS390StAttribState; + +#define KVM_S390_STATTRIB(obj) \ + OBJECT_CHECK(KVMS390StAttribState, (obj), TYPE_KVM_S390_STATTRIB) + +typedef struct KVMS390StAttribState { + S390StAttribState parent_obj; + uint64_t still_dirty; + uint8_t *incoming_buffer; +} KVMS390StAttribState; + +void s390_stattrib_init(void); + +#ifdef CONFIG_KVM +Object *kvm_s390_stattrib_create(void); +#else +static inline Object *kvm_s390_stattrib_create(void) +{ + return NULL; +} +#endif + +#endif /* S390_STORAGE_ATTRIBUTES_H */ |