ia64/xen-unstable

changeset 714:0dd18b6d0c08

bitkeeper revision 1.423 (3f5f5d57h4flymvui_FJq1j1W4oYnw)

Merge labyrinth.cl.cam.ac.uk:/auto/groups/xeno/users/tlh20/xeno.bk
into labyrinth.cl.cam.ac.uk:/auto/anfs/scratch/labyrinth/iap10/xeno-clone/xeno.bk
author iap10@labyrinth.cl.cam.ac.uk
date Wed Sep 10 17:20:23 2003 +0000 (2003-09-10)
parents b78116ab99cf 4e3894487bc3
children 4778f77eb1bf 10a0b70344a9
files tools/control/src/org/xenoserver/control/CommandDomainNew.java tools/control/src/org/xenoserver/control/CommandPhysicalGrant.java tools/control/src/org/xenoserver/control/CommandPhysicalRevoke.java tools/control/src/org/xenoserver/control/CommandVbdCreatePhysical.java
line diff
     1.1 --- a/tools/control/src/org/xenoserver/control/CommandDomainNew.java	Wed Sep 10 16:22:29 2003 +0000
     1.2 +++ b/tools/control/src/org/xenoserver/control/CommandDomainNew.java	Wed Sep 10 17:20:23 2003 +0000
     1.3 @@ -6,6 +6,7 @@ import java.io.FileInputStream;
     1.4  import java.io.FileOutputStream;
     1.5  import java.io.IOException;
     1.6  import java.io.InputStreamReader;
     1.7 +import java.lang.NumberFormatException;
     1.8  import java.net.InetAddress;
     1.9  import java.net.UnknownHostException;
    1.10  import java.util.zip.GZIPInputStream;
    1.11 @@ -182,7 +183,14 @@ public class CommandDomainNew extends Co
    1.12                      br =
    1.13                          new BufferedReader(
    1.14                              new InputStreamReader(create_p.getInputStream()));
    1.15 -                    domain_id = Integer.parseInt(br.readLine());
    1.16 +		    try
    1.17 +		      {
    1.18 +			domain_id = Integer.parseInt(br.readLine());
    1.19 +		      }
    1.20 +		    catch (NumberFormatException nfe) 
    1.21 +		      {
    1.22 +			domain_id = -1;
    1.23 +		      }
    1.24                      create_rc = create_p.waitFor();
    1.25                  }
    1.26  		d.domainNumber = domain_id;
     2.1 --- a/tools/control/src/org/xenoserver/control/CommandPhysicalGrant.java	Wed Sep 10 16:22:29 2003 +0000
     2.2 +++ b/tools/control/src/org/xenoserver/control/CommandPhysicalGrant.java	Wed Sep 10 17:20:23 2003 +0000
     2.3 @@ -42,11 +42,11 @@ public class CommandPhysicalGrant extend
     2.4      public String execute() throws CommandFailedException {
     2.5          Runtime r = Runtime.getRuntime();
     2.6          String output = null;
     2.7 -
     2.8 -        Partition partition = PartitionManager.IT.getPartition(StringPattern.parse(partition_name).resolve(domain_id));
     2.9 +	String resolved = StringPattern.parse(partition_name).resolve(domain_id);
    2.10 +        Partition partition = PartitionManager.IT.getPartition(resolved);
    2.11      
    2.12          if ( partition == null ) {
    2.13 -          throw new CommandFailedException("Partition " + partition_name + " does not exist.");
    2.14 +          throw new CommandFailedException("Partition " + partition_name + " (resolved to " + resolved + ") does not exist.");
    2.15          }
    2.16      
    2.17          // Check if this partition belongs to the VDM
     3.1 --- a/tools/control/src/org/xenoserver/control/CommandPhysicalRevoke.java	Wed Sep 10 16:22:29 2003 +0000
     3.2 +++ b/tools/control/src/org/xenoserver/control/CommandPhysicalRevoke.java	Wed Sep 10 17:20:23 2003 +0000
     3.3 @@ -29,12 +29,11 @@ public class CommandPhysicalRevoke exten
     3.4      public String execute() throws CommandFailedException {
     3.5          Runtime r = Runtime.getRuntime();
     3.6          String output = null;
     3.7 -
     3.8 -        Partition partition = PartitionManager.IT.getPartition(StringPattern.parse(partition_name).resolve(domain_id));
     3.9 +	String resolved = StringPattern.parse(partition_name).resolve(domain_id);
    3.10 +        Partition partition = PartitionManager.IT.getPartition(resolved);
    3.11  
    3.12          if (partition == null) {
    3.13 -            throw new CommandFailedException(
    3.14 -                "Partition " + partition_name + " does not exist.");
    3.15 +          throw new CommandFailedException("Partition " + partition_name + " (resolved to " + resolved + ") does not exist.");
    3.16          }
    3.17  
    3.18          try {
     4.1 --- a/tools/control/src/org/xenoserver/control/CommandVbdCreatePhysical.java	Wed Sep 10 16:22:29 2003 +0000
     4.2 +++ b/tools/control/src/org/xenoserver/control/CommandVbdCreatePhysical.java	Wed Sep 10 17:20:23 2003 +0000
     4.3 @@ -38,10 +38,11 @@ public class CommandVbdCreatePhysical ex
     4.4       * @see org.xenoserver.control.Command#execute()
     4.5       */
     4.6      public String execute() throws CommandFailedException {
     4.7 -        Partition partition = PartitionManager.IT.getPartition(StringPattern.parse(partition_name).resolve(domain_id));
     4.8 +        String resolved = StringPattern.parse(partition_name).resolve(domain_id);
     4.9 +        Partition partition = PartitionManager.IT.getPartition(resolved);
    4.10          if (partition == null) {
    4.11              throw new CommandFailedException(
    4.12 -                "No partition " + partition_name + " exists");
    4.13 +                "No partition " + partition_name + " (resolved to " + resolved + ") exists");
    4.14          }
    4.15  
    4.16          VirtualDisk vd = new VirtualDisk("vbd:" + partition.getName());