diff options
-rw-r--r-- | .rootkeys | 1 | ||||
-rw-r--r-- | tools/control/src/org/xenoserver/cmdline/Main.java | 3 | ||||
-rw-r--r-- | tools/control/src/org/xenoserver/cmdline/ParseVbdShow.java | 41 | ||||
-rw-r--r-- | tools/control/src/org/xenoserver/control/VirtualBlockDevice.java | 22 |
4 files changed, 44 insertions, 23 deletions
@@ -31,6 +31,7 @@ 3f05631dMY7PMkwSY7zBFelGJ8goVg tools/control/src/org/xenoserver/cmdline/ParsePhysicalList.java 3f05631dYDFXv6mwNFAgz3ta9kShJA tools/control/src/org/xenoserver/cmdline/ParsePhysicalRevoke.java 3f0bdfabfXM4tMbvmV06di5U-5FfqA tools/control/src/org/xenoserver/cmdline/ParseVbdCreate.java +3f0bec93F_VDIcn9oeXwJYwydX20kg tools/control/src/org/xenoserver/cmdline/ParseVbdShow.java 3f098761TRsbDk9woUM846Q6_F7EmA tools/control/src/org/xenoserver/cmdline/ParseVdCreate.java 3f099009pmH9MFkRYwP2V1DfsqEwdg tools/control/src/org/xenoserver/cmdline/ParseVdDelete.java 3f098761zh9WTV6LpRqcet3gqlXdtg tools/control/src/org/xenoserver/cmdline/ParseVdFree.java diff --git a/tools/control/src/org/xenoserver/cmdline/Main.java b/tools/control/src/org/xenoserver/cmdline/Main.java index 922a3ca74c..3b8cc554b7 100644 --- a/tools/control/src/org/xenoserver/cmdline/Main.java +++ b/tools/control/src/org/xenoserver/cmdline/Main.java @@ -35,7 +35,8 @@ public class Main { new ParseVdFree() }; private static final CommandParser vbdcommands[] = - { new ParseVbdCreate() + { new ParseVbdCreate(), + new ParseVbdShow() }; private static final CommandParser commands[] = { help, diff --git a/tools/control/src/org/xenoserver/cmdline/ParseVbdShow.java b/tools/control/src/org/xenoserver/cmdline/ParseVbdShow.java new file mode 100644 index 0000000000..b89105d592 --- /dev/null +++ b/tools/control/src/org/xenoserver/cmdline/ParseVbdShow.java @@ -0,0 +1,41 @@ +package org.xenoserver.cmdline; + +import java.util.Iterator; +import java.util.LinkedList; + +import org.xenoserver.control.CommandFailedException; +import org.xenoserver.control.Defaults; +import org.xenoserver.control.Library; +import org.xenoserver.control.VirtualBlockDevice; +import org.xenoserver.control.VirtualDiskManager; + +public class ParseVbdShow extends CommandParser { + public void parse(Defaults d, LinkedList args) + throws ParseFailedException, CommandFailedException { + loadState(); + Iterator i = VirtualDiskManager.IT.getVirtualBlockDevices(); + System.out.println("key dom vbd mode"); + while (i.hasNext()) { + VirtualBlockDevice vbd = (VirtualBlockDevice) i.next(); + System.out.println( vbd.getVirtualDisk().getKey() + + " " + + Library.format(vbd.getDomain(), 3, false) + + " " + + Library.format(vbd.getVbdNum(), 3, false) + + " " + + vbd.getMode().toString()); + } + } + + public String getName() { + return "show"; + } + + public String getUsage() { + return ""; + } + + public String getHelpText() { + return "Show details of all mapped virtual block devices."; + } +} diff --git a/tools/control/src/org/xenoserver/control/VirtualBlockDevice.java b/tools/control/src/org/xenoserver/control/VirtualBlockDevice.java index e66753480e..6e7c64480a 100644 --- a/tools/control/src/org/xenoserver/control/VirtualBlockDevice.java +++ b/tools/control/src/org/xenoserver/control/VirtualBlockDevice.java @@ -39,28 +39,6 @@ public class VirtualBlockDevice { this.mode = mode; } - // TODO: get rid of this method - String dump(boolean title) { - StringBuffer sb = new StringBuffer(); - - if (title) { - sb.append(" key dom vbd mode\n"); - } else { - sb.append( - " " - + vd.getKey() - + " " - + Library.format(domain, 3, false) - + " " - + Library.format(vbdNum, 3, false) - + " " - + mode.toString() - + "\n"); - } - - return sb.toString(); - } - /** * Dump the virtual block device as XML. * @param out The writer to dump to. |