qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PULL 07/20] spapr: Add NVDIMM device support


From: Peter Maydell
Subject: Re: [PULL 07/20] spapr: Add NVDIMM device support
Date: Tue, 25 Feb 2020 10:00:01 +0000

On Fri, 21 Feb 2020 at 03:37, David Gibson <address@hidden> wrote:
>
> From: Shivaprasad G Bhat <address@hidden>
>
> Add support for NVDIMM devices for sPAPR. Piggyback on existing nvdimm
> device interface in QEMU to support virtual NVDIMM devices for Power.
> Create the required DT entries for the device (some entries have
> dummy values right now).

> +void spapr_nvdimm_validate_opts(NVDIMMDevice *nvdimm, uint64_t size,
> +                                Error **errp)
> +{
> +    char *uuidstr = NULL;
> +    QemuUUID uuid;
> +
> +    if (size % SPAPR_MINIMUM_SCM_BLOCK_SIZE) {
> +        error_setg(errp, "NVDIMM memory size excluding the label area"
> +                   " must be a multiple of %" PRIu64 "MB",
> +                   SPAPR_MINIMUM_SCM_BLOCK_SIZE / MiB);
> +        return;
> +    }
> +
> +    uuidstr = object_property_get_str(OBJECT(nvdimm), NVDIMM_UUID_PROP, 
> NULL);
> +    qemu_uuid_parse(uuidstr, &uuid);
> +    g_free(uuidstr);
> +
> +    if (qemu_uuid_is_null(&uuid)) {
> +        error_setg(errp, "NVDIMM device requires the uuid to be set");
> +        return;
> +    }
> +}

Hi -- Coverity thinks (CID 1419883) that it's suspicious that
this code doesn't check the return value of qemu_uuid_parse(),
because we check it everywhere else that we call that function
(it can return a failure code if the UUID doesn't validly parse).

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]