[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 1/5] net/vmxnet3: return 1 on device activation f
From: |
Miao Yan |
Subject: |
[Qemu-devel] [PATCH v3 1/5] net/vmxnet3: return 1 on device activation failure |
Date: |
Tue, 22 Dec 2015 22:06:07 -0800 |
When reading device status, 0 means device is successfully
activated and 1 means error.
This behavior can be observed by the following steps:
1) run a Linux distro on esxi server (5.5+)
2) modify vmxnet3 Linux driver to give it an invalid
address to 'adapter->shared_pa' which is the
shared memory for guest/host communication
This will trigger device activation failure and kernel
log will have the following message:
[ 7138.403256] vmxnet3 0000:03:00.0 eth1: Failed to activate dev: error 1
So return 1 on device activation failure instead of -1;
Signed-off-by: Miao Yan <address@hidden>
---
Changes in v3:
- mention esxi version in commit message
hw/net/vmxnet3.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c
index e168285..9185408 100644
--- a/hw/net/vmxnet3.c
+++ b/hw/net/vmxnet3.c
@@ -1652,7 +1652,7 @@ static uint64_t vmxnet3_get_command_status(VMXNET3State
*s)
switch (s->last_command) {
case VMXNET3_CMD_ACTIVATE_DEV:
- ret = (s->device_active) ? 0 : -1;
+ ret = (s->device_active) ? 0 : 1;
VMW_CFPRN("Device active: %" PRIx64, ret);
break;
--
1.9.1
- [Qemu-devel] [PATCH v3 0/5] correct some register return values for vxmnet3, Miao Yan, 2015/12/23
- [Qemu-devel] [PATCH v3 1/5] net/vmxnet3: return 1 on device activation failure,
Miao Yan <=
- [Qemu-devel] [PATCH v3 3/5] net/vmxnet3: return correct value for VMXNET3_CMD_GET_DEV_EXTRA_INFO, Miao Yan, 2015/12/23
- [Qemu-devel] [PATCH v3 2/5] net/vmxnet3: return correct value for VMXNET3_CMD_GET_DID_* command, Miao Yan, 2015/12/23
- [Qemu-devel] [PATCH v3 5/5] net/vmxnet3: rename VMXNET3_DEVICE_VERSION to VMXNET3_UPT_REVISION, Miao Yan, 2015/12/23
- [Qemu-devel] [PATCH v3 4/5] net/vmxnet3: return 0 on unknown command, Miao Yan, 2015/12/23
- Re: [Qemu-devel] [PATCH v3 0/5] correct some register return values for vxmnet3, Dmitry Fleytman, 2015/12/23