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

Re: [PATCH v6 1/4] tools/init-xenstore-domain: Replace variable MB() usage


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Jason Andryuk <jason.andryuk@xxxxxxx>
  • Date: Thu, 4 Apr 2024 09:55:31 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=zfrwydNOu9rGKoycIz0VPxZJX5Ttm5fjIwbiFDyUay0=; b=fFj/W4N7peLhaDCcJSWbKdv1UAg02T3Akmqu5eScXnpiPYtjTTjKrFYVf06we544inMo9rRs1EHDLpkBXIbwIOJJKJkhyoTME4QZcJvAYWhC/H7US5m6Lrv2F/oYcv6iKmQNT92upYuUnLzsfC2VpF68gV34vfauDWm8apvyg1rb3HvHia4YP/GGw4c0T75By9kAiMK3/TTdiJFBEqzGYNSvBa9zsBzFl0i1Id9Fcg8eeSRGsAEHI3Kir/CNx/rI5sbaX8CK/M4NXBqsRuEmr6j2W7BAUoGcFmT/krzSjtigfBQMcvBwSp9ZEqjb9zF7+vX/WTuY8FUpB6XjIkhnxA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iwSD+Ll2Wu4PGqt+j37NktE7nmReOaeQ+nWOw7fmke3sFoC49InXZo9hf1fmjREXQiNvpiTqvmQ+M2rOmzmCqQls4glo/aV8TXGDTg3HGpbhedZQRzw0RpxtOIgn3+5k5z/rz2jxC+eP2kWUSmy0sfblh5z3c9NA721lyx5EivfyJeR0OIUntYk6hekz+orBvw/irhX1ggvyQfEwHt2LvJ7tNrkoEAmrYMFBDvJGAQBCzpHwBCmJWehn9Vbs4/CLXIfv+4+xBYxL5JgUALIXsKkKnUjzkVJJ1K5zYyWcGm8BePXBtvzfUapQCTEUITF8bu1xP+atSrA/g4UEsXk1FQ==
  • Cc: Juergen Gross <jgross@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 04 Apr 2024 13:56:00 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 2024-04-04 06:09, Jan Beulich wrote:
On 27.03.2024 22:50, Jason Andryuk wrote:
@@ -36,6 +35,11 @@ static xc_evtchn_port_or_error_t console_evtchn;
  static xentoollog_level minmsglevel = XTL_PROGRESS;
  static void *logger;
+static inline uint64_t mb_to_bytes(int mem)
+{
+       return (uint64_t)mem << 20;
+}

While committing I noticed tab indentation here, which looked to be in
conflict with ...

  static struct option options[] = {
      { "kernel", 1, NULL, 'k' },
      { "memory", 1, NULL, 'm' },
@@ -76,8 +80,8 @@ static int build(xc_interface *xch)
      int rv, xs_fd;
      struct xc_dom_image *dom = NULL;
      int limit_kb = (maxmem ? : memory) * 1024 + X86_HVM_NR_SPECIAL_PAGES * 4;
-    uint64_t mem_size = MB(memory);
-    uint64_t max_size = MB(maxmem ? : memory);
+    uint64_t mem_size = mb_to_bytes(memory);
+    uint64_t max_size = mb_to_bytes(maxmem ? : memory);
      struct e820entry e820[3];
      struct xen_domctl_createdomain config = {
          .ssidref = SECINITSID_DOMU,

... everything else in the file. Hence I took the liberty to adjust this.

Thank you for catching that and fixing it up.

-Jason



 


Rackspace

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