Skip to content
  • Fam Zheng's avatar
    vmdk: Allow vmdk_create to work with protocol · 917703c1
    Fam Zheng authored
    
    
    This improves vmdk_create to use bdrv_* functions to replace qemu_open
    and other fd functions. The error handling are improved as well. One
    difference is that bdrv_pwrite will round up buffer to sectors, so for
    description file, an extra bdrv_truncate is used in the end to drop
    inding zeros.
    
    Notes:
    
     - A bonus bug fix is correct endian is used in initializing GD entries.
    
     - ROUND_UP and DIV_ROUND_UP are used where possible.
    
    I tested that new code produces exactly the same file as previously.
    
    Signed-off-by: default avatarFam Zheng <famz@redhat.com>
    Tested-by: default avatarPeter Lieven <pl@kamp.de>
    Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    917703c1