[Top][All Lists]

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

Re: equivalent to "-drive if=ide,id=disk0....."

From: Kashyap Chamarthy
Subject: Re: equivalent to "-drive if=ide,id=disk0....."
Date: Mon, 27 Jul 2020 23:50:28 +0200

[Cc: qemu-block]

On Mon, Jul 27, 2020 at 05:11:15PM +0800, Derek Su wrote:
> Hello,
> I'm trying to replace "-drive if=ide,id=disk0....." with "-blockdev
> '{"node-name": "top-node",...."
> The "id" is the name of BlockBackend, and the "node-name" is the name
> of the BDS tree's root.
> Is there any equivalent for "id" when use "-blockdev '{"node-name":
> "top-node",...." ?

IIUC, specifying 'node-name' should be sufficient.  Also, you don't need
to specify JSON syntax on the command-line; you can 'flatten it' (see

On 'id' vs. 'node-name', from the documentation of `blockdev-add`,

    # Creates a new block device. If the @id option is given at the top level, a
    # BlockBackend will be created; otherwise, @node-name is mandatory at the 
    # level and no BlockBackend will be created.

            - - -

And here's a minimal working example that I use with '-blockdev'

/usr/bin/qemu-system-x86_64        \
    -display none                  \
    -no-user-config                \
    -nodefaults                    \
    -serial  stdio                 \
    -cpu host                      \
    -smp 1,maxcpus=2               \
    -machine q35,accel=kvm,usb=off \
    -m 2048                        \
node-name=node-Base,driver=qcow2,file.driver=file,file.filename=./base.qcow2 \
    -device virtio-blk,drive=node-Base,id=virtio0 \



reply via email to

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