vmware-host-modules icon indicating copy to clipboard operation
vmware-host-modules copied to clipboard

Solve error: 'dev_base_lock' undeclared

Open l0veormiss opened this issue 11 months ago • 4 comments

Because after we use the script to obtain the code, a "dev_base_lock undeclared" code error occurs during compilation. Let's solve this code error problem.

#Switch root user cd /tmp/patch-vmware/vmware-host-modules/vmnet-only vim vmnetInt.h

#define read_lock_list() read_lock(&dev_base_lock) #define read_unlock_list() read_unlock(&dev_base_lock)

change

#define read_lock_list() rcu_read_lock() #define read_unlock_list() rcu_read_unlock()

cd /tmp/patch-vmware/vmware-host-modules make make install modprobe vmmon vmnet

#Now start vmware

l0veormiss avatar Jan 02 '25 14:01 l0veormiss

lol

l0veormiss avatar Jan 02 '25 14:01 l0veormiss

Bravo

sudo-arash avatar Jan 24 '25 13:01 sudo-arash

I just did made this into a pull request.

sudo-arash avatar Jan 24 '25 13:01 sudo-arash

In my case, additional changes to the bridge.c file are required.

bridge.c: In function ‘VNetBridgeReceiveFromVNet’:
bridge.c:587:4: error: implicit declaration of function ‘dev_lock_list’; did you mean ‘read_lock_list’? [-Wimplicit-function-declaration]
  587 |    dev_lock_list();
      |    ^~~~~~~~~~~~~
      |    read_lock_list
bridge.c:590:7: error: implicit declaration of function ‘dev_unlock_list’; did you mean ‘read_unlock_list’? [-Wimplicit-function-declaration]
  590 |       dev_unlock_list();
      |       ^~~~~~~~~~~~~~~
      |       read_unlock_list

gleb-kun avatar Feb 11 '25 11:02 gleb-kun

The lines I needed to edit on 16.2.5 were slightly different

#define dev_lock_list() read_lock(&dev_base_lock) #define dev_unlock_list() read_unlock(&dev_base_lock)

Changed to:

#define dev_lock_list() rcu_read_lock() #define dev_unlock_list() rcu_read_unlock()

Works great, thanks!!

mickjc750 avatar Mar 04 '25 03:03 mickjc750