[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 02/11] xen: move do_vcpu_op() to arch specific code



Hi Juergen,

On 10/03/2022 07:34, Juergen Gross wrote:
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 351029f8b2..f9de1be43c 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -1570,15 +1570,11 @@ int default_initialise_vcpu(struct vcpu *v, 
XEN_GUEST_HANDLE_PARAM(void) arg)
      return rc;
  }
-long cf_check do_vcpu_op(
-    int cmd, unsigned int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
+long common_vcpu_op(int cmd, struct vcpu *v, XEN_GUEST_HANDLE_PARAM(void) arg)
  {
-    struct domain *d = current->domain;
-    struct vcpu *v;
      long rc = 0;
-
-    if ( (v = domain_vcpu(d, vcpuid)) == NULL )
-        return -ENOENT;
+    struct domain *d = current->domain;

It feels a bit strange to use current when you already have the vcpu in hand. So how about using v->domain?

The rest of the patch looks good to me.

Cheers,

--
Julien Grall



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.