if (err < 0)
return err;
- visorbus_create_response(dev, err);
+ visorbus_response(dev, err, CONTROLVM_BUS_CREATE);
+ dev->state.created = 1;
return 0;
}
void visorchipset_bus_destroy(struct visor_device *dev)
{
visorbus_remove_instance(dev);
- visorbus_destroy_response(dev, 0);
+ visorbus_response(dev, 0, CONTROLVM_BUS_DESTROY);
}
int visorchipset_device_create(struct visor_device *dev_info)
if (err < 0)
return err;
- visorbus_device_create_response(dev_info, err);
+ visorbus_response(dev_info, err, CONTROLVM_DEVICE_CREATE);
+ dev_info->state.created = 1;
return 0;
}
void visorchipset_device_destroy(struct visor_device *dev_info)
{
remove_visor_device(dev_info);
- visorbus_device_destroy_response(dev_info, 0);
+ visorbus_response(dev_info, 0, CONTROLVM_DEVICE_DESTROY);
}
/*
int visorchipset_device_pause(struct visor_device *dev_info);
int visorchipset_device_resume(struct visor_device *dev_info);
-void visorbus_create_response(struct visor_device *p, int response);
-void visorbus_destroy_response(struct visor_device *p, int response);
-void visorbus_device_create_response(struct visor_device *p, int response);
-void visorbus_device_destroy_response(struct visor_device *p, int response);
+void visorbus_response(struct visor_device *p, int response, int controlvm_id);
void visorbus_device_resume_response(struct visor_device *p, int response);
void visorbus_device_pause_response(struct visor_device *p, int response);
visorbus_device_create(&local_crash_dev_msg);
}
-void visorbus_create_response(struct visor_device *bus_info, int response)
+void visorbus_response(struct visor_device *bus_info, int response,
+ int controlvm_id)
{
- if (response >= 0)
- bus_info->state.created = 1;
-
- controlvm_responder(CONTROLVM_BUS_CREATE, bus_info->pending_msg_hdr,
- response);
+ controlvm_responder(controlvm_id, bus_info->pending_msg_hdr, response);
kfree(bus_info->pending_msg_hdr);
bus_info->pending_msg_hdr = NULL;
}
-void visorbus_destroy_response(struct visor_device *bus_info, int response)
-{
- controlvm_responder(CONTROLVM_BUS_DESTROY, bus_info->pending_msg_hdr,
- response);
-
- kfree(bus_info->pending_msg_hdr);
- bus_info->pending_msg_hdr = NULL;
-}
-
-void visorbus_device_create_response(struct visor_device *dev_info,
- int response)
-{
- if (response >= 0)
- dev_info->state.created = 1;
-
- controlvm_responder(CONTROLVM_DEVICE_CREATE, dev_info->pending_msg_hdr,
- response);
-
- kfree(dev_info->pending_msg_hdr);
- dev_info->pending_msg_hdr = NULL;
-}
-
-void visorbus_device_destroy_response(struct visor_device *dev_info,
- int response)
-{
- controlvm_responder(CONTROLVM_DEVICE_DESTROY, dev_info->pending_msg_hdr,
- response);
-
- kfree(dev_info->pending_msg_hdr);
- dev_info->pending_msg_hdr = NULL;
-}
-
void visorbus_device_pause_response(struct visor_device *dev_info,
int response)
{