Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F136994904
D7693.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
D7693.diff
View Options
Index: head/sys/cam/ata/ata_xpt.c
===================================================================
--- head/sys/cam/ata/ata_xpt.c
+++ head/sys/cam/ata/ata_xpt.c
@@ -40,6 +40,7 @@
#include <sys/interrupt.h>
#include <sys/sbuf.h>
+#include <sys/eventhandler.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/sysctl.h>
@@ -872,12 +873,24 @@
{
struct ccb_pathinq cpi;
int16_t *ptr;
+ int veto = 0;
ident_buf = &softc->ident_data;
for (ptr = (int16_t *)ident_buf;
ptr < (int16_t *)ident_buf + sizeof(struct ata_params)/2; ptr++) {
*ptr = le16toh(*ptr);
}
+
+ /*
+ * Allow others to veto this ATA disk attachment. This
+ * is mainly used by VMs, whose disk controllers may
+ * share the disks with the simulated ATA controllers.
+ */
+ EVENTHANDLER_INVOKE(ada_probe_veto, path, ident_buf, &veto);
+ if (veto) {
+ goto device_fail;
+ }
+
if (strncmp(ident_buf->model, "FX", 2) &&
strncmp(ident_buf->model, "NEC", 3) &&
strncmp(ident_buf->model, "Pioneer", 7) &&
Index: head/sys/sys/eventhandler.h
===================================================================
--- head/sys/sys/eventhandler.h
+++ head/sys/sys/eventhandler.h
@@ -270,4 +270,11 @@
EVENTHANDLER_DECLARE(register_framebuffer, register_framebuffer_fn);
EVENTHANDLER_DECLARE(unregister_framebuffer, unregister_framebuffer_fn);
+/* Veto ada attachment */
+struct cam_path;
+struct ata_params;
+typedef void (*ada_probe_veto_fn)(void *, struct cam_path *,
+ struct ata_params *, int *);
+EVENTHANDLER_DECLARE(ada_probe_veto, ada_probe_veto_fn);
+
#endif /* _SYS_EVENTHANDLER_H_ */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 21, 10:52 PM (3 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25802947
Default Alt Text
D7693.diff (1 KB)
Attached To
Mode
D7693: hyperv/storvsc: disable ata but enable CD/DVD and remove stordisengage
Attached
Detach File
Event Timeline
Log In to Comment