}
-static int vnet_nic_free(struct vm_device * dev) {
+static int vnet_nic_free(struct vnet_nic_state * vnetnic) {
+
+
+ V3_Free(vnetnic);
return 0;
}
static struct v3_device_ops dev_ops = {
- .free = vnet_nic_free,
+ .free = (int (*)(void *))vnet_nic_free,
};
&(vnetnic->net_ops), frontend_cfg, vnetnic) == -1) {
PrintError("Could not connect %s to frontend %s\n",
dev_id, v3_cfg_val(frontend_cfg, "tag"));
- v3_remove_device(vnetnic);
+ v3_remove_device(dev);
return -1;
}
if ((vnet_dev_id = register_to_vnet(vm, vnetnic, dev_id, vnetnic->mac)) == -1) {
PrintError("Vnet-nic device %s (mac: %s) fails to registered to VNET\n", dev_id, macstr);
- v3_remove_device(vnetnic);
+ v3_remove_device(dev);
return 0;
}