Am 18.10.2019 um 14:06 hat Pavel Dovgalyuk geschrieben: > > From: Kevin Wolf [mailto:kw...@redhat.com] > > Am 11.10.2019 um 08:10 hat Pavel Dovgalyuk geschrieben: > > > > From: Kevin Wolf [mailto:kw...@redhat.com] > > > > Am 25.09.2019 um 11:02 hat Pavel Dovgalyuk geschrieben: > > > > > I started playing with -blockdev: added new blockdev for blkreplay and > > > > > constructed the following command line: > > > > > > > > > > -blockdev driver=file,filename=disk.img,node-name=hd0 > > > > > -blockdev driver=blkreplay,file=hd0,node-name=hd0-rr > > > > > -device virtio-blk-device,drive=hd0-rr > > > > > > > > > > However, I get an error: "Could not open 'disk.img': Permission > > > > > denied" > > > > > Everything works when I use this file in '-drive' parameter. > > > > > What am I doing wrong? > > > > > > > > The reason why I didn't reply immediately is because I don't see > > > > anything wrong in the options you used. > > > > > > > > Just to confirm, do you still get the same error when you use only the > > > > first -blockdev option and no other options at all? > > > > > > Ok, I tried again and got different error, which was caused by incorrect > > > QAPI schema for blkreplay. > > > Now it seems ok, but I still can't boot. > > > > Hm... Are you actually using a raw image? If not, you need the format > > driver, too, and would end up with something like: > > > > -blockdev driver=file,filename=disk.qcow2,node-name=hd0 > > -blockdev driver=qcow2,file=hd0,node-name=hd0-qcow2 > > -blockdev driver=blkreplay,file=hd0-qcow2,node-name=hd0-rr > > -device virtio-blk-device,drive=hd0-rr > > > > (The first two can be combined into a single option by using a syntax > > like file.driver=file,file.filename=disk.qcow2, but defining each node > > separately is a bit cleaner.) > > Ok, this works. > Now I'm trying to check root of the nodes in blk_insert_bs. > This command line leads to 2 invocations of this function: > 1. bs->drv is file > 2. bs->drv is blkreplay > > How then can we check "snapshot" node attachment?
Ah, I see what's going on there... :-/ bdrv_open_inherit() creates an internal temporary BlockBackend for image format probing. And it creates that BlockBackend even when we don't need to do image probing because we already explicitly selected a driver. It would be better if it didn't do that. Kevin