2016-08-15 19:43:14 +03:00
|
|
|
/*
|
|
|
|
* 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
|
|
|
|
|
2019-08-12 08:23:51 +03:00
|
|
|
#include "hw/qdev-core.h"
|
2016-08-15 19:44:04 +03:00
|
|
|
#include "monitor/monitor.h"
|
2020-09-03 23:43:22 +03:00
|
|
|
#include "qom/object.h"
|
2016-08-15 19:43:14 +03:00
|
|
|
|
|
|
|
#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"
|
|
|
|
|
2020-09-16 21:25:18 +03:00
|
|
|
OBJECT_DECLARE_TYPE(S390StAttribState, S390StAttribClass, S390_STATTRIB)
|
2016-08-15 19:43:14 +03:00
|
|
|
|
2020-09-03 23:43:22 +03:00
|
|
|
struct S390StAttribState {
|
2016-08-15 19:43:14 +03:00
|
|
|
DeviceState parent_obj;
|
|
|
|
uint64_t migration_cur_gfn;
|
|
|
|
bool migration_enabled;
|
2020-09-03 23:43:22 +03:00
|
|
|
};
|
2016-08-15 19:43:14 +03:00
|
|
|
|
|
|
|
|
2020-09-03 23:43:22 +03:00
|
|
|
struct S390StAttribClass {
|
2016-08-15 19:43:14 +03:00
|
|
|
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);
|
2020-09-03 23:43:22 +03:00
|
|
|
};
|
2016-08-15 19:43:14 +03:00
|
|
|
|
2020-09-03 23:43:22 +03:00
|
|
|
typedef struct QEMUS390StAttribState QEMUS390StAttribState;
|
2020-09-01 00:07:33 +03:00
|
|
|
DECLARE_INSTANCE_CHECKER(QEMUS390StAttribState, QEMU_S390_STATTRIB,
|
|
|
|
TYPE_QEMU_S390_STATTRIB)
|
2016-08-15 19:43:14 +03:00
|
|
|
|
2020-09-03 23:43:22 +03:00
|
|
|
struct QEMUS390StAttribState {
|
2016-08-15 19:43:14 +03:00
|
|
|
S390StAttribState parent_obj;
|
2020-09-03 23:43:22 +03:00
|
|
|
};
|
2016-08-15 19:43:14 +03:00
|
|
|
|
2020-09-03 23:43:22 +03:00
|
|
|
typedef struct KVMS390StAttribState KVMS390StAttribState;
|
2020-09-01 00:07:33 +03:00
|
|
|
DECLARE_INSTANCE_CHECKER(KVMS390StAttribState, KVM_S390_STATTRIB,
|
|
|
|
TYPE_KVM_S390_STATTRIB)
|
2016-08-15 19:43:14 +03:00
|
|
|
|
2020-09-03 23:43:22 +03:00
|
|
|
struct KVMS390StAttribState {
|
2016-08-15 19:43:14 +03:00
|
|
|
S390StAttribState parent_obj;
|
|
|
|
uint64_t still_dirty;
|
|
|
|
uint8_t *incoming_buffer;
|
2020-09-03 23:43:22 +03:00
|
|
|
};
|
2016-08-15 19:43:14 +03:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2016-08-15 19:44:04 +03:00
|
|
|
void hmp_info_cmma(Monitor *mon, const QDict *qdict);
|
|
|
|
void hmp_migrationmode(Monitor *mon, const QDict *qdict);
|
|
|
|
|
2016-08-15 19:43:14 +03:00
|
|
|
#endif /* S390_STORAGE_ATTRIBUTES_H */
|