[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [PATCH v1 06/11] pc-dimm: don't allow to access "size" be
From: |
David Gibson |
Subject: |
Re: [Qemu-ppc] [PATCH v1 06/11] pc-dimm: don't allow to access "size" before the device was realized |
Date: |
Tue, 12 Jun 2018 11:08:57 +1000 |
User-agent: |
Mutt/1.10.0 (2018-05-17) |
On Mon, Jun 11, 2018 at 02:16:50PM +0200, David Hildenbrand wrote:
> "size" should not be queried before the device was realized. Let' make
> that explicit.
>
> Signed-off-by: David Hildenbrand <address@hidden>
Reviewed-by: David Gibson <address@hidden>
> ---
> 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;
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
signature.asc
Description: PGP signature
- [Qemu-ppc] [PATCH v1 01/11] pc-dimm: remove leftover "struct pc_dimms_capacity", (continued)
- [Qemu-ppc] [PATCH v1 01/11] pc-dimm: remove leftover "struct pc_dimms_capacity", David Hildenbrand, 2018/06/11
- [Qemu-ppc] [PATCH v1 02/11] nvdimm: no need to overwrite get_vmstate_memory_region(), David Hildenbrand, 2018/06/11
- [Qemu-ppc] [PATCH v1 03/11] pc: factor out pc-dimm checks into pc_dimm_pre_plug(), David Hildenbrand, 2018/06/11
- [Qemu-ppc] [PATCH v1 06/11] pc-dimm: don't allow to access "size" before the device was realized, David Hildenbrand, 2018/06/11
- Re: [Qemu-ppc] [PATCH v1 06/11] pc-dimm: don't allow to access "size" before the device was realized,
David Gibson <=
- Re: [Qemu-ppc] [Qemu-devel] [PATCH v1 06/11] pc-dimm: don't allow to access "size" before the device was realized, Igor Mammedov, 2018/06/13
- Re: [Qemu-ppc] [Qemu-devel] [PATCH v1 06/11] pc-dimm: don't allow to access "size" before the device was realized, Igor Mammedov, 2018/06/14
- Re: [Qemu-ppc] [Qemu-devel] [PATCH v1 06/11] pc-dimm: don't allow to access "size" before the device was realized, David Hildenbrand, 2018/06/14
- Re: [Qemu-ppc] [Qemu-devel] [PATCH v1 06/11] pc-dimm: don't allow to access "size" before the device was realized, Igor Mammedov, 2018/06/15
- Re: [Qemu-ppc] [Qemu-devel] [PATCH v1 06/11] pc-dimm: don't allow to access "size" before the device was realized, David Hildenbrand, 2018/06/15
- Re: [Qemu-ppc] [Qemu-devel] [PATCH v1 06/11] pc-dimm: don't allow to access "size" before the device was realized, Igor Mammedov, 2018/06/15
[Qemu-ppc] [PATCH v1 05/11] spapr: move memory hotplug size check into plug code, David Hildenbrand, 2018/06/11