|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-devel] Use of the "has_shutdown_code" code in v3.2
We're using the V3.2 of the hypervisor code and while tracking down a
suspend/resume bug, I came across the following code that caused me to
ask myself whether the "has_shutdown_code" should also be cleared when
the domain is resumed.
This hypercall will not set a new shutdown reason if the domain already
has the flag set to 1. So, if a domain is suspended and then resumed,
the flag would remain set.
case SCHEDOP_shutdown_code:
{
struct sched_shutdown sched_shutdown;
ret = -EFAULT;
if ( copy_from_guest(&sched_shutdown, arg, 1) )
break;
ret = 0;
TRACE_3D(TRC_SCHED_SHUTDOWN_CODE,
current->domain->domain_id, current->vcpu_id,
sched_shutdown.reason);
spin_lock(¤t->domain->shutdown_lock);
if ( !current->domain->has_shutdown_code )
{
current->domain->shutdown_code = (u8)sched_shutdown.reason;
current->domain->has_shutdown_code = 1;
}
So I asked myself, should the domain_resume routine also clear that
flag?
void domain_resume(struct domain *d)
{
struct vcpu *v;
/*
* Some code paths assume that shutdown status does not get reset
under
* their feet (e.g., some assertions make this assumption).
*/
domain_pause(d);
spin_lock(&d->shutdown_lock);
d->is_shutting_down = d->is_shut_down = 0; <---- should it also
include: "d->has_shutdown_code = "
for_each_vcpu ( d, v )
{
if ( v->paused_for_shutdown )
vcpu_unpause(v);
v->paused_for_shutdown = 0;
}
spin_unlock(&d->shutdown_lock);
domain_unpause(d);
}
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
|
|
|
|