|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v2] xen: handle domain_shutdown() return values
On 20.11.2026 17:08, Mykola Kvach wrote:
> --- a/xen/arch/x86/compat.c
> +++ b/xen/arch/x86/compat.c
> @@ -39,14 +39,11 @@ long do_sched_op_compat(int cmd, unsigned long arg)
> case SCHEDOP_shutdown:
> TRACE_TIME(TRC_SCHED_SHUTDOWN,
> current->domain->domain_id, current->vcpu_id, arg);
> - domain_shutdown(current->domain, (u8)arg);
> - break;
> + return domain_shutdown(current->domain, (u8)arg);
>
> default:
> return -ENOSYS;
> }
> -
> - return 0;
> }
I'm not quite sure whether we ought to alter the behavior of this (very)
legacy hypercall. The case you mention in the description (shim) post-
dates this hypercall's replacement by many years.
> @@ -1750,12 +1754,16 @@ void hvm_triple_fault(void)
> struct vcpu *v = current;
> struct domain *d = v->domain;
> u8 reason = d->arch.hvm.params[HVM_PARAM_TRIPLE_FAULT_REASON];
> + int rc;
>
> gprintk(XENLOG_ERR,
> "Triple fault - invoking HVM shutdown action %d\n",
> reason);
> vcpu_show_execution_state(v);
> - domain_shutdown(d, reason);
> + rc = domain_shutdown(d, reason);
> + if ( unlikely(rc < 0) )
> + gprintk(XENLOG_ERR, "Failed to shut down after triple fault: %d\n",
> + rc);
> }
Here and ...
> --- a/xen/common/sched/core.c
> +++ b/xen/common/sched/core.c
> @@ -1588,6 +1588,7 @@ static void cf_check domain_watchdog_timeout(void *data)
> */
> struct domain *d = _p((unsigned long)data & PAGE_MASK);
> unsigned int id = (unsigned long)data & ~PAGE_MASK;
> + int rc;
>
> BUILD_BUG_ON(alignof(*d) < PAGE_SIZE);
>
> @@ -1595,7 +1596,10 @@ static void cf_check domain_watchdog_timeout(void
> *data)
> return;
>
> printk("Watchdog timer %u fired for %pd\n", id, d);
> - domain_shutdown(d, SHUTDOWN_watchdog);
> + rc = domain_shutdown(d, SHUTDOWN_watchdog);
> + if ( unlikely(rc) )
> + printk(XENLOG_G_ERR "Watchdog timer %u failed to shut down %pd:
> %d\n",
> + id, d, rc);
> }
... here I wonder whether we shouldn't go farther than merely logging a
message. If the domain can't be "shut down", maybe it should be crashed?
Jan
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |