xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Ian Jackson <ian.jackson@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: wei.liu2@citrix.com, ian.campbell@citrix.com,
	stefano.stabellini@eu.citrix.com,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	samuel.thibault@ens-lyon.org, Eric Shelton <eshelton@pobox.com>
Subject: [PATCH for-4.6 v3] libxl: set stub domain size based on VRAM size
Date: Mon, 13 Jul 2015 11:24:19 +0100	[thread overview]
Message-ID: <1436783059-5798-1-git-send-email-ian.jackson@eu.citrix.com> (raw)
In-Reply-To: <21923.37235.852479.985765@mariner.uk.xensource.com>

From: Eric Shelton <eshelton@pobox.com>

Allocate additional memory to the stub domain for qemu-traditional if
more than 4 MB is assigned to the video adapter to avoid out of memory
condition for QEMU.

Signed-off-by: Eric Shelton <eshelton@pobox.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
v3: Use max_t() instead
v2: Use max()
---
 tools/libxl/libxl_dm.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index ad434f0..f700f9a 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -1095,7 +1095,8 @@ void libxl__spawn_stub_dm(libxl__egc *egc, libxl__stub_dm_spawn_state *sdss)
     libxl_domain_build_info_init_type(&dm_config->b_info, LIBXL_DOMAIN_TYPE_PV);
 
     dm_config->b_info.max_vcpus = 1;
-    dm_config->b_info.max_memkb = 32 * 1024;
+    dm_config->b_info.max_memkb = 28 * 1024 +
+        max_t(uint64_t, guest_config->b_info.video_memkb, 4096);
     dm_config->b_info.target_memkb = dm_config->b_info.max_memkb;
 
     dm_config->b_info.u.pv.features = "";
-- 
1.7.10.4

  reply	other threads:[~2015-07-13 10:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-10 22:14 [PATCH V2 0/1] libxl: set stub domain size based on VRAM size Eric Shelton
2015-07-10 22:14 ` [PATCH V2 1/1] " Eric Shelton
2015-07-10 22:27   ` Samuel Thibault
2015-07-13 10:16   ` Ian Jackson
2015-07-13 10:22     ` Ian Jackson
2015-07-13 10:24       ` Ian Jackson [this message]
2015-07-13 10:37       ` Ian Campbell
2015-07-13 11:14         ` Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1436783059-5798-1-git-send-email-ian.jackson@eu.citrix.com \
    --to=ian.jackson@eu.citrix.com \
    --cc=eshelton@pobox.com \
    --cc=ian.campbell@citrix.com \
    --cc=samuel.thibault@ens-lyon.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).