From: Olaf Hering <olaf@aepfle.de>
To: Stefano Stabellini <sstabellini@kernel.org>,
Anthony Perard <anthony.perard@citrix.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Richard Henderson <rth@twiddle.net>,
Eduardo Habkost <ehabkost@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
qemu-devel@nongnu.org, xen-devel@lists.xenproject.org,
Olaf Hering <olaf@aepfle.de>
Subject: [Qemu-devel] [PATCH v2 1/2] xen_platform: unplug also SCSI disks
Date: Fri, 2 Sep 2016 11:43:53 +0200 [thread overview]
Message-ID: <20160902094354.25935-2-olaf@aepfle.de> (raw)
In-Reply-To: <20160902094354.25935-1-olaf@aepfle.de>
Using 'vdev=sd[a-o]' will create an emulated LSI controller, which can
be used by the emulated BIOS to boot from disk. If the HVM domU has also
PV driver the disk may appear twice in the guest. To avoid this an
unplug of the emulated hardware is needed, similar to what is done for
IDE and NIC drivers already.
Since the SCSI controller provides only disks the entire controller can
be unplugged at once.
Impact of the change for classic and pvops based guest kernels:
vdev=sda:disk0
before: pvops: disk0=pv xvda + emulated sda
classic: disk0=pv sda + emulated sdq
after: pvops: disk0=pv xvda
classic: disk0=pv sda
vdev=hda:disk0, vdev=sda:disk1
before: pvops: disk0=pv xvda
disk1=emulated sda
classic: disk0=pv hda
disk1=pv sda + emulated sdq
after: pvops: disk0=pv xvda
disk1=not accessible by blkfront, index hda==index sda
classic: disk0=pv hda
disk1=pv sda
vdev=hda:disk0, vdev=sda:disk1, vdev=sdb:disk2
before: pvops: disk0=pv xvda
disk1=emulated sda
disk2=pv xvdb + emulated sdb
classic: disk0=pv hda
disk1=pv sda + emulated sdq
disk2=pv sdb + emulated sdr
after: pvops: disk0=pv xvda
disk1=not accessible by blkfront, index hda==index sda
disk2=pv xvdb
classic: disk0=pv hda
disk1=pv sda
disk2=pv sda
Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
hw/i386/xen/xen_platform.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/i386/xen/xen_platform.c b/hw/i386/xen/xen_platform.c
index aa78393..53be3c7 100644
--- a/hw/i386/xen/xen_platform.c
+++ b/hw/i386/xen/xen_platform.c
@@ -114,6 +114,10 @@ static void unplug_disks(PCIBus *b, PCIDevice *d, void *o)
PCI_CLASS_STORAGE_IDE
&& strcmp(d->name, "xen-pci-passthrough") != 0) {
pci_piix3_xen_ide_unplug(DEVICE(d));
+ } else if (pci_get_word(d->config + PCI_CLASS_DEVICE) ==
+ PCI_CLASS_STORAGE_SCSI
+ && strcmp(d->name, "xen-pci-passthrough") != 0) {
+ object_unparent(OBJECT(d));
}
}
next prev parent reply other threads:[~2016-09-02 9:44 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-02 9:43 [Qemu-devel] [PATCH v2 0/2] Xen HVM unplug changes Olaf Hering
2016-09-02 9:43 ` Olaf Hering
2016-09-02 9:43 ` Olaf Hering [this message]
2016-09-15 1:50 ` [Qemu-devel] [PATCH v2 1/2] xen_platform: unplug also SCSI disks Stefano Stabellini
2016-09-15 1:50 ` Stefano Stabellini
2016-09-16 7:34 ` Olaf Hering
2016-09-16 7:34 ` [Qemu-devel] " Olaf Hering
2016-09-02 9:43 ` Olaf Hering
2016-09-02 9:43 ` [Qemu-devel] [PATCH v2 2/2] xen_platform: SUSE xenlinux unplug for emulated PCI Olaf Hering
2016-09-02 9:43 ` Olaf Hering
2016-09-15 1:56 ` [Qemu-devel] " Stefano Stabellini
2016-09-15 1:56 ` Stefano Stabellini
2016-09-16 7:38 ` [Qemu-devel] " Olaf Hering
2016-09-16 7:38 ` Olaf Hering
2016-10-14 0:41 ` Stefano Stabellini
2016-10-14 0:41 ` [Qemu-devel] " Stefano Stabellini
2016-10-20 15:54 ` Olaf Hering
2016-10-20 15:54 ` Olaf Hering
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=20160902094354.25935-2-olaf@aepfle.de \
--to=olaf@aepfle.de \
--cc=anthony.perard@citrix.com \
--cc=ehabkost@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.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.