File xen.trc-domain_has_ioreq_server.patch of Package xen

From: Olaf Hering <olaf@aepfle.de>
Date: Thu, 15 Jun 2023 08:32:21 +0000
Subject: trc domain_has_ioreq_server

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 xen/common/ioreq.c | 13 +++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

--- a/xen/common/ioreq.c
+++ b/xen/common/ioreq.c
@@ -130,29 +130,38 @@ static ioreq_t *get_ioreq(struct ioreq_server *s, struct vcpu *v)
     return &p->vcpu_ioreq[v->vcpu_id];
 }
 
 /*
  * This should only be used when d == current->domain or when they're
  * distinct and d is paused. Otherwise the result is stale before
  * the caller can inspect it.
  */
 bool domain_has_ioreq_server(const struct domain *d)
 {
     const struct ioreq_server *s;
     unsigned int id;
+    bool has_ioreq = false;
+    trc_domain_has_ioreq_server_t trc = {
+        .d = d->domain_id,
+    };
 
     FOR_EACH_IOREQ_SERVER(d, id, s)
-        return true;
+    {
+        has_ioreq = true;
+        break;
+    }
 
-    return false;
+    trc.has_ioreq = has_ioreq;
+    TRACE_trc(TRC_IOREQ_domain_has_ioreq_server);
+    return has_ioreq;
 }
 
 static struct ioreq_vcpu *get_pending_vcpu(const struct vcpu *v,
                                            struct ioreq_server **srvp)
 {
     struct domain *d = v->domain;
     struct ioreq_server *s;
     unsigned int id;
 
     FOR_EACH_IOREQ_SERVER(d, id, s)
     {
         struct ioreq_vcpu *sv;
openSUSE Build Service is sponsored by