summaryrefslogtreecommitdiffstats
path: root/hw/net
diff options
context:
space:
mode:
authorMiao Yan <yanmiaobest@gmail.com>2015-12-22 22:06:07 -0800
committerTimothy Pearson <tpearson@raptorengineering.com>2019-11-29 19:28:23 -0600
commit0e588f08596722e9ee98f8a308c903d4d25aa400 (patch)
tree2ae42f809b28047c99b39a5dd2aa26ed0212f8ff /hw/net
parentbe7fe1a76e840fc0fc97975a25c4a9dd23bf5089 (diff)
downloadhqemu-0e588f08596722e9ee98f8a308c903d4d25aa400.zip
hqemu-0e588f08596722e9ee98f8a308c903d4d25aa400.tar.gz
net/vmxnet3: return 1 on device activation failure
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 <yanmiaobest@gmail.com> Reviewed-by: Dmitry Fleytman <dmitry@daynix.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'hw/net')
-rw-r--r--hw/net/vmxnet3.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c
index 9c1adfc..8a992d3 100644
--- a/hw/net/vmxnet3.c
+++ b/hw/net/vmxnet3.c
@@ -1662,7 +1662,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;
OpenPOWER on IntegriCloud