Skip to content
  • Hanna Reitz's avatar
    26536c7f
    block: Do not truncate file node when formatting · 26536c7f
    Hanna Reitz authored
    
    
    There is no reason why the format drivers need to truncate the protocol
    node when formatting it.  When using the old .bdrv_co_create_ops()
    interface, the file will be created with no size option anyway, which
    generally gives it a size of 0.  (Exceptions are block devices, which
    cannot be truncated anyway.)
    
    When using blockdev-create, the user must have given the file node some
    size anyway, so there is no reason why we should override that.
    
    qed is an exception, it needs the file to start completely empty (as
    explained by c743849b).
    
    Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
    Message-id: 20190918095144.955-4-mreitz@redhat.com
    Reviewed-by: default avatarMaxim Levitsky <mlevitsk@redhat.com>
    Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
    26536c7f
    block: Do not truncate file node when formatting
    Hanna Reitz authored
    
    
    There is no reason why the format drivers need to truncate the protocol
    node when formatting it.  When using the old .bdrv_co_create_ops()
    interface, the file will be created with no size option anyway, which
    generally gives it a size of 0.  (Exceptions are block devices, which
    cannot be truncated anyway.)
    
    When using blockdev-create, the user must have given the file node some
    size anyway, so there is no reason why we should override that.
    
    qed is an exception, it needs the file to start completely empty (as
    explained by c743849b).
    
    Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
    Message-id: 20190918095144.955-4-mreitz@redhat.com
    Reviewed-by: default avatarMaxim Levitsky <mlevitsk@redhat.com>
    Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
Loading