Re: [PATCH V2 17/23] kvm tools: Add ability to map guest RAM from hugetlbfs

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

 



On Fri, Dec 9, 2011 at 8:55 AM, Matt Evans <matt@xxxxxxxxxx> wrote:
> Add a --hugetlbfs commandline option to give a path to hugetlbfs-map guest
> memory (down in kvm__arch_init()).  For x86, guest memory is a normal
> ANON mmap() if this option is not provided, otherwise a hugetlbfs mmap.
>
> Signed-off-by: Matt Evans <matt@xxxxxxxxxx>

> +void *mmap_hugetlbfs(const char *htlbfs_path, u64 size)
> +{
> +       char mpath[PATH_MAX];
> +       int fd;
> +       int r;
> +       struct statfs sfs;
> +       void *addr;
> +
> +       do {
> +               /*
> +                * QEMU seems to work around this returning EINTR...  Let's do
> +                * that too.
> +                */
> +               r = statfs(htlbfs_path, &sfs);
> +       } while (r && errno == EINTR);

Can this really happen? What about EAGAIN? The retry logic really
wants to live in tools/kvm/read-write.c as a xstatfs() wrapper if we
do need this.

                            Pekka
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux