From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: Frederic Konrad <fred.konrad@greensocs.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [QEMU question] Disk hot plugging without working PCI hotplug - possible?
Date: Fri, 07 Jun 2013 13:40:48 +1000 [thread overview]
Message-ID: <51B15640.1070602@ozlabs.ru> (raw)
In-Reply-To: <51B09CD7.2060805@greensocs.com>
On 06/07/2013 12:29 AM, Frederic Konrad wrote:
> On 06/06/2013 15:59, Alexey Kardashevskiy wrote:
>> On 06.06.2013 22:44, Frederic Konrad wrote:
>>> On 06/06/2013 12:13, Alexey Kardashevskiy wrote:
>>>> Hi!
>>>>
>>>> For the pseries platform (server PPC64) we do not support PCI hotplug
>>>> yet.
>>>> However we still want to hot plug disks.
>>>>
>>>> As a workaround, we could add multiple SCSI host devices
>>>> (virtio-scsi-pci,
>>>> spapr-vscsi) without any disk attached and later (using qemu console)
>>>> attach drives to them as we do with the "-drive" parameter in the
>>>> command line.
>>>>
>>>> So I enabled CONFIG_PCI_HOTPLUG_OLD=y and tried.
>>>>
>>>> However, drive_add console command works only with PCI what eliminates
>>>> "spapr-vscsi" from the list. Oookay.
>>>>
>>>> Then I tried running qemu with "-device virtio-scsi-pci,id=device0" and
>>>> later doing "drive_add 0 file=virtimg/test1" from the qemu console. This
>>>> time qemu responded with "Device is not a SCSI adapter" what is
>>>> correct as
>>>> nowadays virtio-XXXX-pci devices are not what are they called as they
>>>> simply create underlying virtio-bus, attach a real virtio-XXXX-device
>>>> there
>>>> (which is not PCI) and only then attach disk to non-PCI virtio device.
>>> Hi,
>>>
>>> Seems it's a bug: il should be compatible with the old virtio-scsi-pci.
>>> What's the meaning of the "0" in drive_add command?
>> It is a PCI slot number, the complete address would include a domain and
>> a bus.
>>
>>
>
> Ok thanks, I'll take a look.
>>> Fred
>>>> So as I see there is no way to attach a disk to an existing controller in
>>>> already running qemu.
>>>>
>>>> This is how I add disks to qemu now:
>>>> -device virtio-scsi-pci,id=virtioscsi0 \
>>>> -drive file=virtimg/fc18guest,if=none,id=drive0,readonly=off,
>>>> format=raw,media=disk,werror=stop,rerror=stop \
>>>> -device scsi-disk,id=scsidisk0,bus=virtioscsi0.0,channel=0,
>>>> scsi-id=0,lun=0,drive=drive0,removable=off \
>
> This two last command isn't available in the monitor?
>>>>
>>>> I want to only add "-device virtio-scsi-pci,id=virtioscsi0" to the
>>>> command
>>>> line and do the rest from the qemu console.
>>>>
>>>> Am I missing some useful command from qemu console or anything else?
>>>> Thanks!
This works (thanks to Anthony):
./qemu-system-ppc64 \
-L "qemu-ppc64-bios/" \
-nodefaults \
-chardev "stdio,id=char1,signal=off,mux=on" \
-device "spapr-vty,id=ser1,chardev=char1" \
-mon "chardev=char1,mode=readline,id=mon1" \
-m "1024" \
-machine "pseries" \
-nographic \
-vga "none" \
-enable-kvm \
-kernel "guest.vmlinux.n" \
-initrd "1.cpio" \
-device "virtio-scsi-pci,id=foo"
And then issue 2 commands in the qemu console:
drive_add auto file=virtimg/fc18guest,if=none,id=bar
device_add scsi-disk,bus=foo.0,drive=bar,unit=0
The guest is even able to autodetect new volume. Profit.
--
Alexey
prev parent reply other threads:[~2013-06-07 3:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-06 10:13 [Qemu-devel] [QEMU question] Disk hot plugging without working PCI hotplug - possible? Alexey Kardashevskiy
2013-06-06 12:44 ` Frederic Konrad
2013-06-06 13:59 ` Alexey Kardashevskiy
2013-06-06 14:29 ` Frederic Konrad
2013-06-07 0:05 ` Alexey Kardashevskiy
2013-06-07 3:40 ` Alexey Kardashevskiy [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51B15640.1070602@ozlabs.ru \
--to=aik@ozlabs.ru \
--cc=fred.konrad@greensocs.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).