extern int instance_send_access_status(struct inst_info *inst, int status);
extern int instance_forward_packet(struct inst_info *inst, struct packet *packet);
+extern const struct client_node *instance_pd_owner(struct inst_info *inst);
+
/*!
* Multiple viewer
*/
if (util_free_space(IMAGE_PATH) < MINIMUM_SPACE) {
ret = LB_STATUS_ERROR_NO_SPACE;
+ } else if (instance_pd_owner(inst)) {
+ ret = LB_STATUS_ERROR_ALREADY;
} else if (package_pd_type(instance_package(inst)) == PD_TYPE_BUFFER) {
lazy_pd_destroyed_cb(inst);
if (ret != LB_STATUS_SUCCESS)
goto out;
- if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
+ if (instance_pd_owner(inst) != client) {
+ ret = instance_pd_owner(inst) == NULL ? LB_STATUS_ERROR_ALREADY : LB_STATUS_ERROR_PERMISSION;
+ } else if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
int resize_aborted = 0;
pd_monitor = instance_del_data(inst, "pd,open,monitor");
goto out;
}
+ if (instance_get_data(inst, "lazy,pd,close") || instance_get_data(inst, "pd,close,monitor")) {
+ ret = LB_STATUS_ERROR_ALREADY;
+ goto out;
+ }
+
pd_monitor = instance_del_data(inst, "pd,resize,monitor");
if (pd_monitor) {
ErrPrint("PD Resize request is found. clear it [%s]\n", pkgname);