On Mon, 11 Jun 2018 14:16:50 +0200 David Hildenbrand <da...@redhat.com> wrote:
> "size" should not be queried before the device was realized. Let' make > that explicit. > > Signed-off-by: David Hildenbrand <da...@redhat.com> It's generic property getter, it should work even before realize is called. if issues described in 5/11 are properly fixed, this patch won't be needed. So drop this patch > --- > hw/mem/pc-dimm.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c > index 86fbcf2d0c..5294734529 100644 > --- a/hw/mem/pc-dimm.c > +++ b/hw/mem/pc-dimm.c > @@ -166,6 +166,12 @@ static void pc_dimm_get_size(Object *obj, Visitor *v, > const char *name, > PCDIMMDevice *dimm = PC_DIMM(obj); > PCDIMMDeviceClass *ddc = PC_DIMM_GET_CLASS(obj); > > + if (!DEVICE(obj)->realized) { > + error_setg(errp, "Property \"%s\" not accessible before realized", > + name); > + return; > + } > + > mr = ddc->get_memory_region(dimm, errp); > if (!mr) { > return;