• P
    block: forbid x-blockdev-del from acting on DriveInfo · 5cf87fd6
    Paolo Bonzini 提交于
    Failing on -drive/drive_add created BlockBackends was a
    requirement for x-blockdev-del, but it sneaked through
    the patch review.  Let's fix it now.
    
    Example:
    
    $ x86_64-softmmu/qemu-system-x86_64 -drive if=none,file=null-co://,id=null -qmp stdio
    >> {'execute':'qmp_capabilities'}
    << {"return": {}}
    >> {'execute':'x-blockdev-del','arguments':{'id':'null'}}
    << {"error": {"class": "GenericError", "desc": "Deleting block backend added with drive-add is not supported"}}
    
    And without a DriveInfo:
    
    >> { "execute": "blockdev-add", "arguments": { "options": { "driver":"null-co", "id":"null2"}}}
    << {"return": {}}
    >> {'execute':'x-blockdev-del','arguments':{'id':'null2'}}
    << {"return": {}}
    Suggested-by: NKevin Wolf <kwolf@redhat.com>
    Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: NKevin Wolf <kwolf@redhat.com>
    5cf87fd6
blockdev.c 127.6 KB