qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rewrite "-drive" using "-blockdev/-device"


From: Max Reitz
Subject: Re: Rewrite "-drive" using "-blockdev/-device"
Date: Wed, 8 Apr 2020 09:06:12 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0

On 07.04.20 18:03, Derek Su wrote:
> Hi,
> 
> I tried to rewrite the "-drive" command-line using "-blockdev/-device"
> 
> "-drive" command-line
> ```
> #-drive 
> if=none,id=childs0,driver=replication,mode=secondary,file.driver=qcow2,top-id=colo-disk0,file.file.filename=${folder}/secondary-active.qcow2,file.backing.driver=qcow2,file.backing.file.filename=${folder}/secondary-hidden.qcow2,file.backing.backing=parent0
> \
> #-drive 
> if=virtio,id=colo-disk0,driver=quorum,read-pattern=fifo,vote-threshold=1,children.0=childs0
> \
> ```
> 
>  "-blockdev/-device" command-line
> ```
> -blockdev '{"node-name": "parent0", "driver": "qcow2", "file":
> {"driver": "file", "filename": "'${folder}/secondary.qcow2'"}}' \
> -blockdev '{"node-name": "childs0", "driver": "replication", "mode":
> "secondary", "top-id": "colo-disk0", "file": { "driver": "qcow2",
> "file": {"driver": "file", "filename":
> "'${folder}/secondary-active.qcow2'"}, "backing": {"driver": "qcow2",
> "file": { "driver": "qcow2", "file": { "driver": "file", "filename":
                       ^^^^^
This part is wrong.  This nests a qcow2 node on top of another.

> "'${folder}/secondary-hidden.qcow2'"}}, "backing": "parent0" }}}' \
> -blockdev '{"driver": "quorum", "node-name": "colo-disk0",
> "read-pattern": "fifo", "vote-threshold": 1, "children": [{"driver":
> "replication", "file": "childs0", "mode": "secondary"}]}' \

Unrelated to your error message, but I think this is also wrong, because
you’re nesting a replication driver on top of another replication node
here (“childs0” is a replication node already).  So it should just be
"children": ["childs0"].

Max

> ```
> 
> 
> The second ( "-blockdev/-device") shows the error
> ```
> qemu-system-x86_64: -blockdev {"node-name": "childs0", "driver":
> "replication", "mode": "secondary", "top-id": "colo-disk0", "file": {
> "driver": "qcow2", "file": {"driver": "file", "filename":
> "/tmp/ramdisk/secondary-active.qcow2"}, "backing": {"driver": "qcow2",
> "file": { "driver": "qcow2", "file": { "driver": "file", "filename":
> "/tmp/ramdisk/secondary-hidden.qcow2"}}, "backing": "parent0" }}}:
> Could not open backing file: Image is not in qcow2 format
> ```
> 
> Any errors in the rewritten version?
> Thanks.
> 
> Regards,
> Derek
> 


Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]