Skip to content
  • Alberto Garcia's avatar
    bacd9b87
    block: Allow omitting the 'backing' option in certain cases · bacd9b87
    Alberto Garcia authored
    
    
    Of all options of type BlockdevRef used to specify children in
    BlockdevOptions, 'backing' is the only one that is optional.
    
    For "x-blockdev-reopen" we want that if an option is omitted then it
    must be reset to its default value. The default value of 'backing'
    means that QEMU opens the backing file specified in the image
    metadata, but this is not something that we want to support for the
    reopen operation.
    
    Because of this the 'backing' option has to be specified during
    reopen, pointing to the existing backing file if we want to keep it,
    or pointing to a different one (or NULL) if we want to replace it (to
    be implemented in a subsequent patch).
    
    In order to simplify things a bit and not to require that the user
    passes the 'backing' option to every single block device even when
    it's clearly not necessary, this patch allows omitting this option if
    the block device being reopened doesn't have a backing file attached
    _and_ no default backing file is specified in the image metadata.
    
    Signed-off-by: default avatarAlberto Garcia <berto@igalia.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    bacd9b87
    block: Allow omitting the 'backing' option in certain cases
    Alberto Garcia authored
    
    
    Of all options of type BlockdevRef used to specify children in
    BlockdevOptions, 'backing' is the only one that is optional.
    
    For "x-blockdev-reopen" we want that if an option is omitted then it
    must be reset to its default value. The default value of 'backing'
    means that QEMU opens the backing file specified in the image
    metadata, but this is not something that we want to support for the
    reopen operation.
    
    Because of this the 'backing' option has to be specified during
    reopen, pointing to the existing backing file if we want to keep it,
    or pointing to a different one (or NULL) if we want to replace it (to
    be implemented in a subsequent patch).
    
    In order to simplify things a bit and not to require that the user
    passes the 'backing' option to every single block device even when
    it's clearly not necessary, this patch allows omitting this option if
    the block device being reopened doesn't have a backing file attached
    _and_ no default backing file is specified in the image metadata.
    
    Signed-off-by: default avatarAlberto Garcia <berto@igalia.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
Loading