Skip to content

Commit 5227b32

Browse files
davidhildenbrandhuth
authored andcommitted
hw/s390x/s390-skeys: rename skeys_enabled to skeys_are_enabled
... and make it return a bool instead. Signed-off-by: David Hildenbrand <[email protected]> Reviewed-by: Thomas Huth <[email protected]> Message-Id: <[email protected]> Signed-off-by: Thomas Huth <[email protected]>
1 parent 2162faf commit 5227b32

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

hw/s390x/s390-skeys-kvm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include "qemu/error-report.h"
1616
#include "qemu/module.h"
1717

18-
static int kvm_s390_skeys_enabled(S390SKeysState *ss)
18+
static bool kvm_s390_skeys_are_enabled(S390SKeysState *ss)
1919
{
2020
S390SKeysClass *skeyclass = S390_SKEYS_GET_CLASS(ss);
2121
uint8_t single_key;
@@ -57,7 +57,7 @@ static void kvm_s390_skeys_class_init(ObjectClass *oc, void *data)
5757
S390SKeysClass *skeyclass = S390_SKEYS_CLASS(oc);
5858
DeviceClass *dc = DEVICE_CLASS(oc);
5959

60-
skeyclass->skeys_enabled = kvm_s390_skeys_enabled;
60+
skeyclass->skeys_are_enabled = kvm_s390_skeys_are_enabled;
6161
skeyclass->get_skeys = kvm_s390_skeys_get;
6262
skeyclass->set_skeys = kvm_s390_skeys_set;
6363

hw/s390x/s390-skeys.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ void hmp_info_skeys(Monitor *mon, const QDict *qdict)
8282
int r;
8383

8484
/* Quick check to see if guest is using storage keys*/
85-
if (!skeyclass->skeys_enabled(ss)) {
85+
if (!skeyclass->skeys_are_enabled(ss)) {
8686
monitor_printf(mon, "Error: This guest is not using storage keys\n");
8787
return;
8888
}
@@ -128,7 +128,7 @@ void qmp_dump_skeys(const char *filename, Error **errp)
128128
FILE *f;
129129

130130
/* Quick check to see if guest is using storage keys*/
131-
if (!skeyclass->skeys_enabled(ss)) {
131+
if (!skeyclass->skeys_are_enabled(ss)) {
132132
error_setg(errp, "This guest is not using storage keys - "
133133
"nothing to dump");
134134
return;
@@ -200,9 +200,9 @@ static void qemu_s390_skeys_init(Object *obj)
200200
skeys->keydata = g_malloc0(skeys->key_count);
201201
}
202202

203-
static int qemu_s390_skeys_enabled(S390SKeysState *ss)
203+
static bool qemu_s390_skeys_are_enabled(S390SKeysState *ss)
204204
{
205-
return 1;
205+
return true;
206206
}
207207

208208
static int qemu_s390_skeys_set(S390SKeysState *ss, uint64_t start_gfn,
@@ -250,7 +250,7 @@ static void qemu_s390_skeys_class_init(ObjectClass *oc, void *data)
250250
S390SKeysClass *skeyclass = S390_SKEYS_CLASS(oc);
251251
DeviceClass *dc = DEVICE_CLASS(oc);
252252

253-
skeyclass->skeys_enabled = qemu_s390_skeys_enabled;
253+
skeyclass->skeys_are_enabled = qemu_s390_skeys_are_enabled;
254254
skeyclass->get_skeys = qemu_s390_skeys_get;
255255
skeyclass->set_skeys = qemu_s390_skeys_set;
256256

@@ -277,7 +277,7 @@ static void s390_storage_keys_save(QEMUFile *f, void *opaque)
277277
int error = 0;
278278
uint8_t *buf;
279279

280-
if (!skeyclass->skeys_enabled(ss)) {
280+
if (!skeyclass->skeys_are_enabled(ss)) {
281281
goto end_stream;
282282
}
283283

include/hw/s390x/storage-keys.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ struct S390SKeysState {
2828

2929
struct S390SKeysClass {
3030
DeviceClass parent_class;
31-
int (*skeys_enabled)(S390SKeysState *ks);
31+
bool (*skeys_are_enabled)(S390SKeysState *ks);
3232
int (*get_skeys)(S390SKeysState *ks, uint64_t start_gfn, uint64_t count,
3333
uint8_t *keys);
3434
int (*set_skeys)(S390SKeysState *ks, uint64_t start_gfn, uint64_t count,

0 commit comments

Comments
 (0)