lkml.org 
[lkml]   [2009]   [Mar]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 20/24] xen/sys/hypervisor: change writable_pt to features
    Date
    From: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>

    /sys/hypervisor/properties/writable_pt was misnamed. Rename to features,
    expressed as a bit array in hex.

    Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
    ---
    drivers/xen/sys-hypervisor.c | 41 ++++++++++++++++++++++++++---------------
    1 files changed, 26 insertions(+), 15 deletions(-)

    diff --git a/drivers/xen/sys-hypervisor.c b/drivers/xen/sys-hypervisor.c
    index cb29d1c..1267d6f 100644
    --- a/drivers/xen/sys-hypervisor.c
    +++ b/drivers/xen/sys-hypervisor.c
    @@ -293,37 +293,48 @@ static ssize_t pagesize_show(struct hyp_sysfs_attr *attr, char *buffer)

    HYPERVISOR_ATTR_RO(pagesize);

    -/* eventually there will be several more features to export */
    static ssize_t xen_feature_show(int index, char *buffer)
    {
    - int ret = -ENOMEM;
    - struct xen_feature_info *info;
    + ssize_t ret;
    + struct xen_feature_info info;

    - info = kmalloc(sizeof(struct xen_feature_info), GFP_KERNEL);
    - if (info) {
    - info->submap_idx = index;
    - ret = HYPERVISOR_xen_version(XENVER_get_features, info);
    - if (!ret)
    - ret = sprintf(buffer, "%d\n", info->submap);
    - kfree(info);
    - }
    + info.submap_idx = index;
    + ret = HYPERVISOR_xen_version(XENVER_get_features, &info);
    + if (!ret)
    + ret = sprintf(buffer, "%08x", info.submap);

    return ret;
    }

    -static ssize_t writable_pt_show(struct hyp_sysfs_attr *attr, char *buffer)
    +static ssize_t features_show(struct hyp_sysfs_attr *attr, char *buffer)
    {
    - return xen_feature_show(XENFEAT_writable_page_tables, buffer);
    + ssize_t len;
    + int i;
    +
    + len = 0;
    + for (i = XENFEAT_NR_SUBMAPS-1; i >= 0; i--) {
    + int ret = xen_feature_show(i, buffer + len);
    + if (ret < 0) {
    + if (len == 0)
    + len = ret;
    + break;
    + }
    + len += ret;
    + }
    + if (len > 0)
    + buffer[len++] = '\n';
    +
    + return len;
    }

    -HYPERVISOR_ATTR_RO(writable_pt);
    +HYPERVISOR_ATTR_RO(features);

    static struct attribute *xen_properties_attrs[] = {
    &capabilities_attr.attr,
    &changeset_attr.attr,
    &virtual_start_attr.attr,
    &pagesize_attr.attr,
    - &writable_pt_attr.attr,
    + &features_attr.attr,
    NULL
    };

    --
    1.6.0.6


    \
     
     \ /
      Last update: 2009-03-13 09:23    [W:0.021 / U:0.788 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site