Skip to content
  • Naphtali Sprei's avatar
    Added readonly flag to -drive command · 59f2689d
    Naphtali Sprei authored
    
    
    This is a slightly revised patch for adding readonly flag to the -drive command.
    Even though this patch is "stand-alone", it assumes a previous related patch (in Anthony staging tree), that passes
    the readonly attribute of the drive to the guest OS, applied first.
    
    This enables sharing same image between guests, with readonly access.
    Implementaion mark the drive as read_only and changes the flags when actually opening the file.
    The readonly attribute of a qcow also passed to it's base file.
    For ide that cannot pass the readonly attribute to the guest OS, disallow the readonly flag.
    
    Also, return error code from bdrv_truncate for readonly drive.
    
    Signed-off-by: default avatarNaphtali Sprei <nsprei@redhat.com>
    Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
    59f2689d