aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorsos22@labyrinth.cl.cam.ac.uk <sos22@labyrinth.cl.cam.ac.uk>2003-07-09 08:28:43 +0000
committersos22@labyrinth.cl.cam.ac.uk <sos22@labyrinth.cl.cam.ac.uk>2003-07-09 08:28:43 +0000
commitba505e496d5eae13c902996d34426c656b9a5330 (patch)
tree1c0267c37a6e50bba619545e8212fa28bc726d5a /tools
parent52755be8981ca782763d1eca503e4bce752ea76e (diff)
downloadxen-ba505e496d5eae13c902996d34426c656b9a5330.tar.gz
xen-ba505e496d5eae13c902996d34426c656b9a5330.tar.bz2
xen-ba505e496d5eae13c902996d34426c656b9a5330.zip
bitkeeper revision 1.303.2.1 (3f0bd23bjmByDrErI4CVnaylQxBxhA)
Whitespace cleanup.
Diffstat (limited to 'tools')
-rw-r--r--tools/internal/xi_phys_grant.c73
-rw-r--r--tools/internal/xi_phys_probe.c66
-rw-r--r--tools/internal/xi_phys_revoke.c43
3 files changed, 91 insertions, 91 deletions
diff --git a/tools/internal/xi_phys_grant.c b/tools/internal/xi_phys_grant.c
index 58c00ed882..368414f4f5 100644
--- a/tools/internal/xi_phys_grant.c
+++ b/tools/internal/xi_phys_grant.c
@@ -10,40 +10,41 @@
int main(int argc, char *argv[])
{
- xp_disk_t buf;
- int fd;
- char *strbuf;
-
- if (argc != 7) {
- fprintf(stderr, "Usage: xi_physdev_grant <r/rw> <domain> <device> <start sector> <n_sectors> <partition>\n");
- return 1;
- }
-
- buf.mode = 0;
- if (argv[1][0] == 'r')
- buf.mode |= 1;
- else if (argv[1][0] == 'w')
- buf.mode |= 2;
- if (argv[1][1] == 'r')
- buf.mode |= 1;
- else if (argv[1][1] == 'w')
- buf.mode |= 2;
-
- buf.device = atol(argv[3]);
- buf.start_sect = atol(argv[4]);
- buf.n_sectors = atol(argv[5]);
- buf.partition = atol(argv[6]);
-
- asprintf(&strbuf, "/proc/xeno/dom%s/phd", argv[2]);
- fd = open(strbuf, O_WRONLY);
- if (fd < 0) {
- fprintf(stderr, "Can\'t open %s: %s.\n", strbuf, strerror(errno));
- return 1;
- }
- free(strbuf);
-
- write(fd, &buf, sizeof(buf));
- close(fd);
-
- return 0;
+ xp_disk_t buf;
+ int fd;
+ char *strbuf;
+
+ if (argc != 7) {
+ fprintf(stderr,
+ "Usage: xi_physdev_grant <r/rw> <domain> <device> <start sector> <n_sectors> <partition>\n");
+ return 1;
+ }
+
+ buf.mode = 0;
+ if (argv[1][0] == 'r')
+ buf.mode |= 1;
+ else if (argv[1][0] == 'w')
+ buf.mode |= 2;
+ if (argv[1][1] == 'r')
+ buf.mode |= 1;
+ else if (argv[1][1] == 'w')
+ buf.mode |= 2;
+
+ buf.device = atol(argv[3]);
+ buf.start_sect = atol(argv[4]);
+ buf.n_sectors = atol(argv[5]);
+ buf.partition = atol(argv[6]);
+
+ asprintf(&strbuf, "/proc/xeno/dom%s/phd", argv[2]);
+ fd = open(strbuf, O_WRONLY);
+ if (fd < 0) {
+ fprintf(stderr, "Can\'t open %s: %s.\n", strbuf, strerror(errno));
+ return 1;
+ }
+ free(strbuf);
+
+ write(fd, &buf, sizeof(buf));
+ close(fd);
+
+ return 0;
}
diff --git a/tools/internal/xi_phys_probe.c b/tools/internal/xi_phys_probe.c
index e38bb1634b..a3dfd8952b 100644
--- a/tools/internal/xi_phys_probe.c
+++ b/tools/internal/xi_phys_probe.c
@@ -10,43 +10,41 @@
int main(int argc, char *argv[])
{
- physdisk_probebuf_t buf;
- int fd;
- int x;
- char *strbuf;
+ physdisk_probebuf_t buf;
+ int fd;
+ int x;
+ char *strbuf;
- if (argc != 2) {
- fprintf(stderr, "Usage: xi_phys_probe <domain_nr>\n");
- return 1;
- }
+ if (argc != 2) {
+ fprintf(stderr, "Usage: xi_phys_probe <domain_nr>\n");
+ return 1;
+ }
- asprintf(&strbuf, "/proc/xeno/dom%s/phd", argv[1]);
- fd = open(strbuf, O_RDONLY);
- if (fd < 0) {
- fprintf(stderr, "Can\'t open %s: %s.\n", strbuf, strerror(errno));
- return 1;
- }
- free(strbuf);
+ asprintf(&strbuf, "/proc/xeno/dom%s/phd", argv[1]);
+ fd = open(strbuf, O_RDONLY);
+ if (fd < 0) {
+ fprintf(stderr, "Can\'t open %s: %s.\n", strbuf, strerror(errno));
+ return 1;
+ }
+ free(strbuf);
- memset(&buf, 0, sizeof(buf));
- buf.n_aces = PHYSDISK_MAX_ACES_PER_REQUEST;
- do {
+ memset(&buf, 0, sizeof(buf));
buf.n_aces = PHYSDISK_MAX_ACES_PER_REQUEST;
- read(fd, &buf, sizeof(buf));
- if (!buf.n_aces)
- break;
+ do {
+ buf.n_aces = PHYSDISK_MAX_ACES_PER_REQUEST;
+ read(fd, &buf, sizeof(buf));
+ if (!buf.n_aces)
+ break;
- for (x = 0; x < buf.n_aces; x++) {
- char read = ( buf.entries[x].mode & 1 ? 'r' : ' ' );
- char write = ( buf.entries[x].mode & 2 ? 'w' : ' ' );
- printf("%x %x %lx %lx %c%c\n", buf.entries[x].device,
- buf.entries[x].partition,
- buf.entries[x].start_sect,
- buf.entries[x].n_sectors,
- read,
- write);
- }
- buf.start_ind += buf.n_aces;
- } while (buf.n_aces == PHYSDISK_MAX_ACES_PER_REQUEST);
- return 0;
+ for (x = 0; x < buf.n_aces; x++) {
+ char read = (buf.entries[x].mode & 1 ? 'r' : ' ');
+ char write = (buf.entries[x].mode & 2 ? 'w' : ' ');
+ printf("%x %x %lx %lx %c%c\n", buf.entries[x].device,
+ buf.entries[x].partition,
+ buf.entries[x].start_sect,
+ buf.entries[x].n_sectors, read, write);
+ }
+ buf.start_ind += buf.n_aces;
+ } while (buf.n_aces == PHYSDISK_MAX_ACES_PER_REQUEST);
+ return 0;
}
diff --git a/tools/internal/xi_phys_revoke.c b/tools/internal/xi_phys_revoke.c
index 2bcfacb591..c39146e889 100644
--- a/tools/internal/xi_phys_revoke.c
+++ b/tools/internal/xi_phys_revoke.c
@@ -10,30 +10,31 @@
int main(int argc, char *argv[])
{
- xp_disk_t buf;
- int fd;
- char *strbuf;
+ xp_disk_t buf;
+ int fd;
+ char *strbuf;
- if (argc != 5) {
- fprintf(stderr, "Usage: xi_physdev_revoke <domain> <device> <start sector> <n_sectors>\n");
- return 1;
- }
+ if (argc != 5) {
+ fprintf(stderr,
+ "Usage: xi_physdev_revoke <domain> <device> <start sector> <n_sectors>\n");
+ return 1;
+ }
- buf.device = atol(argv[2]);
- buf.mode = 0;
- buf.start_sect = atol(argv[3]);
- buf.n_sectors = atol(argv[4]);
+ buf.device = atol(argv[2]);
+ buf.mode = 0;
+ buf.start_sect = atol(argv[3]);
+ buf.n_sectors = atol(argv[4]);
- asprintf(&strbuf, "/proc/xeno/dom%s/phd", argv[1]);
- fd = open(strbuf, O_WRONLY);
- if (fd < 0) {
- fprintf(stderr, "Can\'t open %s: %s.\n", strbuf, strerror(errno));
- return 1;
- }
- free(strbuf);
+ asprintf(&strbuf, "/proc/xeno/dom%s/phd", argv[1]);
+ fd = open(strbuf, O_WRONLY);
+ if (fd < 0) {
+ fprintf(stderr, "Can\'t open %s: %s.\n", strbuf, strerror(errno));
+ return 1;
+ }
+ free(strbuf);
- write(fd, &buf, sizeof(buf));
- close(fd);
+ write(fd, &buf, sizeof(buf));
+ close(fd);
- return 0;
+ return 0;
}