qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Xiao Guangrong <guangrong.xiao@gmail.com>
To: Haozhong Zhang <haozhong.zhang@intel.com>, qemu-devel@nongnu.org
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	Igor Mammedov <imammedo@redhat.com>,
	Stefan Hajnoczi <stefanha@gmail.com>,
	Dan Williams <dan.j.williams@intel.com>
Subject: Re: [Qemu-devel] [RESEND PATCH 1/2] nvdimm: warn if the backend is not a DAX device
Date: Thu, 1 Jun 2017 20:00:34 +0800	[thread overview]
Message-ID: <14af6adf-9076-1368-75bb-8001ed667150@gmail.com> (raw)
In-Reply-To: <20170526023213.18741-1-haozhong.zhang@intel.com>



On 05/26/2017 10:32 AM, Haozhong Zhang wrote:

> +static void nvdimm_check_dax(HostMemoryBackend *hostmem)
> +{
> +    char *mem_path =
> +        object_property_get_str(OBJECT(hostmem), "mem-path", NULL);
> +    char *dev_name = NULL, *sysfs_path = NULL;
> +    bool is_dax = false;
> +
> +    if (!mem_path) {
> +        goto out;
> +    }
> +
> +    if (!g_str_has_prefix(mem_path, "/dev/dax")) {
> +        goto out;
> +    }
> +
> +    dev_name = mem_path + strlen("/dev/");
> +    sysfs_path = g_strdup_printf("/sys/class/dax/%s", dev_name);
> +    if (access(sysfs_path, F_OK)) {
> +        goto out;
> +    }
> +
> +    is_dax = true;
> +

So only dax raw disk has write-persistence guaranty, a pre-allocated
file which locates on a DAX-enabled filesystem can not?

  parent reply	other threads:[~2017-06-01 12:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-26  2:32 [Qemu-devel] [RESEND PATCH 1/2] nvdimm: warn if the backend is not a DAX device Haozhong Zhang
2017-05-26  2:32 ` [Qemu-devel] [RESEND PATCH 2/2] hostmem-file: add an attribute 'align' to set its alignment Haozhong Zhang
2017-05-26  6:39   ` Marc-André Lureau
     [not found]     ` <20170526065132.ayapfebbft5lyigd@hz-desktop>
2017-05-26  7:05       ` Marc-André Lureau
     [not found]         ` <20170526071654.kxcqflvpo2tvcrvu@hz-desktop>
2017-05-26 14:24           ` Dan Williams
2017-05-26 18:55             ` Eduardo Habkost
2017-05-26 20:50               ` Dan Williams
2017-05-27  1:04               ` Haozhong Zhang
2017-05-30 12:17             ` Paolo Bonzini
2017-05-30 19:16               ` Dan Williams
2017-05-26  3:34 ` [Qemu-devel] [RESEND PATCH 1/2] nvdimm: warn if the backend is not a DAX device Dan Williams
2017-05-26  4:30   ` Haozhong Zhang
2017-05-26 14:28     ` Dan Williams
2017-05-26 14:38   ` Daniel P. Berrange
2017-05-26 15:25     ` Dan Williams
2017-05-27  1:13       ` Haozhong Zhang
2017-05-30  9:20       ` Daniel P. Berrange
2017-05-30 11:41         ` Dan Williams
2017-06-01 12:00 ` Xiao Guangrong [this message]
2017-06-01 13:53   ` Dan Williams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=14af6adf-9076-1368-75bb-8001ed667150@gmail.com \
    --to=guangrong.xiao@gmail.com \
    --cc=dan.j.williams@intel.com \
    --cc=haozhong.zhang@intel.com \
    --cc=imammedo@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).