pvgrub: initialise p2m_size

In 84083790 ("libxc: add p2m_size to xc_dom_image") a new field is
added. We should initialised this field in pvgrub as well, otherwise
xc_dom_build_image won't work properly.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
This commit is contained in:
Wei Liu authored and Ian Campbell committed 2015-05-11 11:26:34 +01:00
1 parent 2a816ea934
commit 6b351c78a4
1 file changed
+3 -2
+3 -2
View File
@@ -276,12 +276,13 @@ void kexec(void *kernel, long kernel_size, void *module, long module_size, char
dom->total_pages = start_info.nr_pages;
/* equivalent of arch_setup_meminit */
dom->p2m_size = dom->total_pages;
/* setup initial p2m */
dom->p2m_host = malloc(sizeof(*dom->p2m_host) * dom->total_pages);
dom->p2m_host = malloc(sizeof(*dom->p2m_host) * dom->p2m_size);
/* Start with our current P2M */
for (i = 0; i < dom->total_pages; i++)
for (i = 0; i < dom->p2m_size; i++)
dom->p2m_host[i] = pfn_to_mfn(i);
if ( (rc = xc_dom_build_image(dom)) != 0 ) {
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.