xen: cpupools: return different error values for cpupool operations

Today there are several different situations in which moving a cpu
from or to a cpupool will return -EBUSY. This makes it hard for the
user to know what he did wrong, as the Xen tools are not capable to
print a detailed error message.

Depending on the situation return different error codes in order to
enable the tools to print useful messages.

Requested-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Dario Faggioli <dario.faggioli@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
This commit is contained in:
Juergen Gross authored and Ian Jackson committed 2016-04-20 14:42:37 +01:00
1 parent d5b6844942
commit 125d4beee0
2 files changed
+6 -6

No files matched your search

+5 -5
View File
@@ -264,7 +264,7 @@ static int cpupool_assign_cpu_locked(struct cpupool *c, unsigned int cpu)
struct domain *d;
if ( (cpupool_moving_cpu == cpu) && (c != cpupool_cpu_moving) )
return -EBUSY;
return -EADDRNOTAVAIL;
ret = schedule_cpu_switch(cpu, c);
if ( ret )
return ret;
@@ -301,7 +301,7 @@ static long cpupool_unassign_cpu_helper(void *info)
spin_lock(&cpupool_lock);
if ( c != cpupool_cpu_moving )
{
ret = -EBUSY;
ret = -EADDRNOTAVAIL;
goto out;
}
@@ -366,7 +366,7 @@ static int cpupool_unassign_cpu(struct cpupool *c, unsigned int cpu)
c->cpupool_id, cpu);
spin_lock(&cpupool_lock);
ret = -EBUSY;
ret = -EADDRNOTAVAIL;
if ( (cpupool_moving_cpu != -1) && (cpu != cpupool_moving_cpu) )
goto out;
if ( cpumask_test_cpu(cpu, &cpupool_locked_cpus) )
@@ -537,7 +537,7 @@ static int cpupool_cpu_add(unsigned int cpu)
*/
static int cpupool_cpu_remove(unsigned int cpu)
{
int ret = -EBUSY;
int ret = -ENODEV;
spin_lock(&cpupool_lock);
if ( system_state == SYS_STATE_suspend )
@@ -647,7 +647,7 @@ int cpupool_do_sysctl(struct xen_sysctl_cpupool_op *op)
ret = -EINVAL;
if ( cpu >= nr_cpu_ids )
goto addcpu_out;
ret = -EBUSY;
ret = -ENODEV;
if ( !cpumask_test_cpu(cpu, &cpupool_free_cpus) )
goto addcpu_out;
c = cpupool_find_by_id(op->cpupool_id);
+1 -1
View File
@@ -688,7 +688,7 @@ int cpu_disable_scheduler(unsigned int cpu)
{
/* The vcpu is temporarily pinned, can't move it. */
vcpu_schedule_unlock_irqrestore(lock, flags, v);
ret = -EBUSY;
ret = -EADDRINUSE;
break;
}
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.