mirror of https://github.com/xemu-project/xemu.git
s390x: add property adapter_routes_max_batch
To make virtio-ccw supports more that 64 virtqueues we will have to increase ADAPTER_ROUTES_MAX_GSI which is currently limiting the number if possible adapter routes. Of course increasing the number of supported routes can break backwards migration. Let us introduce a compatibility property adapter_routes_max_batch so client code can use the some old limit if in compatibility mode and retain the migration compatibility. Signed-off-by: Halil Pasic <pasic@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
This commit is contained in:
parent
797b608638
commit
e61cc6b5c6
|
@ -16,6 +16,8 @@
|
|||
#include "migration/qemu-file.h"
|
||||
#include "hw/s390x/s390_flic.h"
|
||||
#include "trace.h"
|
||||
#include "hw/qdev.h"
|
||||
#include "qapi/error.h"
|
||||
|
||||
S390FLICState *s390_get_flic(void)
|
||||
{
|
||||
|
@ -85,6 +87,30 @@ static void qemu_s390_flic_class_init(ObjectClass *oc, void *data)
|
|||
fsc->clear_io_irq = qemu_s390_clear_io_flic;
|
||||
}
|
||||
|
||||
static Property s390_flic_common_properties[] = {
|
||||
DEFINE_PROP_UINT32("adapter_routes_max_batch", S390FLICState,
|
||||
adapter_routes_max_batch, ADAPTER_ROUTES_MAX_GSI),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
|
||||
static void s390_flic_common_realize(DeviceState *dev, Error **errp)
|
||||
{
|
||||
uint32_t max_batch = S390_FLIC_COMMON(dev)->adapter_routes_max_batch;
|
||||
|
||||
if (max_batch > ADAPTER_ROUTES_MAX_GSI) {
|
||||
error_setg(errp, "flic adapter_routes_max_batch too big"
|
||||
"%d (%d allowed)", max_batch, ADAPTER_ROUTES_MAX_GSI);
|
||||
}
|
||||
}
|
||||
|
||||
static void s390_flic_class_init(ObjectClass *oc, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(oc);
|
||||
|
||||
dc->props = s390_flic_common_properties;
|
||||
dc->realize = s390_flic_common_realize;
|
||||
}
|
||||
|
||||
static const TypeInfo qemu_s390_flic_info = {
|
||||
.name = TYPE_QEMU_S390_FLIC,
|
||||
.parent = TYPE_S390_FLIC_COMMON,
|
||||
|
@ -92,10 +118,12 @@ static const TypeInfo qemu_s390_flic_info = {
|
|||
.class_init = qemu_s390_flic_class_init,
|
||||
};
|
||||
|
||||
|
||||
static const TypeInfo s390_flic_common_info = {
|
||||
.name = TYPE_S390_FLIC_COMMON,
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(S390FLICState),
|
||||
.class_init = s390_flic_class_init,
|
||||
.class_size = sizeof(S390FLICStateClass),
|
||||
};
|
||||
|
||||
|
|
|
@ -32,6 +32,8 @@ typedef struct AdapterRoutes {
|
|||
|
||||
typedef struct S390FLICState {
|
||||
SysBusDevice parent_obj;
|
||||
/* to limit AdapterRoutes.num_routes for compat */
|
||||
uint32_t adapter_routes_max_batch;
|
||||
|
||||
} S390FLICState;
|
||||
|
||||
|
|
Loading…
Reference in New Issue