qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] how to dynamically add a block device using qmp?


From: Fam Zheng
Subject: Re: [Qemu-devel] how to dynamically add a block device using qmp?
Date: Sat, 11 Oct 2014 14:11:31 +0800
User-agent: Mutt/1.5.23 (2014-03-12)

On Fri, 10/10 16:52, Ken Chiang wrote:
> Hello,
> 
> I am trying to add a block device dynamically using qmp and are having some 
> issues.
> 
> After successfully adding the block device using "blockdev-add" and verifying 
> that it has been added using "query-block", I am unable to see the block 
> device in the VM under /dev/sdXX
> 
> I am using ubuntu14.04LTS: qmp version: 
> {"QMP": {"version": {"qemu": {"micro": 0, "minor": 0, "major": 2}, "package": 
> " (Debian 2.0.0+dfsg-2ubuntu1.2)"}, "capabilities": []}}
> 
> Here's what I am doing:
> 1.  /usr/bin/kvm-spice -hda kvmimages/ubuntu.image -m 768 -usbdevice tablet 
> -vnc :5 -qmp tcp:localhost:4444,server,nowait
> 
> 2.  telnet localhost 4444
> 
> 3.  In the telnet session run:
> {"execute":"qmp_capabilities"}
> {"return": {}}
> { "execute": "blockdev-add",
>    "arguments": { "options" : {
>         "id": "disk1",
>         "driver": "qcow2",
>       "file": { "driver": "file",
>             "filename": "testvm.qc2" } } } }
> {"return": {}}
> 
> { "execute": "query-block" }

This is only the backend part.  You need "device-add" command to add a guest
visible frontend device, and specify the type (ide, scsi, etc..).

Thansk,
Fam

> 
> 4. query-block returns the device "disk1", but when I check the vm:
>    # vncviewer :5
>    
> there are no new devices.
> 
> I thought that maybe it is a hotplug SATA bug detailed here: 
> http://ubuntuforums.org/showthread.php?t=1998055
> 
> but running:
> #rescan-scsi-bus resulted in no new block devices.
> 
> Thanks for any help!
> 
> Ken
> 



reply via email to

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