qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
  • * Re: Using json: in common.rc's TEST_IMG
           [not found] <CAJSP0QX5XFw81XrHHn9p1pX+1y7tc+xMJLVx9YgRsMCkUwjW7Q@mail.gmail.com>
           [not found] ` <CAJSP0QXpxyVPXieK9W4h+NxK4KNkOvnFD4KvuDMcZ9PLx9Sfvw@mail.gmail.com>
    @ 2023-06-01  8:29 ` Kevin Wolf
      2023-06-01  9:46   ` Stefan Hajnoczi
      1 sibling, 1 reply; 3+ messages in thread
    From: Kevin Wolf @ 2023-06-01  8:29 UTC (permalink / raw)
      To: Stefan Hajnoczi; +Cc: Hanna Reitz, qemu-devel
    
    Am 31.05.2023 um 21:00 hat Stefan Hajnoczi geschrieben:
    > Hi Hanna,
    > I'm adding the io_uring block driver (block/blkio.c) to qemu-iotests
    > and hit a syntax issue with json:.
    > 
    > In tests/qemu-iotests/common.rc where TEST_IMG_FILE and TEST_IMG are
    > defined for each IMGPROTO, I'm unable to come up with a TEST_IMG that
    > works with all test cases. Some test cases want:
    > 
    >   TEST_IMG="json:{\"file.driver\":\"io_uring\",\"file.filename\":\"$TEST_IMG_FILE\"}"
    > 
    > While others want:
    > 
    >   TEST_IMG="json:{\"driver\":\"io_uring\",\"filename\":\"$TEST_IMG_FILE\"}"
    > 
    > It seems to depend on how TEST_IMG is used by the tests.
    
    The first one makes more sense, doesn't the second one override the
    image format and effectively use raw images by going to the protocol
    driver directly?
    
    But should we use json: at all? All the other protocols don't make use
    of it, but just use the real protocol prefix, i.e. what I would expect
    here is io_uring:/foo/bar (which is already covered by the else branch
    in common.rc).
    
    Maybe this doesn't work currently for the libblkio block driver because
    it doesn't implement .bdrv_parse_filename, but it would be nice to
    support for human users anyway, so maybe just implement it as a small
    wrapper around bdrv_parse_filename_strip_prefix()?
    
    > For example, 001 works with the first version. When I use the second
    > version it fails with:
    > 
    >   qemu-io: can't open device
    > json:{"driver":"io_uring","filename":"/home/stefanha/qemu/build/scratch/raw-io_uring-001/t.raw"}:
    > A block device must be specified for "file"
    > 
    > The opposite is true for 077, which works with the second version but
    > fails as follows with the first version:
    > 
    >   qemu-io: can't open device
    > blkdebug::json:{"file.driver":"io_uring","file.filename":"/home/stefanha/qemu/build/scratch/raw-io_uring-077/t.raw"}:
    > Must specify either driver or file
    > 
    > This only seems to happen with json: because the other protocols use
    > TEST_IMG=nfs://... and so on without any problems.
    > 
    > Any ideas?
    
    Another problem I remember with json: is that you need different
    escaping in qemu-img and -drive in qemu-system-*: The latter requires
    commas to be doubled.
    
    So with a single $TEST_IMG, you won't be able to cover both the tools
    and the system emulator anyway.
    
    Kevin
    
    
    
    ^ permalink raw reply	[flat|nested] 3+ messages in thread

  • end of thread, other threads:[~2023-06-01  9:48 UTC | newest]
    
    Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
    -- links below jump to the message on this page --
         [not found] <CAJSP0QX5XFw81XrHHn9p1pX+1y7tc+xMJLVx9YgRsMCkUwjW7Q@mail.gmail.com>
         [not found] ` <CAJSP0QXpxyVPXieK9W4h+NxK4KNkOvnFD4KvuDMcZ9PLx9Sfvw@mail.gmail.com>
    2023-06-01  8:10   ` Using json: in common.rc's TEST_IMG Hanna Czenczek
    2023-06-01  8:29 ` Kevin Wolf
    2023-06-01  9:46   ` Stefan Hajnoczi
    

    This is a public inbox, see mirroring instructions
    for how to clone and mirror all data and code used for this inbox;
    as well as URLs for NNTP newsgroup(s).