qemu-block
[Top][All Lists]
Advanced

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

[Qemu-block] blockdev-del


From: Alberto Garcia
Subject: [Qemu-block] blockdev-del
Date: Mon, 5 Oct 2015 18:35:21 +0300
User-agent: Mutt/1.5.24 (2015-08-30)

I would like to implement blockdev-del. Since 48f364dd0b there's no
way to remove a block device added with blockdev-add.

Here's the use case:

 1. We can attach a disk to a running QEMU instance:

    {"execute": "blockdev-add",
         "arguments": { "options": { "driver": "qcow2",
                                     "file": { "driver": "file",
                                               "filename": "hd.img"},
                                     "id": "disk1"}}}

  2. We can attach a front-end device that uses the disk that we just
     added.

    {"execute": "device_add",
         "arguments": { "id": "dev1",
                        "driver": "virtio-blk-pci",
                        "drive": "disk1"}}

  3. When we're done, we can remove the front-end:

    {"execute": "device_del",
         "arguments": { "id": "dev1" }}

However, it is not possible to remove the disk added in step 1 so
if we want to attach a new disk we cannot reuse the device name
("disk1").

I know that blockdev-add is still a work in progress, but I wonder if
there's anything else that is preventing us from writing blockdev-del
(that's maybe not even the best name here, since what we want to
destroy is the BlockBackend; the BDS can be already removed with
'eject').

Is this a good idea? Has it been discussed already? I would be happy
to hear your opinions.

Thanks,

Berto



reply via email to

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