On 07/16/2018 11:32 PM, junyan...@gmx.com 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