[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 05/12] libxenguest: complete loops in xc_map_domain_meminfo()
- To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Fri, 25 Jun 2021 15:19:52 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
- 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-SenderADCheck; bh=9zqPlZFqr+nDgrvYU7y3XbcPEkd6sL5MQWdO6KTLw4I=; b=kkHK65kpjSGbcm2k3oXHF9vpeh6xQWDguQ+yfQOPY8UG2OFejkHattHa7AmYZMU8C9dCFF/kMzrS9ZAEuMVMwKGo7exYS0B0ZM8QK6JCBbU3ejDN+XtBTWP1tnka5FMl1zRQTOg5v9sPlvkyR2r4g+K5M3KGLXm4ZjLFueOfFca9hny1KiQ4ibtI3tlWwM13Gpx/WCyfJvR29Tl9/kNRQcsmRRG1fqCODk5wyLjSF9C4MdcKXjyrA/ye2QEHT8T/nnXrhwJkEbIX0cBRWoVtXFZ+pLqcHiV2p+lsNi548RZvQgorVsLBMjv26RSLlFel7cUV6NtEpZ2I4fygQjT9ew==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gsyO5B1COetqzUbnhFXW+RCXm4MpeHr0u9CQWP++e1cEjWKWVvbSSaW0FffII3FAo6vMbZDS50JrnwcivJkt/5/u0IcGNNDHcXY6/RcYQ7uIT0jfKAFgWkfis1jgaHgMLxdtsGDu6vtFsdcxFeQ8WlwPelhY16G5UvBdVQ/LnJSFjT/4o/4QS/Lmcd2LeKSTknW8iUMe81itNQWJzY0as0shmfemhJgMR+iaog5Tgikf9uMxZ2IHgxb8soVqdumE+dTiOemdZHk12j190C1h+dkhX6iJ46rDkJkP4L7YupI0ZmJeNwsI8rr3IskRlI7wK0U5DPKLOCMidzNPVs7Oqg==
- Authentication-results: xenproject.org; dkim=none (message not signed) header.d=none;xenproject.org; dmarc=none action=none header.from=suse.com;
- Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>
- Delivery-date: Fri, 25 Jun 2021 13:20:02 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
minfo->p2m_size may have more than 31 significant bits. Change the
induction variable to unsigned long, and (largely for signed-ness
consistency) a helper variable to unsigned int.
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
--- a/tools/libs/guest/xg_domain.c
+++ b/tools/libs/guest/xg_domain.c
@@ -40,7 +40,7 @@ int xc_map_domain_meminfo(xc_interface *
xc_dominfo_t info;
shared_info_any_t *live_shinfo;
xen_capabilities_info_t xen_caps = "";
- int i;
+ unsigned long i;
/* Only be initialized once */
if ( minfo->pfn_type || minfo->p2m_table )
@@ -116,12 +116,12 @@ int xc_map_domain_meminfo(xc_interface *
/* Retrieve PFN types in batches */
for ( i = 0; i < minfo->p2m_size ; i+=1024 )
{
- int count = ((minfo->p2m_size - i ) > 1024 ) ?
- 1024: (minfo->p2m_size - i);
+ unsigned int count = ((minfo->p2m_size - i) > 1024) ?
+ 1024 : (minfo->p2m_size - i);
if ( xc_get_pfn_type_batch(xch, domid, count, minfo->pfn_type + i) )
{
- PERROR("Could not get %d-eth batch of PFN types", (i+1)/1024);
+ PERROR("Could not get batch %lu of PFN types", (i + 1) / 1024);
goto failed;
}
}
|