Skip to content
  • Hanna Reitz's avatar
    2a01c01f
    qemu-io: Use purely string blockdev options · 2a01c01f
    Hanna Reitz authored
    
    
    Currently, qemu-io only uses string-valued blockdev options (as all are
    converted directly from QemuOpts) -- with one exception: -U adds the
    force-share option as a boolean.  This in itself is already a bit
    questionable, but a real issue is that it also assumes the value already
    existing in the options QDict would be a boolean, which is wrong.
    
    That has the following effect:
    
    $ ./qemu-io -r -U --image-opts \
        driver=file,filename=/dev/null,force-share=off
    [1]    15200 segmentation fault (core dumped)  ./qemu-io -r -U
    --image-opts driver=file,filename=/dev/null,force-share=off
    
    Since @opts is converted from QemuOpts, the value must be a string, and
    we have to compare it as such.  Consequently, it makes sense to also set
    it as a string instead of a boolean.
    
    Cc: qemu-stable@nongnu.org
    Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
    Message-id: 20180502202051.15493-2-mreitz@redhat.com
    Reviewed-by: default avatarEric Blake <eblake@redhat.com>
    Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
    2a01c01f
    qemu-io: Use purely string blockdev options
    Hanna Reitz authored
    
    
    Currently, qemu-io only uses string-valued blockdev options (as all are
    converted directly from QemuOpts) -- with one exception: -U adds the
    force-share option as a boolean.  This in itself is already a bit
    questionable, but a real issue is that it also assumes the value already
    existing in the options QDict would be a boolean, which is wrong.
    
    That has the following effect:
    
    $ ./qemu-io -r -U --image-opts \
        driver=file,filename=/dev/null,force-share=off
    [1]    15200 segmentation fault (core dumped)  ./qemu-io -r -U
    --image-opts driver=file,filename=/dev/null,force-share=off
    
    Since @opts is converted from QemuOpts, the value must be a string, and
    we have to compare it as such.  Consequently, it makes sense to also set
    it as a string instead of a boolean.
    
    Cc: qemu-stable@nongnu.org
    Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
    Message-id: 20180502202051.15493-2-mreitz@redhat.com
    Reviewed-by: default avatarEric Blake <eblake@redhat.com>
    Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
Loading