--- /usr/bin/xen-create-image-orig	2006-08-17 23:38:58.000000000 +0200
+++ /usr/bin/xen-create-image	2006-08-17 23:45:19.000000000 +0200
@@ -1496,22 +1496,20 @@
 
 
     #
-    # The commands to create the volumes.
+    # The commands to create the volumes and
+    # initialise the partitions with the relevant filesystem.
     #
     my $disk_cmd = "/sbin/lvcreate $CONFIG{'lvm'} -L $CONFIG{'size'}M -n $disk";
-    my $swap_cmd = "/sbin/lvcreate $CONFIG{'lvm'} -L $CONFIG{'swap'} -n $swap";
-
-    #
-    # Create the volumes
-    #
     runCommand( $disk_cmd );
-    runCommand( $swap_cmd );
+    createFilesystem( "/dev/$CONFIG{'lvm'}/$CONFIG{'hostname'}-disk" );
+
+    unless( $CONFIG{'noswap'} )
+    {
+        my $swap_cmd = "/sbin/lvcreate $CONFIG{'lvm'} -L $CONFIG{'swap'} -n $swap";
+        runCommand( $swap_cmd );
+        createSwap( "/dev/$CONFIG{'lvm'}/$CONFIG{'hostname'}-swap" );
+    }
 
-     #
-     #  Initialise the partitions with the relevant filesystem.
-     #
-     createFilesystem( "/dev/$CONFIG{'lvm'}/$CONFIG{'hostname'}-disk" );
-     createSwap( "/dev/$CONFIG{'lvm'}/$CONFIG{'hostname'}-swap" );
 }
 
 
