aboutsummaryrefslogtreecommitdiff
path: root/hw/s390x/s390-skeys.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2020-10-28 06:17:07 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2020-12-10 12:15:09 -0500
commit382a04afa075927d843f11e9fb8c450a084bbfa8 (patch)
tree566397c376216fced1e90480381e5c68becc1684 /hw/s390x/s390-skeys.c
parent82e69054656f86d00b263437ad04395a5f834248 (diff)
s390x: do not use ram_size global
Use the machine properties instead. Cc: Cornelia Huck <cohuck@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/s390x/s390-skeys.c')
-rw-r--r--hw/s390x/s390-skeys.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/hw/s390x/s390-skeys.c b/hw/s390x/s390-skeys.c
index 5cc559fe4c..9a8d60d1d9 100644
--- a/hw/s390x/s390-skeys.c
+++ b/hw/s390x/s390-skeys.c
@@ -109,7 +109,8 @@ void qmp_dump_skeys(const char *filename, Error **errp)
{
S390SKeysState *ss = s390_get_skeys_device();
S390SKeysClass *skeyclass = S390_SKEYS_GET_CLASS(ss);
- const uint64_t total_count = ram_size / TARGET_PAGE_SIZE;
+ MachineState *ms = MACHINE(qdev_get_machine());
+ const uint64_t total_count = ms->ram_size / TARGET_PAGE_SIZE;
uint64_t handled_count = 0, cur_count;
Error *lerr = NULL;
vaddr cur_gfn = 0;
@@ -256,7 +257,8 @@ static void s390_storage_keys_save(QEMUFile *f, void *opaque)
{
S390SKeysState *ss = S390_SKEYS(opaque);
S390SKeysClass *skeyclass = S390_SKEYS_GET_CLASS(ss);
- uint64_t pages_left = ram_size / TARGET_PAGE_SIZE;
+ MachineState *ms = MACHINE(qdev_get_machine());
+ uint64_t pages_left = ms->ram_size / TARGET_PAGE_SIZE;
uint64_t read_count, eos = S390_SKEYS_SAVE_FLAG_EOS;
vaddr cur_gfn = 0;
int error = 0;