Last change
on this file since 567 was
567,
checked in by price, 17 years ago
|
note vmctl as license exception
|
-
Property svn:executable set to
*
|
File size:
854 bytes
|
Line | |
---|
1 | #!/usr/bin/env perl |
---|
2 | # NOTICE |
---|
3 | # Unlike everything else in this repository, this file does not come with |
---|
4 | # any particular license, as the author (zev) stopped being involved before we |
---|
5 | # got down to putting a license on the project. |
---|
6 | use warnings; |
---|
7 | use strict; |
---|
8 | |
---|
9 | my $subcmd = shift; |
---|
10 | |
---|
11 | my %cmds = ("install" => \&install); |
---|
12 | |
---|
13 | |
---|
14 | if (exists $cmds{$subcmd}) { |
---|
15 | $cmds{$subcmd}->(); |
---|
16 | } else { |
---|
17 | print "No such subcommand: '$subcmd'\n"; |
---|
18 | } |
---|
19 | |
---|
20 | sub install { |
---|
21 | my ($installer, $host_device) = @ARGV; |
---|
22 | $host_device =~ s#^/dev/##; |
---|
23 | my $installer_hostname = "magic"; |
---|
24 | my $guest_dev = $host_device; |
---|
25 | $guest_dev =~ tr#/#_#; |
---|
26 | |
---|
27 | run("xm", "block-attach", $installer, "phys:$host_device", "$guest_dev", "rw"); |
---|
28 | run("remctl", $installer_hostname, "installer", "install", $guest_dev); |
---|
29 | run("xm", "block-detach", $installer, $guest_dev, "rw"); |
---|
30 | } |
---|
31 | |
---|
32 | sub run { |
---|
33 | system("echo", @_); |
---|
34 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.