Index: /trunk/src/VBox/Frontends/VBoxManage/VBoxManageCloud.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VBoxManage/VBoxManageCloud.cpp	(revision 79582)
+++ /trunk/src/VBox/Frontends/VBoxManage/VBoxManageCloud.cpp	(revision 79583)
@@ -813,7 +813,7 @@
     AssertRCReturn(vrc, RTEXITCODE_FAILURE);
 
-    Utf8Str strCompartmentId("compartment-id");
-    Utf8Str strInstanceId("instance-id");
-    Utf8Str strDisplayName("display-name");
+    Utf8Str strCompartmentId;
+    Utf8Str strInstanceId;
+    Utf8Str strDisplayName;
     com::SafeArray<BSTR>  parameters;
 
@@ -824,14 +824,14 @@
         {
             case 'c':
-                strCompartmentId.append("=").append(ValueUnion.psz);
-                Bstr(strCompartmentId).detachTo(parameters.appendedRaw());
+                strCompartmentId=ValueUnion.psz;
+                Bstr(Utf8Str("compartment-id=").append(ValueUnion.psz)).detachTo(parameters.appendedRaw());
                 break;
             case 'i':
-                strInstanceId.append("=").append(ValueUnion.psz);
-                Bstr(strInstanceId).detachTo(parameters.appendedRaw());
+                strInstanceId=ValueUnion.psz;
+                Bstr(Utf8Str("instance-id=").append(ValueUnion.psz)).detachTo(parameters.appendedRaw());
                 break;
             case 'd':
-                strDisplayName.append("=").append(ValueUnion.psz);
-                Bstr(strDisplayName).detachTo(parameters.appendedRaw());
+                strDisplayName=ValueUnion.psz;
+                Bstr(Utf8Str("display-name=").append(ValueUnion.psz)).detachTo(parameters.appendedRaw());
                 break;
             case VINF_GETOPT_NOT_OPTION:
@@ -885,6 +885,6 @@
     AssertRCReturn(vrc, RTEXITCODE_FAILURE);
 
-    Utf8Str strBucketName("bucket-name");
-    Utf8Str strObjectName("object-name");
+    Utf8Str strBucketName;
+    Utf8Str strObjectName;
     Utf8Str strImageId;
     com::SafeArray<BSTR>  parameters;
@@ -896,14 +896,14 @@
         {
             case 'b':
-                strBucketName.append("=").append(ValueUnion.psz);
-                Bstr(strBucketName).detachTo(parameters.appendedRaw());
+                strBucketName=ValueUnion.psz;
+                Bstr(Utf8Str("bucket-name=").append(ValueUnion.psz)).detachTo(parameters.appendedRaw());
                 break;
             case 'o':
-                strObjectName.append("=").append(ValueUnion.psz);
-                Bstr(strObjectName).detachTo(parameters.appendedRaw());
+                strObjectName=ValueUnion.psz;
+                Bstr(Utf8Str("object-name=").append(ValueUnion.psz)).detachTo(parameters.appendedRaw());
                 break;
             case 'i':
-                strImageId = ValueUnion.psz;
-                Bstr(strImageId).detachTo(parameters.appendedRaw());
+                strImageId=ValueUnion.psz;
+                Bstr(Utf8Str("image-id=").append(ValueUnion.psz)).detachTo(parameters.appendedRaw());
                 break;
             case VINF_GETOPT_NOT_OPTION:
@@ -922,15 +922,51 @@
                      CreateCloudClient(oCloudClient.asOutParam()),
                      RTEXITCODE_FAILURE);
-    RTPrintf("Exporting cloud image \'%s\' to the object \'%s\'...\n", strImageId.c_str(), strObjectName.c_str());
+    RTPrintf("Exporting image \'%s\' to the Cloud with name \'%s\'...\n", strImageId.c_str(), strObjectName.c_str());
+
+    ComPtr<IVirtualBox> pVirtualBox = a->virtualBox;
+    SafeIfaceArray<IMedium> aImageList;
+    CHECK_ERROR2_RET(hrc, pVirtualBox,
+                     COMGETTER(HardDisks)(ComSafeArrayAsOutParam(aImageList)),
+                     RTEXITCODE_FAILURE);
+
+    ComPtr<IMedium> pImage;
+    size_t cImages = aImageList.size();
+    bool fFound = false;
+    for (size_t i = 0; i < cImages; ++i)
+    {
+        pImage = aImageList[i];
+        Bstr bstrImageId;
+        hrc = pImage->COMGETTER(Id)(bstrImageId.asOutParam());
+        if (FAILED(hrc))
+            continue;
+
+        com::Guid imageId(bstrImageId);
+
+        if (!imageId.isValid() || imageId.isZero())
+            continue;
+
+        if (!strImageId.compare(imageId.toString()))
+        {
+            fFound = true;
+            RTPrintf("Image %s was found\n", strImageId.c_str());
+            break;
+        }
+    }
+
+    if (!fFound)
+    {
+        RTPrintf("Process of exporting the image to the Cloud was interrupted. The image wasn't found.\n");
+        return RTEXITCODE_FAILURE;
+    }
 
     ComPtr<IProgress> progress;
     CHECK_ERROR2_RET(hrc, oCloudClient,
-                     ExportImage(Bstr(strImageId).raw(), ComSafeArrayAsInParam(parameters), progress.asOutParam()),
+                     ExportImage(pImage, pVirtualBox, ComSafeArrayAsInParam(parameters), progress.asOutParam()),
                      RTEXITCODE_FAILURE);
     hrc = showProgress(progress);
-    CHECK_PROGRESS_ERROR_RET(progress, ("Cloud image export failed"), RTEXITCODE_FAILURE);
+    CHECK_PROGRESS_ERROR_RET(progress, ("Export the image to the Cloud failed"), RTEXITCODE_FAILURE);
 
     if (SUCCEEDED(hrc))
-        RTPrintf("Cloud image was exported successfully\n");
+        RTPrintf("Export the image to the Cloud was successfull\n");
 
     return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;
@@ -956,8 +992,8 @@
     AssertRCReturn(vrc, RTEXITCODE_FAILURE);
 
-    Utf8Str strCompartmentId("compartment-id");
-    Utf8Str strBucketName("bucket-name");
-    Utf8Str strObjectName("object-name");
-    Utf8Str strDisplayName("display-name");
+    Utf8Str strCompartmentId;
+    Utf8Str strBucketName;
+    Utf8Str strObjectName;
+    Utf8Str strDisplayName;
     com::SafeArray<BSTR>  parameters;
 
@@ -968,18 +1004,18 @@
         {
             case 'c':
-                strCompartmentId.append("=").append(ValueUnion.psz);
-                Bstr(strCompartmentId).detachTo(parameters.appendedRaw());
+                strCompartmentId=ValueUnion.psz;
+                Bstr(Utf8Str("compartment-id=").append(ValueUnion.psz)).detachTo(parameters.appendedRaw());
                 break;
             case 'b':
-                strBucketName.append("=").append(ValueUnion.psz);
-                Bstr(strBucketName).detachTo(parameters.appendedRaw());
+                strBucketName=ValueUnion.psz;
+                Bstr(Utf8Str("bucket-name=").append(ValueUnion.psz)).detachTo(parameters.appendedRaw());
                 break;
             case 'o':
-                strObjectName.append("=").append(ValueUnion.psz);
-                Bstr(strObjectName).detachTo(parameters.appendedRaw());
+                strObjectName=ValueUnion.psz;
+                Bstr(Utf8Str("object-name=").append(ValueUnion.psz)).detachTo(parameters.appendedRaw());
                 break;
             case 'd':
-                strDisplayName.append("=").append(ValueUnion.psz);
-                Bstr(strDisplayName).detachTo(parameters.appendedRaw());
+                strDisplayName=ValueUnion.psz;
+                Bstr(Utf8Str("display-name=").append(ValueUnion.psz)).detachTo(parameters.appendedRaw());
                 break;
             case VINF_GETOPT_NOT_OPTION:
Index: /trunk/src/VBox/Main/idl/VirtualBox.xidl
===================================================================
--- /trunk/src/VBox/Main/idl/VirtualBox.xidl	(revision 79582)
+++ /trunk/src/VBox/Main/idl/VirtualBox.xidl	(revision 79583)
@@ -26011,5 +26011,5 @@
   <interface
     name="ICloudClient" extends="$unknown"
-    uuid="1c757554-9768-11e9-9319-ab248c01ad59"
+    uuid="361276ab-3be4-4a1a-abf2-2993048766c4"
     wsmap="managed" reservedMethods="16" reservedAttributes="8"
     >
@@ -26155,4 +26155,22 @@
     </method>
 
+    <method name="importInstance">
+      <desc>
+        Import an existing instance with passed id to the local host.
+      </desc>
+      <param name="description" type="IVirtualSystemDescription" dir="in">
+        <desc>VirtualSystemDescription object which is describing a machine and all required parameters.</desc>
+      </param>
+      <param name="uid" type="wstring" dir="in">
+        <desc>the UUID of instance imported from the Cloud.</desc>
+      </param>
+      <param name="virtualBox" type="IVirtualBox" dir="in">
+        <desc>Reference to the server-side API root object.</desc>
+      </param>
+      <param name="progress" type="IProgress" dir="in">
+        <desc>Progress object to track the operation completion.</desc>
+      </param>
+    </method>
+
     <method name="listInstances" const="yes">
       <desc>
@@ -26208,76 +26226,61 @@
     </method>
 
-    <method name="importInstance">
-      <desc>
-        Import an existing instance with passed id to the local host.
-      </desc>
-      <param name="description" type="IVirtualSystemDescription" dir="in">
-        <desc>VirtualSystemDescription object which is describing a machine and all required parameters.</desc>
-      </param>
+    <method name="startInstance">
+      <desc>
+        Start an existing instance with passed id.
+      </desc>
       <param name="uid" type="wstring" dir="in">
-        <desc>the UUID of instance imported from the Cloud.</desc>
+        <desc>the UUID of instance in the Cloud.</desc>
+      </param>
+      <param name="progress" type="IProgress" dir="return">
+        <desc>Progress object to track the operation completion.</desc>
+      </param>
+    </method>
+
+    <method name="pauseInstance">
+      <desc>
+        Pause an existing instance with passed id.
+      </desc>
+      <param name="uid" type="wstring" dir="in">
+        <desc>the UUID of instance in the Cloud.</desc>
+      </param>
+      <param name="progress" type="IProgress" dir="return">
+        <desc>Progress object to track the operation completion.</desc>
+      </param>
+    </method>
+
+    <method name="terminateInstance">
+      <desc>
+        Terminate an existing instance with passed id.
+      </desc>
+      <param name="uid" type="wstring" dir="in">
+        <desc>the UUID of instance in the Cloud.</desc>
+      </param>
+      <param name="progress" type="IProgress" dir="return">
+        <desc>Progress object to track the operation completion.</desc>
+      </param>
+    </method>
+
+    <method name="createImage">
+      <desc>
+        Create an image in the Cloud.
+      </desc>
+      <param name="parameters" type="wstring" dir="in" safearray="yes">
+        <desc>Each parameter in the array must be in the form "name=value".</desc>
+      </param>
+      <param name="progress" type="IProgress" dir="return">
+        <desc>Progress object to track the operation completion.</desc>
+      </param>
+    </method>
+
+    <method name="exportImage">
+      <desc>
+        Export an existing image with passed id somewhere in the Cloud.
+      </desc>
+      <param name="image" type="IMedium" dir="in">
+        <desc>Reference to the existing VBox image.</desc>
       </param>
       <param name="virtualBox" type="IVirtualBox" dir="in">
         <desc>Reference to the server-side API root object.</desc>
-      </param>
-      <param name="progress" type="IProgress" dir="in">
-        <desc>Progress object to track the operation completion.</desc>
-      </param>
-    </method>
-
-    <method name="startInstance">
-      <desc>
-        Start an existing instance with passed id.
-      </desc>
-      <param name="uid" type="wstring" dir="in">
-        <desc>the UUID of instance in the Cloud.</desc>
-      </param>
-      <param name="progress" type="IProgress" dir="return">
-        <desc>Progress object to track the operation completion.</desc>
-      </param>
-    </method>
-
-    <method name="pauseInstance">
-      <desc>
-        Pause an existing instance with passed id.
-      </desc>
-      <param name="uid" type="wstring" dir="in">
-        <desc>the UUID of instance in the Cloud.</desc>
-      </param>
-      <param name="progress" type="IProgress" dir="return">
-        <desc>Progress object to track the operation completion.</desc>
-      </param>
-    </method>
-
-    <method name="terminateInstance">
-      <desc>
-        Terminate an existing instance with passed id.
-      </desc>
-      <param name="uid" type="wstring" dir="in">
-        <desc>the UUID of instance in the Cloud.</desc>
-      </param>
-      <param name="progress" type="IProgress" dir="return">
-        <desc>Progress object to track the operation completion.</desc>
-      </param>
-    </method>
-
-    <method name="createImage">
-      <desc>
-        Create an image in the Cloud.
-      </desc>
-      <param name="parameters" type="wstring" dir="in" safearray="yes">
-        <desc>Each parameter in the array must be in the form "name=value".</desc>
-      </param>
-      <param name="progress" type="IProgress" dir="return">
-        <desc>Progress object to track the operation completion.</desc>
-      </param>
-    </method>
-
-    <method name="exportImage">
-      <desc>
-        Export an existing image with passed id somewhere in the Cloud.
-      </desc>
-      <param name="uid" type="wstring" dir="in">
-        <desc>the UUID of image in the Cloud.</desc>
       </param>
       <param name="parameters" type="wstring" dir="in" safearray="yes">
