p7zip: assorted fixes
[oi-userland.git] / components / openindiana / kvm / patches / banquo.patch
blobedb07fb2d527e1146ebbc1e70bef36cc2625bdfc
1 From 1332407a0739b26d664428f5d3c1e7bc1161d7e2 Mon Sep 17 00:00:00 2001
2 From: Dan McDonald <danmcd@omniti.com>
3 Date: Fri, 8 May 2015 09:50:27 -0400
4 Subject: [PATCH] Revert "HVM-797 Vanquish Banquo's ghost"
6 This reverts commit 43aa6602f0d68ff7e032aad06645e34e9921d976.
7 ---
8 kvm.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
9 kvm.h | 1 +
10 2 files changed, 58 insertions(+)
12 diff --git a/kvm.c b/kvm.c
13 index 6e136ac..1a55f49 100644
14 --- a/kvm.c
15 +++ b/kvm.c
16 @@ -2634,6 +2634,63 @@ kvm_ioctl(dev_t dev, int cmd, intptr_t arg, int md, cred_t *cr, int *rv)
17 rval = kvm_vcpu_ioctl_nmi(ksp->kds_vcpu);
18 break;
20 + case KVM_NET_QUEUE: {
21 + struct vnode *vn;
22 + file_t *fp;
23 + struct stroptions *stropt;
24 + mblk_t *mp;
25 + queue_t *q;
27 + fp = getf(arg);
28 + if (fp == NULL) {
29 + rval = EINVAL;
30 + break;
31 + }
32 + ASSERT(fp->f_vnode);
34 + if (fp->f_vnode->v_stream == NULL) {
35 + releasef(arg);
36 + rval = EINVAL;
37 + break;
38 + }
40 + mp = allocb(sizeof (struct stroptions), BPRI_LO);
41 + if (mp == NULL) {
42 + releasef(arg);
43 + rval = ENOMEM;
44 + }
46 + /*
47 + * This really just shouldn't need to exist, etc. and we
48 + * should really get the hiwat value more intelligently at least
49 + * a #define or a tunable god forbid. Oh well, as bmc said
50 + * earlier:
51 + * "I am in blood steeped in so far that I wade no more.
52 + * Returning were as tedious as go o'er.
53 + *
54 + * We'd love to just putmsg on RD(fp->f_vnode->v_stream->sd_wq)
55 + * however that would be the stream head. Instead, we need to
56 + * get the write version and then go to the next one and then
57 + * the opposite end. The doctor may hemorrhage before the
58 + * patient.
59 + *
60 + * Banquo's ghost is waiting to pop up
61 + */
62 + mp->b_datap->db_type = M_SETOPTS;
63 + stropt = (struct stroptions *)mp->b_rptr;
64 + stropt->so_flags = SO_HIWAT;
65 + stropt->so_hiwat = kvm_hiwat;
66 + q = WR(fp->f_vnode->v_stream->sd_wrq);
67 + q = RD(q->q_next);
68 + putnext(q, mp);
70 + releasef(arg);
72 + rval = 0;
73 + *rv = 0;
74 + break;
75 + }
77 default:
78 KVM_TRACE1(bad__ioctl, int, cmd);
79 rval = EINVAL; /* x64, others may do other things... */
80 diff --git a/kvm.h b/kvm.h
81 index 7211b55..874c701 100644
82 --- a/kvm.h
83 +++ b/kvm.h
84 @@ -288,6 +288,7 @@ typedef struct kvm_guest_debug {
85 #define KVM_CREATE_VM _IO(KVMIO, 0x01) /* returns a VM fd */
86 #define KVM_GET_MSR_INDEX_LIST _IOWR(KVMIO, 0x02, struct kvm_msr_list)
87 #define KVM_CLONE _IO(KVMIO, 0x20)
88 +#define KVM_NET_QUEUE _IO(KVMIO, 0x21)
91 * Check if a kvm extension is available. Argument is extension number,
92 --
93 2.3.0