All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: Alex Graf <agraf@suse.de>,
	Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: [Qemu-devel] virtio-blk-pci: how to tell if it is CD or HDD?
Date: Wed, 16 Oct 2013 16:04:28 +1100	[thread overview]
Message-ID: <525E1E5C.4090002@ozlabs.ru> (raw)

Hi!

Normally on sPAPR platform the IBMVSCSI host bus adapter is used which is
SCSI. So when we want some image to appear as a DVD to the guest
(particularly SLOF - our firmware), we use "-device scsi-cd". Or QEMU
extracts this automatically from the "media=cdrom" property of "-drive"
(correct?). And then the SCSI bus tells the guest what is what. SLOF
firmware uses this to create "disk" and "cdrom" aliases to correcly apply
the boot order. So far so good.

Now we are trying (via libvirt) to add both HDD and DVD as "virtio-blk-pci"
devices:

-drive file=virtimg/rhel6-root.img,if=none,format=raw,\
id=drive-virtio-disk1,cache=none \
-device virtio-blk-pci,bus=pci,addr=0x4,\
drive=drive-virtio-disk1,id=virtio-disk1,bootindex=2 \
\
-drive file=virtimg/SLES-11-SP3-DVD-ppc64-GM-DVD1.iso,\
if=none,media=cdrom,id=drive-virtio-disk2,readonly=on,\
format=raw\
-device virtio-blk-pci,bus=pci,addr=0x5,\
drive=drive-virtio-disk2,id=virtio-disk2,bootindex=1

No SCSI bus is created in this case. Both devices appear to SLOF as HDDs so
it creates just one "disk" alias and no "cdrom" alias and if we are not
lucky and DVD got bigger PCI slot#, we will never be able to boot from DVD.

Is there any way to distinguish HDD from DVD via virtio protocol from the
guest (i.e. SLOF)? Thanks!


-- 
Alexey

             reply	other threads:[~2013-10-16  5:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-16  5:04 Alexey Kardashevskiy [this message]
2013-10-16  6:36 ` [Qemu-devel] virtio-blk-pci: how to tell if it is CD or HDD? Paolo Bonzini
2013-10-16  7:59   ` Alexey Kardashevskiy
2013-10-17 12:38     ` Alexey Kardashevskiy
2013-10-17 12:54       ` Paolo Bonzini
2013-10-17 13:02         ` Alexander Graf
2013-10-17 13:36           ` Alexey Kardashevskiy
2013-10-17 13:49             ` Paolo Bonzini
2013-10-17 13:09         ` Alexey Kardashevskiy
2013-10-17 13:48           ` Paolo Bonzini
2013-10-18  4:56           ` Nikunj A Dadhania

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=525E1E5C.4090002@ozlabs.ru \
    --to=aik@ozlabs.ru \
    --cc=agraf@suse.de \
    --cc=mst@redhat.com \
    --cc=nikunj@linux.vnet.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.