ia64/xen-unstable

changeset 7395:27d7c7f226f4

Extend VCPUINFO dom0_op to return status information about
run state of the VCPU. VCPUCONTEXT returns info about
hotplugged VCPUs.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Sat Oct 15 08:52:22 2005 +0100 (2005-10-15)
parents 26862e5458eb
children fd7b8b051466
files xen/common/dom0_ops.c xen/include/public/dom0_ops.h
line diff
     1.1 --- a/xen/common/dom0_ops.c	Sat Oct 15 08:33:19 2005 +0100
     1.2 +++ b/xen/common/dom0_ops.c	Sat Oct 15 08:52:22 2005 +0100
     1.3 @@ -447,7 +447,7 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
     1.4  
     1.5          ret = -ESRCH;
     1.6          v = d->vcpu[op->u.getvcpucontext.vcpu];
     1.7 -        if ( (v == NULL) || test_bit(_VCPUF_down, &v->vcpu_flags) )
     1.8 +        if ( (v == NULL) || !test_bit(_VCPUF_initialised, &v->vcpu_flags) )
     1.9              goto getvcpucontext_out;
    1.10  
    1.11          ret = -ENOMEM;
    1.12 @@ -490,10 +490,12 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
    1.13              goto getvcpuinfo_out;
    1.14  
    1.15          ret = -ESRCH;
    1.16 -        v = d->vcpu[op->u.getvcpuinfo.vcpu];
    1.17 -        if ( (v == NULL) || test_bit(_VCPUF_down, &v->vcpu_flags) )
    1.18 +        if ( (v = d->vcpu[op->u.getvcpuinfo.vcpu]) == NULL )
    1.19              goto getvcpuinfo_out;
    1.20  
    1.21 +        op->u.getvcpuinfo.online   = !test_bit(_VCPUF_down, &v->vcpu_flags);
    1.22 +        op->u.getvcpuinfo.blocked  = test_bit(_VCPUF_blocked, &v->vcpu_flags);
    1.23 +        op->u.getvcpuinfo.running  = test_bit(_VCPUF_running, &v->vcpu_flags);
    1.24          op->u.getvcpuinfo.cpu_time = v->cpu_time;
    1.25          op->u.getvcpuinfo.cpu      = v->processor;
    1.26          op->u.getvcpuinfo.cpumap   = v->cpumap;
     2.1 --- a/xen/include/public/dom0_ops.h	Sat Oct 15 08:33:19 2005 +0100
     2.2 +++ b/xen/include/public/dom0_ops.h	Sat Oct 15 08:52:22 2005 +0100
     2.3 @@ -365,7 +365,10 @@ typedef struct {
     2.4      domid_t  domain;                  /* domain to be affected */
     2.5      uint16_t vcpu;                    /* vcpu # */
     2.6      /* OUT variables. */
     2.7 -    uint64_t cpu_time;                 
     2.8 +    uint8_t  online;                  /* currently online (not hotplugged)? */
     2.9 +    uint8_t  blocked;                 /* blocked waiting for an event? */
    2.10 +    uint8_t  running;                 /* currently scheduled on its CPU? */
    2.11 +    uint64_t cpu_time;                /* total cpu time consumed (ns) */
    2.12      uint32_t cpu;                     /* current mapping   */
    2.13      cpumap_t cpumap;                  /* allowable mapping */
    2.14  } dom0_getvcpuinfo_t;