From: Chenxiao Zhao <chenxiao.zhao@gmail.com>
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Cc: Julien Grall <julien.grall@arm.com>
Subject: [PATCH RFC 03/04] tools/libxc: arm: Implement save ops arm_setup
Date: Fri, 5 Aug 2016 10:54:24 +0800 [thread overview]
Message-ID: <038b9147-d170-cd5b-5fb7-119932fcc4c7@gmail.com> (raw)
arm_setup need to return number of pages that vm is allocated. Code is
copied from x64 save ops.
Signed-off-by: Chenxiao Zhao <chenxiao.zhao@gmail.com>
diff --git a/tools/libxc/xc_sr_save_arm.c b/tools/libxc/xc_sr_save_arm.c
index 611f99a..a2ef2db 100644
--- a/tools/libxc/xc_sr_save_arm.c
+++ b/tools/libxc/xc_sr_save_arm.c
@@ -122,7 +122,23 @@ static int arm_normalise_page(struct xc_sr_context
*ctx,
static int arm_setup(struct xc_sr_context *ctx)
{
- /* no-op */
+ xc_interface *xch = ctx->xch;
+ xen_pfn_t nr_pfns;
+
+ if (xc_domain_nr_gpfns(xch, ctx->domid, &nr_pfns) < 0 )
+ {
+ PERROR("Unable to obtain the guest p2m size");
+ return -1;
+ }
+ if ( nr_pfns > ~XEN_DOMCTL_PFINFO_LTAB_MASK )
+ {
+ errno = E2BIG;
+ PERROR("Cannot save this big a guest");
+ return -1;
+ }
+
+ ctx->save.p2m_size = nr_pfns;
+
return 0;
}
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
reply other threads:[~2016-08-05 2:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=038b9147-d170-cd5b-5fb7-119932fcc4c7@gmail.com \
--to=chenxiao.zhao@gmail.com \
--cc=julien.grall@arm.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 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).