[vbox-dev] VDCopy() fix for VHD, change progress callback percent to float?

2009-10-07 Thread Huihong Luo
The new fix patch is attached. The code resets the geometry cSectors > 63 
(which fails always before this fix), and don't update modification uuid if 
empty.
 
a related issue, wonder if you like the idea of changing VDCopy callbacks to 
float/double percentage? right now, it's an int, the 1st 1% may takes more 
than 3 mins, not user friendly to update the progress bar

--- On Wed, 10/7/09, Huihong Luo  wrote:


From: Huihong Luo 
Subject: Re: [vbox-dev] VDCopy() fix for VHD
To: "Klaus Espenlaub" 
Cc: vbox-dev@virtualbox.org
Date: Wednesday, October 7, 2009, 3:02 PM







yes, i debugged, and the following fails. So the modification uuid is not 
correctly set after conversion
 
static int vdiValidateHeader(PVDIHEADER pHeader)
{
...
if (RTUuidIsNull(getImageModificationUUID(pHeader)))
{
LogRel(("VDI: uuid of modificator is 0\n"));
fFailed = true;
}
}


--- On Wed, 10/7/09, Klaus Espenlaub  wrote:


From: Klaus Espenlaub 
Subject: Re: [vbox-dev] VDCopy() fix for VHD
To: "Huihong Luo" 
Cc: vbox-dev@virtualbox.org
Date: Wednesday, October 7, 2009, 2:02 PM


Huihong Luo wrote:
> after the fix, VHD->VMDk seems to be working fine, but VHD->VDI still not 
> working, the generated vdi disk throws invalid header error.

Don't think it's a good idea to apply the change before understanding what's 
still going wrong in the VDI case. Should be pretty easy to figure out, by 
running "VBoxManage internalcommands dumphdinfo /path/to/broken.vdi", and 
setting a breakpoint on vdiValidateHeader. With a little bit of single stepping 
one should immediately see what's causing trouble. The VDI code is very 
paranoid.

Klaus

> 
> --- On *Wed, 10/7/09, Huihong Luo //* wrote:
> 
> 
>     From: Huihong Luo 
>     Subject: [vbox-dev] VDCopy() fix for VHD
>     To: vbox-dev@virtualbox.org
>     Date: Wednesday, October 7, 2009, 12:30 AM
> 
>     Can you guys add the following code to function VDCopy() in
>     VBoxHDD.cpp? right before VDCreateBase() is called.
>          It resets the geometry if cSectors > 63, VHD disk somehow has more
>     than 63 sectors.
>                   /* vmlite, fix converting error from VHD */
>         if (PCHSGeometryFrom.cHeads > 16 || PCHSGeometryFrom.cSectors > 63)
>         {
>          Assert(RT_MIN(cbSize / 512 / 16 / 63, 16383) -
>             (unsigned int)RT_MIN(cbSize / 512 / 16 / 63, 16383) == 0);        
>   PCHSGeometryFrom.cCylinders = (unsigned int)RT_MIN(cbSize / 512
>     / 16 / 63, 16383);
>          PCHSGeometryFrom.cHeads = 16;
>          PCHSGeometryFrom.cSectors = 63;
>         }
>         /* vmlite */
>                     rc = VDCreateBase(pDiskTo, pszBackend, pszFilename,
>     cbSize,
>                                       uImageFlags, szComment,
>                                       &PCHSGeometryFrom, &LCHSGeometryFrom,
>                                       NULL, uOpenFlagsFrom &
>     ~VD_OPEN_FLAGS_READONLY, NULL, NULL);
>                     if (RT_SUCCESS(rc) && !RTUuidIsNull(&ImageUuid))
>                             
>pDiskTo->pLast->Backend->pfnSetUuid(pDiskTo->pLast->pvBackendData,
>     &ImageUuid);
>                     if (RT_SUCCESS(rc) && !RTUuidIsNull(&ParentUuid))
>                             
>pDiskTo->pLast->Backend->pfnSetParentUuid(pDiskTo->pLast->pvBackendData,
>     &ParentUuid);
>               - Huihong
> 
> 
>     -Inline Attachment Follows-
> 
>     ___
>     vbox-dev mailing list
>     vbox-...@virtualbox.org
>     
>     http://vbox.innotek.de/mailman/listinfo/vbox-dev
> 
> 
> 
> 
> ___
> vbox-dev mailing list
> vbox-dev@virtualbox.org
> http://vbox.innotek.de/mailman/listinfo/vbox-dev

-Inline Attachment Follows-


___
vbox-dev mailing list
vbox-dev@virtualbox.org
http://vbox.innotek.de/mailman/listinfo/vbox-dev


VBoxHDD.patch
Description: Binary data
___
vbox-dev mailing list
vbox-dev@virtualbox.org
http://vbox.innotek.de/mailman/listinfo/vbox-dev


Re: [vbox-dev] VDCopy() fix for VHD

2009-10-07 Thread Huihong Luo
yes, i debugged, and the following fails. So the modification uuid is not 
correctly set after conversion
 
static int vdiValidateHeader(PVDIHEADER pHeader)
{
...
if (RTUuidIsNull(getImageModificationUUID(pHeader)))
{
LogRel(("VDI: uuid of modificator is 0\n"));
fFailed = true;
}
}


--- On Wed, 10/7/09, Klaus Espenlaub  wrote:


From: Klaus Espenlaub 
Subject: Re: [vbox-dev] VDCopy() fix for VHD
To: "Huihong Luo" 
Cc: vbox-dev@virtualbox.org
Date: Wednesday, October 7, 2009, 2:02 PM


Huihong Luo wrote:
> after the fix, VHD->VMDk seems to be working fine, but VHD->VDI still not 
> working, the generated vdi disk throws invalid header error.

Don't think it's a good idea to apply the change before understanding what's 
still going wrong in the VDI case. Should be pretty easy to figure out, by 
running "VBoxManage internalcommands dumphdinfo /path/to/broken.vdi", and 
setting a breakpoint on vdiValidateHeader. With a little bit of single stepping 
one should immediately see what's causing trouble. The VDI code is very 
paranoid.

Klaus

> 
> --- On *Wed, 10/7/09, Huihong Luo //* wrote:
> 
> 
>     From: Huihong Luo 
>     Subject: [vbox-dev] VDCopy() fix for VHD
>     To: vbox-dev@virtualbox.org
>     Date: Wednesday, October 7, 2009, 12:30 AM
> 
>     Can you guys add the following code to function VDCopy() in
>     VBoxHDD.cpp? right before VDCreateBase() is called.
>          It resets the geometry if cSectors > 63, VHD disk somehow has more
>     than 63 sectors.
>                   /* vmlite, fix converting error from VHD */
>         if (PCHSGeometryFrom.cHeads > 16 || PCHSGeometryFrom.cSectors > 63)
>         {
>          Assert(RT_MIN(cbSize / 512 / 16 / 63, 16383) -
>             (unsigned int)RT_MIN(cbSize / 512 / 16 / 63, 16383) == 0);        
>   PCHSGeometryFrom.cCylinders = (unsigned int)RT_MIN(cbSize / 512
>     / 16 / 63, 16383);
>          PCHSGeometryFrom.cHeads = 16;
>          PCHSGeometryFrom.cSectors = 63;
>         }
>         /* vmlite */
>                     rc = VDCreateBase(pDiskTo, pszBackend, pszFilename,
>     cbSize,
>                                       uImageFlags, szComment,
>                                       &PCHSGeometryFrom, &LCHSGeometryFrom,
>                                       NULL, uOpenFlagsFrom &
>     ~VD_OPEN_FLAGS_READONLY, NULL, NULL);
>                     if (RT_SUCCESS(rc) && !RTUuidIsNull(&ImageUuid))
>                             
>pDiskTo->pLast->Backend->pfnSetUuid(pDiskTo->pLast->pvBackendData,
>     &ImageUuid);
>                     if (RT_SUCCESS(rc) && !RTUuidIsNull(&ParentUuid))
>                             
>pDiskTo->pLast->Backend->pfnSetParentUuid(pDiskTo->pLast->pvBackendData,
>     &ParentUuid);
>               - Huihong
> 
> 
>     -Inline Attachment Follows-
> 
>     ___
>     vbox-dev mailing list
>     vbox-...@virtualbox.org
>     
>     http://vbox.innotek.de/mailman/listinfo/vbox-dev
> 
> 
> 
> 
> ___
> vbox-dev mailing list
> vbox-dev@virtualbox.org
> http://vbox.innotek.de/mailman/listinfo/vbox-dev
___
vbox-dev mailing list
vbox-dev@virtualbox.org
http://vbox.innotek.de/mailman/listinfo/vbox-dev


Re: [vbox-dev] VDCopy() fix for VHD

2009-10-07 Thread Klaus Espenlaub

Huihong Luo wrote:
after the fix, VHD->VMDk seems to be working fine, but VHD->VDI still 
not working, the generated vdi disk throws invalid header error.


Don't think it's a good idea to apply the change before understanding 
what's still going wrong in the VDI case. Should be pretty easy to 
figure out, by running "VBoxManage internalcommands dumphdinfo 
/path/to/broken.vdi", and setting a breakpoint on vdiValidateHeader. 
With a little bit of single stepping one should immediately see what's 
causing trouble. The VDI code is very paranoid.


Klaus



--- On *Wed, 10/7/09, Huihong Luo //* wrote:


From: Huihong Luo 
Subject: [vbox-dev] VDCopy() fix for VHD
To: vbox-dev@virtualbox.org
Date: Wednesday, October 7, 2009, 12:30 AM

Can you guys add the following code to function VDCopy() in
VBoxHDD.cpp? right before VDCreateBase() is called.
 
It resets the geometry if cSectors > 63, VHD disk somehow has more

than 63 sectors.
 
 
/* vmlite, fix converting error from VHD */

if (PCHSGeometryFrom.cHeads > 16 || PCHSGeometryFrom.cSectors > 63)
{
 Assert(RT_MIN(cbSize / 512 / 16 / 63, 16383) -
(unsigned int)RT_MIN(cbSize / 512 / 16 / 63, 16383) == 0);  
 PCHSGeometryFrom.cCylinders = (unsigned int)RT_MIN(cbSize / 512

/ 16 / 63, 16383);
 PCHSGeometryFrom.cHeads = 16;
 PCHSGeometryFrom.cSectors = 63;
}
/* vmlite */
rc = VDCreateBase(pDiskTo, pszBackend, pszFilename,
cbSize,
  uImageFlags, szComment,
  &PCHSGeometryFrom, &LCHSGeometryFrom,
  NULL, uOpenFlagsFrom &
~VD_OPEN_FLAGS_READONLY, NULL, NULL);
if (RT_SUCCESS(rc) && !RTUuidIsNull(&ImageUuid))

pDiskTo->pLast->Backend->pfnSetUuid(pDiskTo->pLast->pvBackendData,

&ImageUuid);
if (RT_SUCCESS(rc) && !RTUuidIsNull(&ParentUuid))

pDiskTo->pLast->Backend->pfnSetParentUuid(pDiskTo->pLast->pvBackendData,

&ParentUuid);
 
 
- Huihong



-Inline Attachment Follows-

___
vbox-dev mailing list
vbox-dev@virtualbox.org

http://vbox.innotek.de/mailman/listinfo/vbox-dev




___
vbox-dev mailing list
vbox-dev@virtualbox.org
http://vbox.innotek.de/mailman/listinfo/vbox-dev


___
vbox-dev mailing list
vbox-dev@virtualbox.org
http://vbox.innotek.de/mailman/listinfo/vbox-dev


Re: [vbox-dev] VDCopy() fix for VHD

2009-10-07 Thread Huihong Luo
after the fix, VHD->VMDk seems to be working fine, but VHD->VDI still not 
working, the generated vdi disk throws invalid header error.

--- On Wed, 10/7/09, Huihong Luo  wrote:


From: Huihong Luo 
Subject: [vbox-dev] VDCopy() fix for VHD
To: vbox-dev@virtualbox.org
Date: Wednesday, October 7, 2009, 12:30 AM







Can you guys add the following code to function VDCopy() in VBoxHDD.cpp? right 
before VDCreateBase() is called. 
 
It resets the geometry if cSectors > 63, VHD disk somehow has more than 63 
sectors.
 
 
/* vmlite, fix converting error from VHD */
if (PCHSGeometryFrom.cHeads > 16 || PCHSGeometryFrom.cSectors > 63)
{
 Assert(RT_MIN(cbSize / 512 / 16 / 63, 16383) -
    (unsigned int)RT_MIN(cbSize / 512 / 16 / 63, 16383) == 0);  
 PCHSGeometryFrom.cCylinders = (unsigned int)RT_MIN(cbSize / 512 / 16 / 63, 
16383);
 PCHSGeometryFrom.cHeads = 16;
 PCHSGeometryFrom.cSectors = 63;
}
/* vmlite */
    rc = VDCreateBase(pDiskTo, pszBackend, pszFilename, cbSize,
  uImageFlags, szComment,
  &PCHSGeometryFrom, &LCHSGeometryFrom,
  NULL, uOpenFlagsFrom & 
~VD_OPEN_FLAGS_READONLY, NULL, NULL);
    if (RT_SUCCESS(rc) && !RTUuidIsNull(&ImageUuid))
 
pDiskTo->pLast->Backend->pfnSetUuid(pDiskTo->pLast->pvBackendData, &ImageUuid);
    if (RT_SUCCESS(rc) && !RTUuidIsNull(&ParentUuid))
 
pDiskTo->pLast->Backend->pfnSetParentUuid(pDiskTo->pLast->pvBackendData, 
&ParentUuid);
 
 
- Huihong
-Inline Attachment Follows-


___
vbox-dev mailing list
vbox-dev@virtualbox.org
http://vbox.innotek.de/mailman/listinfo/vbox-dev
___
vbox-dev mailing list
vbox-dev@virtualbox.org
http://vbox.innotek.de/mailman/listinfo/vbox-dev


Re: [vbox-dev] Announcement: VirtualBox 3.0.8 released

2009-10-07 Thread Frank Mehnert
Hi,

the original VirtualBox 3.0.8 package for Windows hosts did not contain
the .chm help file due to an accident. We've just uploaded a new package
containing the missing file to the server. The correct package can be
downloaded here:

http://download.virtualbox.org/virtualbox/3.0.8/VirtualBox-3.0.8-53140-Win.exe

Sorry for any inconveniences.

Kind regards,

Frank
-- 
Dr.-Ing. Frank Mehnert

Sitz der Gesellschaft:
Sun Microsystems GmbH, Sonnenallee 1, 85551 Kirchheim-Heimstetten
Amtsgericht München: HRB 161028
Geschäftsführer: Thomas Schröder, Wolfgang Engels, Wolf Frenkel
Vorsitzender des Aufsichtsrates: Martin Häring


signature.asc
Description: This is a digitally signed message part.
___
vbox-dev mailing list
vbox-dev@virtualbox.org
http://vbox.innotek.de/mailman/listinfo/vbox-dev


[vbox-dev] VDCopy() fix for VHD

2009-10-07 Thread Huihong Luo
Can you guys add the following code to function VDCopy() in VBoxHDD.cpp? right 
before VDCreateBase() is called. 
 
It resets the geometry if cSectors > 63, VHD disk somehow has more than 63 
sectors.
 
 
/* vmlite, fix converting error from VHD */
if (PCHSGeometryFrom.cHeads > 16 || PCHSGeometryFrom.cSectors > 63)
{
 Assert(RT_MIN(cbSize / 512 / 16 / 63, 16383) -
    (unsigned int)RT_MIN(cbSize / 512 / 16 / 63, 16383) == 0);  
 PCHSGeometryFrom.cCylinders = (unsigned int)RT_MIN(cbSize / 512 / 16 / 63, 
16383);
 PCHSGeometryFrom.cHeads = 16;
 PCHSGeometryFrom.cSectors = 63;
}
/* vmlite */
    rc = VDCreateBase(pDiskTo, pszBackend, pszFilename, cbSize,
  uImageFlags, szComment,
  &PCHSGeometryFrom, &LCHSGeometryFrom,
  NULL, uOpenFlagsFrom & 
~VD_OPEN_FLAGS_READONLY, NULL, NULL);
    if (RT_SUCCESS(rc) && !RTUuidIsNull(&ImageUuid))
 
pDiskTo->pLast->Backend->pfnSetUuid(pDiskTo->pLast->pvBackendData, &ImageUuid);
    if (RT_SUCCESS(rc) && !RTUuidIsNull(&ParentUuid))
 
pDiskTo->pLast->Backend->pfnSetParentUuid(pDiskTo->pLast->pvBackendData, 
&ParentUuid);
 
 
- Huihong___
vbox-dev mailing list
vbox-dev@virtualbox.org
http://vbox.innotek.de/mailman/listinfo/vbox-dev