Fix a couple of bogus dom0_op names:

setdomaininfo -> setvcpucontext
  pincpudomain  -> setvcpuaffinity

Signed-off-by: Keir Fraser <keir@xensource.com>
This commit is contained in:
kaf24@firebug.cl.cam.ac.uk committed 2006-01-06 12:53:19 +01:00
1 parent 7b1872e6f5
commit 5becda0913
19 files changed
+103 -104

No files matched your search

+6 -6
View File
@@ -119,8 +119,8 @@ xendebug_get_context (int xc_handle, uint32_t domid, uint32_t vcpu)
if ( !ctxt->valid[vcpu] )
{
if ( (rc = xc_domain_get_vcpu_context(xc_handle, domid, vcpu,
&ctxt->context[vcpu])) )
if ( (rc = xc_vcpu_getcontext(xc_handle, domid, vcpu,
&ctxt->context[vcpu])) )
return NULL;
ctxt->valid[vcpu] = true;
@@ -139,10 +139,10 @@ xendebug_set_context (int xc_handle, domain_context_p ctxt, uint32_t vcpu)
return -EINVAL;
op.interface_version = DOM0_INTERFACE_VERSION;
op.cmd = DOM0_SETDOMAININFO;
op.u.setdomaininfo.domain = ctxt->domid;
op.u.setdomaininfo.vcpu = vcpu;
op.u.setdomaininfo.ctxt = &ctxt->context[vcpu];
op.cmd = DOM0_SETVCPUCONTEXT;
op.u.setvcpucontext.domain = ctxt->domid;
op.u.setvcpucontext.vcpu = vcpu;
op.u.setvcpucontext.ctxt = &ctxt->context[vcpu];
if ( (rc = mlock(&ctxt->context[vcpu], sizeof(vcpu_guest_context_t))) )
return rc;
+1 -1
View File
@@ -55,7 +55,7 @@ xc_domain_dumpcore(int xc_handle,
}
for (i = 0; i < info.max_vcpu_id; i++)
if (xc_domain_get_vcpu_context(xc_handle, domid,
if (xc_vcpu_getcontext(xc_handle, domid,
i, &ctxt[nr_vcpus]) == 0)
nr_vcpus++;
+21 -21
View File
@@ -58,16 +58,16 @@ int xc_domain_destroy(int xc_handle,
return do_dom0_op(xc_handle, &op);
}
int xc_domain_pincpu(int xc_handle,
uint32_t domid,
int vcpu,
cpumap_t cpumap)
int xc_vcpu_setaffinity(int xc_handle,
uint32_t domid,
int vcpu,
cpumap_t cpumap)
{
DECLARE_DOM0_OP;
op.cmd = DOM0_PINCPUDOMAIN;
op.u.pincpudomain.domain = (domid_t)domid;
op.u.pincpudomain.vcpu = vcpu;
op.u.pincpudomain.cpumap = cpumap;
op.cmd = DOM0_SETVCPUAFFINITY;
op.u.setvcpuaffinity.domain = (domid_t)domid;
op.u.setvcpuaffinity.vcpu = vcpu;
op.u.setvcpuaffinity.cpumap = cpumap;
return do_dom0_op(xc_handle, &op);
}
@@ -155,7 +155,7 @@ int xc_domain_getinfolist(int xc_handle,
return ret;
}
int xc_domain_get_vcpu_context(int xc_handle,
int xc_vcpu_getcontext(int xc_handle,
uint32_t domid,
uint32_t vcpu,
vcpu_guest_context_t *ctxt)
@@ -345,10 +345,10 @@ int xc_domain_sethandle(int xc_handle, uint32_t domid,
return do_dom0_op(xc_handle, &op);
}
int xc_domain_get_vcpu_info(int xc_handle,
uint32_t domid,
uint32_t vcpu,
xc_vcpuinfo_t *info)
int xc_vcpu_getinfo(int xc_handle,
uint32_t domid,
uint32_t vcpu,
xc_vcpuinfo_t *info)
{
int rc;
DECLARE_DOM0_OP;
@@ -380,18 +380,18 @@ int xc_domain_ioport_permission(int xc_handle,
return do_dom0_op(xc_handle, &op);
}
int xc_domain_setinfo(int xc_handle,
uint32_t domid,
uint32_t vcpu,
vcpu_guest_context_t *ctxt)
int xc_vcpu_setcontext(int xc_handle,
uint32_t domid,
uint32_t vcpu,
vcpu_guest_context_t *ctxt)
{
dom0_op_t op;
int rc;
op.cmd = DOM0_SETDOMAININFO;
op.u.setdomaininfo.domain = domid;
op.u.setdomaininfo.vcpu = vcpu;
op.u.setdomaininfo.ctxt = ctxt;
op.cmd = DOM0_SETVCPUCONTEXT;
op.u.setvcpucontext.domain = domid;
op.u.setvcpucontext.vcpu = vcpu;
op.u.setvcpucontext.ctxt = ctxt;
if ( (rc = mlock(ctxt, sizeof(*ctxt))) != 0 )
return rc;
+5 -5
View File
@@ -664,7 +664,7 @@ int xc_vmx_build(int xc_handle,
goto error_out;
}
if ( xc_domain_get_vcpu_context(xc_handle, domid, 0, ctxt) ){
if ( xc_vcpu_getcontext(xc_handle, domid, 0, ctxt) ){
PERROR("Could not get vcpu context");
goto error_out;
}
@@ -688,11 +688,11 @@ int xc_vmx_build(int xc_handle,
memset( &launch_op, 0, sizeof(launch_op) );
launch_op.u.setdomaininfo.domain = (domid_t)domid;
launch_op.u.setdomaininfo.vcpu = 0;
launch_op.u.setdomaininfo.ctxt = ctxt;
launch_op.u.setvcpucontext.domain = (domid_t)domid;
launch_op.u.setvcpucontext.vcpu = 0;
launch_op.u.setvcpucontext.ctxt = ctxt;
launch_op.cmd = DOM0_SETDOMAININFO;
launch_op.cmd = DOM0_SETVCPUCONTEXT;
rc = do_dom0_op(xc_handle, &launch_op);
return rc;
+5 -5
View File
@@ -794,7 +794,7 @@ int xc_linux_build(int xc_handle,
goto error_out;
}
if ( xc_domain_get_vcpu_context(xc_handle, domid, 0, ctxt) )
if ( xc_vcpu_getcontext(xc_handle, domid, 0, ctxt) )
{
PERROR("Could not get vcpu context");
goto error_out;
@@ -897,11 +897,11 @@ int xc_linux_build(int xc_handle,
memset( &launch_op, 0, sizeof(launch_op) );
launch_op.u.setdomaininfo.domain = (domid_t)domid;
launch_op.u.setdomaininfo.vcpu = 0;
launch_op.u.setdomaininfo.ctxt = ctxt;
launch_op.u.setvcpucontext.domain = (domid_t)domid;
launch_op.u.setvcpucontext.vcpu = 0;
launch_op.u.setvcpucontext.ctxt = ctxt;
launch_op.cmd = DOM0_SETDOMAININFO;
launch_op.cmd = DOM0_SETVCPUCONTEXT;
rc = xc_dom0_op(xc_handle, &launch_op);
return rc;
+5 -5
View File
@@ -171,7 +171,7 @@ int xc_linux_restore(int xc_handle, int io_fd,
/* Only have to worry about vcpu 0 even for SMP */
if (xc_domain_get_vcpu_context( xc_handle, dom, 0, &ctxt)) {
if (xc_vcpu_getcontext( xc_handle, dom, 0, &ctxt)) {
ERR("Could not get vcpu context");
goto out;
}
@@ -735,10 +735,10 @@ int xc_linux_restore(int xc_handle, int io_fd,
DPRINTF("Domain ready to be built.\n");
op.cmd = DOM0_SETDOMAININFO;
op.u.setdomaininfo.domain = (domid_t)dom;
op.u.setdomaininfo.vcpu = 0;
op.u.setdomaininfo.ctxt = &ctxt;
op.cmd = DOM0_SETVCPUCONTEXT;
op.u.setvcpucontext.domain = (domid_t)dom;
op.u.setvcpucontext.vcpu = 0;
op.u.setvcpucontext.ctxt = &ctxt;
rc = xc_dom0_op(xc_handle, &op);
if (rc != 0) {
+2 -2
View File
@@ -382,7 +382,7 @@ static int suspend_and_state(int xc_handle, int io_fd, int dom,
return -1;
}
if ( xc_domain_get_vcpu_context(xc_handle, dom, 0 /* XXX */, ctxt))
if ( xc_vcpu_getcontext(xc_handle, dom, 0 /* XXX */, ctxt))
ERR("Could not get vcpu context");
@@ -643,7 +643,7 @@ int xc_linux_save(int xc_handle, int io_fd, uint32_t dom, uint32_t max_iters,
}
/* Only have to worry about vcpu 0 even for SMP */
if (xc_domain_get_vcpu_context(xc_handle, dom, 0, &ctxt)) {
if (xc_vcpu_getcontext(xc_handle, dom, 0, &ctxt)) {
ERR("Could not get vcpu context");
goto out;
}
+1 -1
View File
@@ -74,7 +74,7 @@ unsigned long xc_translate_foreign_address(int xc_handle, uint32_t dom,
#define pt_levels 4
#endif
if (xc_domain_get_vcpu_context(xc_handle, dom, vcpu, &ctx) != 0) {
if (xc_vcpu_getcontext(xc_handle, dom, vcpu, &ctx) != 0) {
fprintf(stderr, "failed to retreive vcpu context\n");
goto out;
}
+6 -7
View File
@@ -33,7 +33,7 @@ fetch_regs(int xc_handle, int cpu, int *online)
if (online)
*online = 0;
if ( !(regs_valid & (1 << cpu)) ) {
retval = xc_domain_get_vcpu_context(xc_handle, current_domid,
retval = xc_vcpu_getcontext(xc_handle, current_domid,
cpu, &ctxt[cpu]);
if ( retval )
goto done;
@@ -43,8 +43,7 @@ fetch_regs(int xc_handle, int cpu, int *online)
if ( online == NULL )
goto done;
retval = xc_domain_get_vcpu_info(xc_handle, current_domid,
cpu, &info);
retval = xc_vcpu_getinfo(xc_handle, current_domid, cpu, &info);
*online = info.online;
done:
@@ -395,7 +394,7 @@ xc_ptrace(
case PTRACE_SETREGS:
SET_XC_REGS(((struct gdb_regs *)data), ctxt[cpu].user_regs);
retval = xc_domain_setinfo(xc_handle, current_domid, cpu, &ctxt[cpu]);
retval = xc_vcpu_setcontext(xc_handle, current_domid, cpu, &ctxt[cpu]);
if (retval)
goto error_out;
break;
@@ -405,7 +404,7 @@ xc_ptrace(
* during single-stepping - but that just seems retarded
*/
ctxt[cpu].user_regs.eflags |= PSL_T;
retval = xc_domain_setinfo(xc_handle, current_domid, cpu, &ctxt[cpu]);
retval = xc_vcpu_setcontext(xc_handle, current_domid, cpu, &ctxt[cpu]);
if ( retval )
{
perror("dom0 op failed");
@@ -423,8 +422,8 @@ xc_ptrace(
/* Clear trace flag */
if ( ctxt[cpu].user_regs.eflags & PSL_T ) {
ctxt[cpu].user_regs.eflags &= ~PSL_T;
retval = xc_domain_setinfo(xc_handle, current_domid,
cpu, &ctxt[cpu]);
retval = xc_vcpu_setcontext(xc_handle, current_domid,
cpu, &ctxt[cpu]);
if ( retval ) {
perror("dom0 op failed");
goto error_out;
+5 -5
View File
@@ -651,7 +651,7 @@ int xc_vmx_build(int xc_handle,
goto error_out;
}
if ( xc_domain_get_vcpu_context(xc_handle, domid, 0, ctxt) )
if ( xc_vcpu_getcontext(xc_handle, domid, 0, ctxt) )
{
PERROR("Could not get vcpu context");
goto error_out;
@@ -708,11 +708,11 @@ int xc_vmx_build(int xc_handle,
memset( &launch_op, 0, sizeof(launch_op) );
launch_op.u.setdomaininfo.domain = (domid_t)domid;
launch_op.u.setdomaininfo.vcpu = 0;
launch_op.u.setdomaininfo.ctxt = ctxt;
launch_op.u.setvcpucontext.domain = (domid_t)domid;
launch_op.u.setvcpucontext.vcpu = 0;
launch_op.u.setvcpucontext.ctxt = ctxt;
launch_op.cmd = DOM0_SETDOMAININFO;
launch_op.cmd = DOM0_SETVCPUCONTEXT;
rc = xc_dom0_op(xc_handle, &launch_op);
return rc;
+15 -15
View File
@@ -181,10 +181,11 @@ int xc_domain_unpause(int xc_handle,
*/
int xc_domain_destroy(int xc_handle,
uint32_t domid);
int xc_domain_pincpu(int xc_handle,
uint32_t domid,
int vcpu,
cpumap_t cpumap);
int xc_vcpu_setaffinity(int xc_handle,
uint32_t domid,
int vcpu,
cpumap_t cpumap);
/**
* This function will return information about one or more domains. It is
@@ -208,7 +209,7 @@ int xc_domain_getinfo(int xc_handle,
/**
* This function will set the vcpu context for the specified domain.
* This function will set the execution context for the specified vcpu.
*
* @parm xc_handle a handle to an open hypervisor interface
* @parm domid the domain to set the vcpu context for
@@ -216,10 +217,10 @@ int xc_domain_getinfo(int xc_handle,
* @parm ctxt pointer to the the cpu context with the values to set
* @return the number of domains enumerated or -1 on error
*/
int xc_domain_setinfo(int xc_handle,
uint32_t domid,
uint32_t vcpu,
vcpu_guest_context_t *ctxt);
int xc_vcpu_setcontext(int xc_handle,
uint32_t domid,
uint32_t vcpu,
vcpu_guest_context_t *ctxt);
/**
* This function will return information about one or more domains, using a
* single hypercall. The domain information will be stored into the supplied
@@ -249,17 +250,16 @@ int xc_domain_getinfolist(int xc_handle,
* domain
* @return 0 on success, -1 on failure
*/
int xc_domain_get_vcpu_context(int xc_handle,
int xc_vcpu_getcontext(int xc_handle,
uint32_t domid,
uint32_t vcpu,
vcpu_guest_context_t *ctxt);
typedef dom0_getvcpuinfo_t xc_vcpuinfo_t;
int xc_domain_get_vcpu_info(int xc_handle,
uint32_t domid,
uint32_t vcpu,
xc_vcpuinfo_t *info);
int xc_vcpu_getinfo(int xc_handle,
uint32_t domid,
uint32_t vcpu,
xc_vcpuinfo_t *info);
int xc_domain_setcpuweight(int xc_handle,
uint32_t domid,
+7 -7
View File
@@ -135,9 +135,9 @@ static PyObject *pyxc_domain_destroy(XcObject *self, PyObject *args)
}
static PyObject *pyxc_domain_pincpu(XcObject *self,
PyObject *args,
PyObject *kwds)
static PyObject *pyxc_vcpu_setaffinity(XcObject *self,
PyObject *args,
PyObject *kwds)
{
uint32_t dom;
int vcpu = 0, i;
@@ -157,7 +157,7 @@ static PyObject *pyxc_domain_pincpu(XcObject *self,
cpumap |= (cpumap_t)1 << PyInt_AsLong(PyList_GetItem(cpulist, i));
}
if ( xc_domain_pincpu(self->xc_handle, dom, vcpu, cpumap) != 0 )
if ( xc_vcpu_setaffinity(self->xc_handle, dom, vcpu, cpumap) != 0 )
return PyErr_SetFromErrno(xc_error);
Py_INCREF(zero);
@@ -297,7 +297,7 @@ static PyObject *pyxc_vcpu_getinfo(XcObject *self,
&dom, &vcpu) )
return NULL;
rc = xc_domain_get_vcpu_info(self->xc_handle, dom, vcpu, &info);
rc = xc_vcpu_getinfo(self->xc_handle, dom, vcpu, &info);
if ( rc < 0 )
return PyErr_SetFromErrno(xc_error);
@@ -890,8 +890,8 @@ static PyMethodDef pyxc_methods[] = {
" dom [int]: Identifier of domain to be destroyed.\n\n"
"Returns: [int] 0 on success; -1 on error.\n" },
{ "domain_pincpu",
(PyCFunction)pyxc_domain_pincpu,
{ "vcpu_setaffinity",
(PyCFunction)pyxc_vcpu_setaffinity,
METH_VARARGS | METH_KEYWORDS, "\n"
"Pin a VCPU to a specified set CPUs.\n"
" dom [int]: Identifier of domain to which VCPU belongs.\n"
+1 -1
View File
@@ -443,7 +443,7 @@ class XendDomain:
cpumap = map(lambda x: int(x),
cpumap.replace("[", "").replace("]", "").split(","))
try:
return xc.domain_pincpu(dominfo.getDomid(), vcpu, cpumap)
return xc.vcpu_setaffinity(dominfo.getDomid(), vcpu, cpumap)
except Exception, ex:
raise XendError(str(ex))
+1 -1
View File
@@ -1179,7 +1179,7 @@ class XendDomainInfo:
for v in range(0, self.info['max_vcpu_id']+1):
# pincpu takes a list of ints
cpu = [ int( cpus[v % len(cpus)] ) ]
xc.domain_pincpu(self.domid, v, cpu)
xc.vcpu_setaffinity(self.domid, v, cpu)
m = self.image.getDomainMemory(self.info['memory'] * 1024)
balloon.free(m)
+2 -2
View File
@@ -380,10 +380,10 @@ void dump_ctx(int vcpu)
exit(-1);
}
ret = xc_domain_get_vcpu_context(xc_handle, domid, vcpu, &ctx);
ret = xc_vcpu_getcontext(xc_handle, domid, vcpu, &ctx);
if (ret < 0) {
xc_domain_unpause(xc_handle, domid);
perror("xc_domain_get_vcpu_context");
perror("xc_vcpu_getcontext");
exit(-1);
}
+10 -10
View File
@@ -110,13 +110,13 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
switch ( op->cmd )
{
case DOM0_SETDOMAININFO:
case DOM0_SETVCPUCONTEXT:
{
struct domain *d = find_domain_by_id(op->u.setdomaininfo.domain);
struct domain *d = find_domain_by_id(op->u.setvcpucontext.domain);
ret = -ESRCH;
if ( d != NULL )
{
ret = set_info_guest(d, &op->u.setdomaininfo);
ret = set_info_guest(d, &op->u.setvcpucontext);
put_domain(d);
}
}
@@ -284,9 +284,9 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
}
break;
case DOM0_PINCPUDOMAIN:
case DOM0_SETVCPUAFFINITY:
{
domid_t dom = op->u.pincpudomain.domain;
domid_t dom = op->u.setvcpuaffinity.domain;
struct domain *d = find_domain_by_id(dom);
struct vcpu *v;
@@ -296,15 +296,15 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
break;
}
if ( (op->u.pincpudomain.vcpu >= MAX_VIRT_CPUS) ||
!d->vcpu[op->u.pincpudomain.vcpu] )
if ( (op->u.setvcpuaffinity.vcpu >= MAX_VIRT_CPUS) ||
!d->vcpu[op->u.setvcpuaffinity.vcpu] )
{
ret = -EINVAL;
put_domain(d);
break;
}
v = d->vcpu[op->u.pincpudomain.vcpu];
v = d->vcpu[op->u.setvcpuaffinity.vcpu];
if ( v == NULL )
{
ret = -ESRCH;
@@ -320,9 +320,9 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
}
memcpy(cpus_addr(v->cpu_affinity),
&op->u.pincpudomain.cpumap,
&op->u.setvcpuaffinity.cpumap,
min((int)BITS_TO_LONGS(NR_CPUS),
(int)sizeof(op->u.pincpudomain.cpumap)));
(int)sizeof(op->u.setvcpuaffinity.cpumap)));
vcpu_pause(v);
vcpu_migrate_cpu(v, first_cpu(v->cpu_affinity));
+3 -3
View File
@@ -357,11 +357,11 @@ void domain_unpause_by_systemcontroller(struct domain *d)
* of domains other than domain 0. ie. the domains that are being built by
* the userspace dom0 domain builder.
*/
int set_info_guest(struct domain *d, dom0_setdomaininfo_t *setdomaininfo)
int set_info_guest(struct domain *d, dom0_setvcpucontext_t *setvcpucontext)
{
int rc = 0;
struct vcpu_guest_context *c = NULL;
unsigned long vcpu = setdomaininfo->vcpu;
unsigned long vcpu = setvcpucontext->vcpu;
struct vcpu *v;
if ( (vcpu >= MAX_VIRT_CPUS) || ((v = d->vcpu[vcpu]) == NULL) )
@@ -374,7 +374,7 @@ int set_info_guest(struct domain *d, dom0_setdomaininfo_t *setdomaininfo)
return -ENOMEM;
rc = -EFAULT;
if ( copy_from_user(c, setdomaininfo->ctxt, sizeof(*c)) == 0 )
if ( copy_from_user(c, setvcpucontext->ctxt, sizeof(*c)) == 0 )
rc = arch_set_info_guest(v, c);
xfree(c);
+6 -6
View File
@@ -94,14 +94,14 @@ typedef struct {
xen_domain_handle_t handle;
} dom0_getdomaininfo_t;
#define DOM0_SETDOMAININFO 13
#define DOM0_SETVCPUCONTEXT 13
typedef struct {
/* IN variables. */
domid_t domain;
uint32_t vcpu;
/* IN/OUT parameters */
vcpu_guest_context_t *ctxt;
} dom0_setdomaininfo_t;
} dom0_setvcpucontext_t;
#define DOM0_MSR 15
typedef struct {
@@ -163,13 +163,13 @@ typedef struct {
/*
* Set which physical cpus a vcpu can execute on.
*/
#define DOM0_PINCPUDOMAIN 20
#define DOM0_SETVCPUAFFINITY 20
typedef struct {
/* IN variables. */
domid_t domain;
uint32_t vcpu;
cpumap_t cpumap;
} dom0_pincpudomain_t;
} dom0_setvcpuaffinity_t;
/* Get trace buffers machine base address */
#define DOM0_TBUFCONTROL 21
@@ -436,13 +436,13 @@ typedef struct {
dom0_getmemlist_t getmemlist;
dom0_schedctl_t schedctl;
dom0_adjustdom_t adjustdom;
dom0_setdomaininfo_t setdomaininfo;
dom0_setvcpucontext_t setvcpucontext;
dom0_getdomaininfo_t getdomaininfo;
dom0_getpageframeinfo_t getpageframeinfo;
dom0_msr_t msr;
dom0_settime_t settime;
dom0_readconsole_t readconsole;
dom0_pincpudomain_t pincpudomain;
dom0_setvcpuaffinity_t setvcpuaffinity;
dom0_tbufcontrol_t tbufcontrol;
dom0_physinfo_t physinfo;
dom0_sched_id_t sched_id;
+1 -1
View File
@@ -221,7 +221,7 @@ extern int construct_dom0(
unsigned long image_start, unsigned long image_len,
unsigned long initrd_start, unsigned long initrd_len,
char *cmdline);
extern int set_info_guest(struct domain *d, dom0_setdomaininfo_t *);
extern int set_info_guest(struct domain *d, dom0_setvcpucontext_t *);
struct domain *find_domain_by_id(domid_t dom);
extern void domain_destruct(struct domain *d);
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.