Skip to content

Commit

Permalink
CA-363610: OVF import: fixed upload of OS fixup ISO.
Browse files Browse the repository at this point in the history
Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
  • Loading branch information
kc284 authored and danilo-delbusso committed Feb 15, 2022
1 parent ada3493 commit 7257253
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions XenModel/Actions/OvfActions/Import.cs
Original file line number Diff line number Diff line change
Expand Up @@ -321,13 +321,7 @@ private XenRef<VDI> ImportFile(string diskName, string pathToOvf, string filenam
virtualSize = vhdDisk.Capacity;
dataStream = File.OpenRead(filePath);
dataLength = dataStream.Length;
format = "vhd";
}
else if (VirtualDisk.SupportedDiskFormats.Any(f => ext.ToLower().EndsWith(f.ToLower())))
{
vhdDisk = VirtualDisk.OpenDisk(sourcefile, FileAccess.Read);
dataStream = vhdDisk.Content;
dataLength = virtualSize = vhdDisk.Capacity;
format = "&format=vhd";
}
else if (ext.ToLower().EndsWith("iso"))
{
Expand All @@ -340,6 +334,12 @@ private XenRef<VDI> ImportFile(string diskName, string pathToOvf, string filenam
dataStream = File.OpenRead(filePath);
dataLength = virtualSize = dataStream.Length;
}
else if (VirtualDisk.SupportedDiskFormats.Any(f => ext.ToLower().EndsWith(f.ToLower())))
{
vhdDisk = VirtualDisk.OpenDisk(sourcefile, FileAccess.Read);
dataStream = vhdDisk.Content;
dataLength = virtualSize = vhdDisk.Capacity;
}
else
{
throw new IOException(string.Format(Messages.UNSUPPORTED_FILE_TYPE, ext));
Expand Down Expand Up @@ -414,7 +414,7 @@ private XenRef<VDI> ImportFile(string diskName, string pathToOvf, string filenam
Host = Connection.Hostname,
Port = Connection.Port,
Path = "/import_raw_vdi",
Query = string.Format("session_id={0}&task_id={1}&vdi={2}&format={3}",
Query = string.Format("session_id={0}&task_id={1}&vdi={2}{3}",
Connection.Session.opaque_ref, taskRef.opaque_ref, vdiuuid, format)
};

Expand Down

0 comments on commit 7257253

Please sign in to comment.