summaryrefslogtreecommitdiffstats
path: root/hw/rdma/vmw
diff options
context:
space:
mode:
authorYuval Shaia2018-12-21 15:40:29 +0100
committerMarcel Apfelbaum2018-12-22 10:09:56 +0100
commite976ebc87cccd0e055d6337543de3f2db4650b17 (patch)
treeb7cbbb575fc9b7686949e57818d6422e6e63416e /hw/rdma/vmw
parenthw/rdma: Initialize node_guid from vmxnet3 mac address (diff)
downloadqemu-e976ebc87cccd0e055d6337543de3f2db4650b17.tar.gz
qemu-e976ebc87cccd0e055d6337543de3f2db4650b17.tar.xz
qemu-e976ebc87cccd0e055d6337543de3f2db4650b17.zip
hw/pvrdma: Make device state depend on Ethernet function state
User should be able to control the device by changing Ethernet function state so if user runs 'ifconfig ens3 down' the PVRDMA function should be down as well. Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com> Reviewed-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com> Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Diffstat (limited to 'hw/rdma/vmw')
-rw-r--r--hw/rdma/vmw/pvrdma_cmd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/rdma/vmw/pvrdma_cmd.c b/hw/rdma/vmw/pvrdma_cmd.c
index 2979582fac..0d3c818c20 100644
--- a/hw/rdma/vmw/pvrdma_cmd.c
+++ b/hw/rdma/vmw/pvrdma_cmd.c
@@ -139,7 +139,8 @@ static int query_port(PVRDMADev *dev, union pvrdma_cmd_req *req,
resp->hdr.ack = PVRDMA_CMD_QUERY_PORT_RESP;
resp->hdr.err = 0;
- resp->attrs.state = attrs.state;
+ resp->attrs.state = dev->func0->device_active ? attrs.state :
+ PVRDMA_PORT_DOWN;
resp->attrs.max_mtu = attrs.max_mtu;
resp->attrs.active_mtu = attrs.active_mtu;
resp->attrs.phys_state = attrs.phys_state;