qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 5/7 V10] mem/nvdimm: ensure write persistence to


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH 5/7 V10] mem/nvdimm: ensure write persistence to PMEM in label emulation
Date: Tue, 17 Jul 2018 10:00:30 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

On 07/16/2018 11:32 PM, address@hidden wrote:
> +++ b/stubs/pmem.c
> @@ -0,0 +1,19 @@
> +/*
> + * Stubs for libpmem.
> + *
> + * Copyright (c) 2018 Intel Corporation.
> + *
> + * Author: Haozhong Zhang <address@hidden>
> + *
> + * This work is licensed under the terms of the GNU GPL, version 2 or later.
> + * See the COPYING file in the top-level directory.
> + */
> +
> +#include <string.h>
> +
> +#include "qemu/pmem.h"
> +
> +void *pmem_memcpy_persist(void *pmemdest, const void *src, size_t len)
> +{
> +    return memcpy(pmemdest, src, len);
> +}
> 

This will never be used, because you prevented is_pmem
from being set when creating the device.

I also know that you want to avoid an ifdef within nvdimm_write_label_data, but
a more obvious solution might be in qemu/pmem.h,

#ifdef CONFIG_LIBPMEM
#include <libpmem.h>
#else  /* !CONFIG_LIBPMEM */

static inline void *
pmem_memcpy_persist(void *pmemdest, const void *src, size_t len)
{
    g_assert_not_reached();
}

#endif /* CONFIG_LIBPMEM */



r~



reply via email to

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