All of lore.kernel.org
 help / color / mirror / Atom feed
From: Don Slutz <dslutz@verizon.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	xen-devel@lists.xen.org
Cc: ian.jackson@eu.citrix.com, wei.liu2@citrix.com,
	ian.campbell@citrix.com, mlatimer@suse.com
Subject: Re: [PATCH] libxl: remove LIBXL_MAXMEM_CONSTANT
Date: Wed, 25 Feb 2015 15:56:34 -0500	[thread overview]
Message-ID: <54EE3702.7060803@terremark.com> (raw)
In-Reply-To: <1424876845-29669-1-git-send-email-stefano.stabellini@eu.citrix.com>

On 02/25/15 10:07, Stefano Stabellini wrote:
> LIBXL_MAXMEM_CONSTANT is used to increase the maxmem setting for a
> domain by a constant amount. As it is not clear the reason why we should
> be doing this, remove the constant.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> CC: mlatimer@suse.com
> CC: ian.campbell@citrix.com
> ---

I think that some sort of link to commit 901230f in QEMU:

----
commit 901230fd8ce053cc21312a2eca2f3ba9f1d103f2
Author: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date:   Wed Dec 3 08:15:19 2014 -0500

    xen-hvm: increase maxmem before calling xc_domain_populate_physmap

    Increase maxmem before calling xc_domain_populate_physmap_exact to
    avoid the risk of running out of guest memory. This way we can also
    avoid complex memory calculations in libxl at domain construction
    time.

    This patch fixes an abort() when assigning more than 4 NICs to a VM.

    upstream-commit-id: c1d322e6048796296555dd36fdd102d7fa2f50bf

    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Signed-off-by: Don Slutz <dslutz@verizon.com>
----

Because after this patch and without a "correct" QEMU, the number of
e1000 NICs a guest can use is less then 4.

   -Don Slutz


>  tools/libxl/libxl.c          |    9 ++++-----
>  tools/libxl/libxl_dom.c      |    3 +--
>  tools/libxl/libxl_internal.h |    1 -
>  3 files changed, 5 insertions(+), 8 deletions(-)
> 
> diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
> index b9a1941..9556a92 100644
> --- a/tools/libxl/libxl.c
> +++ b/tools/libxl/libxl.c
> @@ -4572,11 +4572,11 @@ int libxl_domain_setmaxmem(libxl_ctx *ctx, uint32_t domid, uint32_t max_memkb)
>          LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "memory_static_max must be greater than or or equal to memory_dynamic_max\n");
>          goto out;
>      }
> -    rc = xc_domain_setmaxmem(ctx->xch, domid, max_memkb + LIBXL_MAXMEM_CONSTANT);
> +    rc = xc_domain_setmaxmem(ctx->xch, domid, max_memkb);
>      if (rc != 0) {
>          LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
>                  "xc_domain_setmaxmem domid=%d memkb=%d failed "
> -                "rc=%d\n", domid, max_memkb + LIBXL_MAXMEM_CONSTANT, rc);
> +                "rc=%d\n", domid, max_memkb, rc);
>          goto out;
>      }
>  
> @@ -4796,12 +4796,11 @@ retry_transaction:
>  
>      if (enforce) {
>          memorykb = new_target_memkb + videoram;
> -        rc = xc_domain_setmaxmem(ctx->xch, domid, memorykb +
> -                LIBXL_MAXMEM_CONSTANT);
> +        rc = xc_domain_setmaxmem(ctx->xch, domid, memorykb);
>          if (rc != 0) {
>              LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
>                      "xc_domain_setmaxmem domid=%d memkb=%d failed "
> -                    "rc=%d\n", domid, memorykb + LIBXL_MAXMEM_CONSTANT, rc);
> +                    "rc=%d\n", domid, memorykb, rc);
>              abort_transaction = 1;
>              goto out;
>          }
> diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
> index a16d4a1..923ba5c 100644
> --- a/tools/libxl/libxl_dom.c
> +++ b/tools/libxl/libxl_dom.c
> @@ -408,8 +408,7 @@ int libxl__build_pre(libxl__gc *gc, uint32_t domid,
>          }
>      }
>  
> -    if (xc_domain_setmaxmem(ctx->xch, domid, info->target_memkb +
> -        LIBXL_MAXMEM_CONSTANT) < 0) {
> +    if (xc_domain_setmaxmem(ctx->xch, domid, info->target_memkb) < 0) {
>          LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Couldn't set max memory");
>          return ERROR_FAIL;
>      }
> diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
> index 934465a..d5c5b68 100644
> --- a/tools/libxl/libxl_internal.h
> +++ b/tools/libxl/libxl_internal.h
> @@ -89,7 +89,6 @@
>  #define LIBXL_QEMU_BODGE_TIMEOUT 2
>  #define LIBXL_XENCONSOLE_LIMIT 1048576
>  #define LIBXL_XENCONSOLE_PROTOCOL "vt100"
> -#define LIBXL_MAXMEM_CONSTANT 1024
>  #define LIBXL_PV_EXTRA_MEMORY 1024
>  #define LIBXL_HVM_EXTRA_MEMORY 2048
>  #define LIBXL_MIN_DOM0_MEM (128*1024)
> 

  reply	other threads:[~2015-02-25 20:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-25 15:07 [PATCH] libxl: remove LIBXL_MAXMEM_CONSTANT Stefano Stabellini
2015-02-25 20:56 ` Don Slutz [this message]
2015-02-26 12:19   ` Stefano Stabellini
2015-02-26 12:28     ` Ian Campbell
2015-03-12 11:02       ` Stefano Stabellini
2015-03-12 16:11         ` Ian Campbell
2015-03-12 16:54           ` Stefano Stabellini
2015-03-02 14:01 ` Ian Campbell

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=54EE3702.7060803@terremark.com \
    --to=dslutz@verizon.com \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=mlatimer@suse.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.