aboutsummaryrefslogtreecommitdiff
path: root/hw/s390x/css.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2024-05-09 19:00:34 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2024-05-10 15:45:15 +0200
commita55ae46683f289c46a0c0a807dbb89229a1e00cd (patch)
tree72e18acd2a2d6e9c0988dd6a51dbcc3d52fff371 /hw/s390x/css.c
parent9d1b0f5bf515a0dd8e4174d9f3aca2c549727ef6 (diff)
s390: move css_migration_enabled from machine to css.c
The CSS subsystem uses global variables, just face the truth and use a variable also for whether the CSS vmstate is in use; remove the indirection of fetching it from the machine type, which makes the TCG code depend unnecessarily on the virtio-ccw machine. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-ID: <20240509170044.190795-4-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/s390x/css.c')
-rw-r--r--hw/s390x/css.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/hw/s390x/css.c b/hw/s390x/css.c
index 295530963a..b2d5327dbf 100644
--- a/hw/s390x/css.c
+++ b/hw/s390x/css.c
@@ -23,6 +23,8 @@
#include "hw/s390x/s390-virtio-ccw.h"
#include "hw/s390x/s390-ccw.h"
+bool css_migration_enabled = true;
+
typedef struct CrwContainer {
CRW crw;
QTAILQ_ENTRY(CrwContainer) sibling;
@@ -180,7 +182,7 @@ static const VMStateDescription vmstate_orb = {
static bool vmstate_schdev_orb_needed(void *opaque)
{
- return css_migration_enabled();
+ return css_migration_enabled;
}
static const VMStateDescription vmstate_schdev_orb = {
@@ -388,7 +390,7 @@ static int subch_dev_post_load(void *opaque, int version_id)
css_subch_assign(s->cssid, s->ssid, s->schid, s->devno, s);
}
- if (css_migration_enabled()) {
+ if (css_migration_enabled) {
/* No compat voodoo to do ;) */
return 0;
}
@@ -412,7 +414,9 @@ static int subch_dev_post_load(void *opaque, int version_id)
void css_register_vmstate(void)
{
- vmstate_register(NULL, 0, &vmstate_css, &channel_subsys);
+ if (css_migration_enabled) {
+ vmstate_register(NULL, 0, &vmstate_css, &channel_subsys);
+ }
}
IndAddr *get_indicator(hwaddr ind_addr, int len)