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

Re: [Xen-devel] [PATCH 2/4] tools/libxendevicemodel: extract functions and add a compat layer



On Fri, Feb 17, 2017 at 10:27:07AM +0000, Paul Durrant wrote:
> This patch extracts all functions resulting in a dm_op hypercall from
> libxenctrl and moves them into libxendevicemodel. It also adds a compat
> layer into libxenctrl, which can be selected by defining
> XC_WANT_COMPAT_DEVICEMODEL_API to 1 before including xenctrl.h.
> 
> With this patch the core of libxendevicemodel still uses libxencall to
> issue the dm_op hypercalls, but this is done by calling through code that
> can be modified on a per-OS basis. A subsequent patch will add a Linux-
> specific variant.
> 
> NOTE: After applying this patch the compat layer will need to be enabled
>       in qemu-xen-traditional by applying patch [1].
> 
> [1] 
> http://xenbits.xen.org/gitweb/?p=people/pauldu/qemu-xen-traditional.git;a=commit;h=82d15bd7
> 

This needs an ack from Ian, though that patch itself is trivial.

> +
> +int xendevicemodel_track_dirty_vram(
> +    xendevicemodel_handle *dmod, domid_t domid, uint64_t first_pfn,
> +    uint32_t nr, unsigned long *dirty_bitmap)
> +{
> +    struct xen_dm_op op;
> +    struct xen_dm_op_track_dirty_vram *data;
> +
> +    memset(&op, 0, sizeof(op));
> +
> +    op.op = XEN_DMOP_track_dirty_vram;
> +    data = &op.u.track_dirty_vram;
> +
> +    data->first_pfn = first_pfn;
> +    data->nr = nr;
> +
> +    return xendevicemodel_op(dmod, domid, 2, &op, sizeof(op),
> +                             dirty_bitmap, (nr + 7) / 8);

FYI You might need to rebase -- I will commit a patch from Jan to fix
type promotion at some point.

"libxc: don't pass uninitialized data to do_dm_op()"

Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.