Maor Lipchuk has uploaded a new change for review.

Change subject: core: Force remove storage will leave VM permissions
......................................................................

core: Force remove storage will leave VM permissions

Remove of VM will not remove its permissions, since before the remove of
the permissions we remove the image from image_storage_domain_map which
vm_images_view is based on, and therefore it will not fetch this image

Change-Id: I7445f9ba7c08936e66cab0b043f4dbaaa483e482
Signed-off-by: Maor Lipchuk <mlipc...@redhat.com>
---
M packaging/dbscripts/storages_sp.sql
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/84/18184/1

diff --git a/packaging/dbscripts/storages_sp.sql 
b/packaging/dbscripts/storages_sp.sql
index b72c9b0..f75b979 100644
--- a/packaging/dbscripts/storages_sp.sql
+++ b/packaging/dbscripts/storages_sp.sql
@@ -589,7 +589,6 @@
          where entity_type = 'TEMPLATE' and storage_id = v_storage_domain_id;
    END;
 
-   delete FROM image_storage_domain_map where storage_domain_id = 
v_storage_domain_id;
 
    delete FROM permissions where object_id in (select vm_id as vm_guid from 
vm_images_view
                                                               JOIN vm_device 
ON vm_device.device_id = vm_images_view.disk_id
@@ -597,6 +596,8 @@
    delete FROM snapshots WHERE vm_id in (select vm_id as vm_guid from 
vm_images_view
                                          JOIN vm_device ON vm_device.device_id 
= vm_images_view.disk_id
                                          where v_storage_domain_id in (SELECT 
* FROM fnsplitteruuid(storage_id)));
+
+   delete FROM image_storage_domain_map where storage_domain_id = 
v_storage_domain_id;
    delete FROM images where image_guid in (select image_id from 
tt_TEMPSTORAGEDOMAINMAPTABLE);
    delete FROM vm_interface where vmt_guid in(select vm_guid from 
TEMPLATES_IDS_TEMPORARY_TABLE);
    delete FROM permissions where object_id in (select vm_guid from 
TEMPLATES_IDS_TEMPORARY_TABLE);


-- 
To view, visit http://gerrit.ovirt.org/18184
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7445f9ba7c08936e66cab0b043f4dbaaa483e482
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Maor Lipchuk <mlipc...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to