| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
 Re: [PATCH V2 10/23] xen/mm: Make x86's XENMEM_resource_ioreq_server handling common
 
To: Jan Beulich <jbeulich@xxxxxxxx>From: Oleksandr <olekstysh@xxxxxxxxx>Date: Fri, 13 Nov 2020 17:00:14 +0200Cc: Julien Grall <julien.grall@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxxDelivery-date: Fri, 13 Nov 2020 15:00:33 +0000List-id: Xen developer discussion <xen-devel.lists.xenproject.org> 
 
On 12.11.20 13:40, Jan Beulich wrote:
Hi Jan
 
On 15.10.2020 18:44, Oleksandr Tyshchenko wrote:
 
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -30,6 +30,10 @@
  #include <public/memory.h>
  #include <xsm/xsm.h>
+#ifdef CONFIG_IOREQ_SERVER 
+#include <xen/ioreq.h>
+#endif
 
Preferably #ifdef-s would not be needed here. If any, they'd better
live in xen/ioreq.h itself then.
 
ok
 
 
@@ -1045,6 +1049,38 @@ static int acquire_grant_table(struct domain *d, 
unsigned int id,
      return 0;
  }
+#ifdef CONFIG_IOREQ_SERVER
 
To limit the number of #ifdef-s, could this be moved ...
 
+static int acquire_ioreq_server(struct domain *d,
+                                unsigned int id,
+                                unsigned long frame,
+                                unsigned int nr_frames,
+                                xen_pfn_t mfn_list[])
+{
 
... here such that ...
 
@@ -1103,9 +1139,14 @@ static int acquire_resource(
                                   mfn_list);
          break;
+#ifdef CONFIG_IOREQ_SERVER
+    case XENMEM_resource_ioreq_server:
+        rc = acquire_ioreq_server(d, xmar.id, xmar.frame, xmar.nr_frames,
+                                  mfn_list);
+        break;
+#endif
 
... the ones here then can be dropped?
 
I think yes, that would be better.
 
 
      default:
 
Also you'll want to a blank line between the new case statement and
the "default:".
 
ok
--
Regards,
Oleksandr Tyshchenko
 
 |