PERFORCE change 126463 for review

Marko Zec zec at FreeBSD.org
Sun Sep 16 03:16:11 PDT 2007


http://perforce.freebsd.org/chv.cgi?CH=126463

Change 126463 by zec at zec_tpx32 on 2007/09/16 10:15:51

	Sync the userland management utility with the kernel-level
	changes, and stop displaying unused fields (CPU limits /
	accounting / vimage parent info).

Affected files ...

.. //depot/projects/vimage/src/usr.sbin/vimage/vimage.c#3 edit

Differences ...

==== //depot/projects/vimage/src/usr.sbin/vimage/vimage.c#3 (text+ko) ====

@@ -62,21 +62,21 @@
 
 void vi_print(struct vi_req *vi_req)
 {
+#if 0
 	double lf = 1.0/vi_req->averunnable.fscale;
+#endif
 
 	printf ("\"%s\":\n", vi_req->vi_name);
-	printf ("    %d processes, ", vi_req->vi_proc_count);
-	printf ("load averages: %3.2f, %3.2f, %3.2f\n",
+	printf ("    Processes (current/max): %d/%d\n",
+	    vi_req->vi_proc_count, vi_req->vi_proc_limit);
+#if 0
+	printf ("    load averages: %3.2f, %3.2f, %3.2f\n",
 		lf * vi_req->averunnable.ldavg[0],
 		lf * vi_req->averunnable.ldavg[1],
 		lf * vi_req->averunnable.ldavg[2]);
 
-#if 0
 	printf ("    CPU usage: %3.2f%% (",
 		0.0001 * vi_req->cp_time_avg[CP_ALL]);
-#else
-	printf ("    CPU usage: (");
-#endif
 	printf ("%3.2f%% user, ", 0.0001 * vi_req->cp_time_avg[CP_USER]);
 	printf ("%3.2f%% nice, ", 0.0001 * vi_req->cp_time_avg[CP_NICE]);
 	printf ("%3.2f%% sys, ",0.0001 * vi_req->cp_time_avg[CP_SYS]);
@@ -92,22 +92,15 @@
 			0.0001 * vi_req->vi_intr_limit);
 	else
 		printf ("no intr limit\n");
+#endif
 
-	if (vi_req->vi_proc_limit)
-		printf ("    Proc limit: %d", vi_req->vi_proc_limit);
-	else
-		printf ("    No proc limit");
 	if (vi_req->vi_child_limit)
-		printf (", child limit: %d", vi_req->vi_child_limit);
-	printf("\n    Sockets (current/max): %d/%d\n", vi_req->vi_sock_count,
+		printf ("    child limit: %d\n", vi_req->vi_child_limit);
+	printf("    Sockets (current/max): %d/%d\n", vi_req->vi_sock_count,
 		vi_req->vi_maxsockets);
-	printf ("    %d network interfaces", vi_req->vi_if_count);
+	printf ("    %d network interfaces\n", vi_req->vi_if_count);
 	if (vi_req->vi_child_count)
-		printf (", %d child vimages",
-			vi_req->vi_child_count);
-	if (vi_req->vi_parent_name[0])
-		printf (", parent vimage: \"%s\"",
-			vi_req->vi_parent_name); printf ("\n");
+		printf ("    %d child vimages\n", vi_req->vi_child_count);
 	if (vi_req->vi_chroot[0])
 		printf ("    Chroot dir: %s\n", vi_req->vi_chroot);
 }
@@ -185,11 +178,10 @@
 		/* here vi_chroot stores the current ifc name */
 		strncpy(vi_req.vi_chroot, argv[3], sizeof (vi_req.vi_chroot));
 		if (argc >= 5)
-			/* here vi_parent_name stores the target ifc name */
-			strncpy(vi_req.vi_parent_name, argv[4],
-				sizeof (vi_req.vi_parent_name));
+			strncpy(vi_req.vi_if_xname, argv[4],
+				sizeof (vi_req.vi_if_xname));
 		else
-			vi_req.vi_parent_name[0] = 0;
+			vi_req.vi_if_xname[0] = 0;
         	if (ioctl(s, SIOCSIFVIMAGE, (caddr_t)&vi_req) < 0)
 			goto abort;
 		printf("%s@%s\n", vi_req.vi_chroot, vi_req.vi_name);


More information about the p4-projects mailing list