WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 15 of 22] xenpaging: remove local domain_id variable

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 15 of 22] xenpaging: remove local domain_id variable
From: Olaf Hering <olaf@xxxxxxxxx>
Date: Fri, 10 Jun 2011 11:13:04 +0200
Delivery-date: Fri, 10 Jun 2011 02:29:06 -0700
Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1307697185; l=1629; s=domk; d=aepfle.de; h=To:From:Date:References:In-Reply-To:Subject: Content-Transfer-Encoding:MIME-Version:Content-Type:X-RZG-CLASS-ID: X-RZG-AUTH; bh=nW15Y2P/+C9s5nL/e8OGZcudvak=; b=bbqyITIUNC5ymfz//m3Tu6Fk48dZKQM9+Tkde2Sn26N0iJvhaMlqKqSAlkZBmH7vEBX QwCYOe9MaQ8yUuAKuSENMUpaSzdx6auSiBldQG22vwHZe7FA94DoF73mUW3/J6jbHrPTU 3grul1K+OCmOGm2oGCC/p79g2pY3wZJoTBs=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1307697169@xxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <patchbomb.1307697169@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.7.5
# HG changeset patch
# User Olaf Hering <olaf@xxxxxxxxx>
# Date 1307695640 -7200
# Node ID 8913a5fda8d0b3739af4265bc363b02745fa7d01
# Parent  c67d7c0936969d076e30700c9a8f57080238be4e
xenpaging: remove local domain_id variable

Remove the local domain_id variable, it is already fetched from
paging->mem_event in other places.
Update the sprintf format string to use unsigned argument.

Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>

diff -r c67d7c093696 -r 8913a5fda8d0 tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c       Fri Jun 10 10:47:19 2011 +0200
+++ b/tools/xenpaging/xenpaging.c       Fri Jun 10 10:47:20 2011 +0200
@@ -552,7 +552,6 @@ static int evict_victim(xenpaging_t *pag
 int main(int argc, char *argv[])
 {
     struct sigaction act;
-    domid_t domain_id;
     int num_pages;
     xenpaging_t *paging;
     xenpaging_victim_t *victims;
@@ -573,11 +572,10 @@ int main(int argc, char *argv[])
         return -1;
     }
 
-    domain_id = atoi(argv[1]);
     num_pages = atoi(argv[2]);
 
     /* Initialise domain paging */
-    paging = xenpaging_init(domain_id);
+    paging = xenpaging_init(atoi(argv[1]));
     if ( paging == NULL )
     {
         fprintf(stderr, "Error initialising paging");
@@ -585,10 +583,10 @@ int main(int argc, char *argv[])
     }
     xch = paging->xc_handle;
 
-    DPRINTF("starting %s %u %d\n", argv[0], domain_id, num_pages);
+    DPRINTF("starting %s %u %d\n", argv[0], paging->mem_event.domain_id, 
num_pages);
 
     /* Open file */
-    sprintf(filename, "page_cache_%d", domain_id);
+    sprintf(filename, "page_cache_%u", paging->mem_event.domain_id);
     fd = open(filename, open_flags, open_mode);
     if ( fd < 0 )
     {

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>