Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102186727
D30049.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D30049.id.diff
View Options
diff --git a/sys/dev/virtio/block/virtio_blk.c b/sys/dev/virtio/block/virtio_blk.c
--- a/sys/dev/virtio/block/virtio_blk.c
+++ b/sys/dev/virtio/block/virtio_blk.c
@@ -126,6 +126,7 @@
static int vtblk_suspend(device_t);
static int vtblk_resume(device_t);
static int vtblk_shutdown(device_t);
+static int vtblk_attach_completed(device_t);
static int vtblk_config_change(device_t);
static int vtblk_open(struct disk *);
@@ -255,6 +256,7 @@
DEVMETHOD(device_shutdown, vtblk_shutdown),
/* VirtIO methods. */
+ DEVMETHOD(virtio_attach_completed, vtblk_attach_completed),
DEVMETHOD(virtio_config_change, vtblk_config_change),
DEVMETHOD_END
@@ -378,8 +380,6 @@
goto fail;
}
- vtblk_create_disk(sc);
-
virtqueue_enable_intr(sc->vtblk_vq);
fail:
@@ -461,6 +461,22 @@
return (0);
}
+static int
+vtblk_attach_completed(device_t dev)
+{
+ struct vtblk_softc *sc;
+
+ sc = device_get_softc(dev);
+
+ /*
+ * Create disk after attach as VIRTIO_BLK_T_GET_ID can only be
+ * processed after the device acknowledged
+ * VIRTIO_CONFIG_STATUS_DRIVER_OK.
+ */
+ vtblk_create_disk(sc);
+ return (0);
+}
+
static int
vtblk_config_change(device_t dev)
{
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 9, 4:27 PM (18 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14561908
Default Alt Text
D30049.id.diff (1 KB)
Attached To
Mode
D30049: virtio_blk: Fix issuing T_GET_ID before DRIVER_OK status
Attached
Detach File
Event Timeline
Log In to Comment