{"action":"created","issue":{"url":"https://api.github.com/repos/xapi-project/xapi-storage-datapath-plugins/issues/7","labels_url":"https://api.github.com/repos/xapi-project/xapi-storage-datapath-plugins/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/xapi-project/xapi-storage-datapath-plugins/issues/7/comments","events_url":"https://api.github.com/repos/xapi-project/xapi-storage-datapath-plugins/issues/7/events","html_url":"https://github.com/xapi-project/xapi-storage-datapath-plugins/pull/7","id":118348078,"number":7,"title":"Proper {at,de}tach / {ac,deac}tivate split","user":{"login":"jjd27","id":623641,"avatar_url":"https://avatars.githubusercontent.com/u/623641?v=3","gravatar_id":"","url":"https://api.github.com/users/jjd27","html_url":"https://github.com/jjd27","followers_url":"https://api.github.com/users/jjd27/followers","following_url":"https://api.github.com/users/jjd27/following{/other_user}","gists_url":"https://api.github.com/users/jjd27/gists{/gist_id}","starred_url":"https://api.github.com/users/jjd27/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jjd27/subscriptions","organizations_url":"https://api.github.com/users/jjd27/orgs","repos_url":"https://api.github.com/users/jjd27/repos","events_url":"https://api.github.com/users/jjd27/events{/privacy}","received_events_url":"https://api.github.com/users/jjd27/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"jjd27","id":623641,"avatar_url":"https://avatars.githubusercontent.com/u/623641?v=3","gravatar_id":"","url":"https://api.github.com/users/jjd27","html_url":"https://github.com/jjd27","followers_url":"https://api.github.com/users/jjd27/followers","following_url":"https://api.github.com/users/jjd27/following{/other_user}","gists_url":"https://api.github.com/users/jjd27/gists{/gist_id}","starred_url":"https://api.github.com/users/jjd27/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jjd27/subscriptions","organizations_url":"https://api.github.com/users/jjd27/orgs","repos_url":"https://api.github.com/users/jjd27/repos","events_url":"https://api.github.com/users/jjd27/events{/privacy}","received_events_url":"https://api.github.com/users/jjd27/received_events","type":"User","site_admin":false},"milestone":null,"comments":8,"created_at":"2015-11-23T09:52:49Z","updated_at":"2015-12-14T12:49:14Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/xapi-project/xapi-storage-datapath-plugins/pulls/7","html_url":"https://github.com/xapi-project/xapi-storage-datapath-plugins/pull/7","diff_url":"https://github.com/xapi-project/xapi-storage-datapath-plugins/pull/7.diff","patch_url":"https://github.com/xapi-project/xapi-storage-datapath-plugins/pull/7.patch"},"body":"Previously the mapping of SMAPI commands to tapdisk actions was:\r\n * attach => tap.create; tap.open\r\n * activate => noop\r\n * deactivate => tap.close; tap.destroy\r\n * detach => noop\r\n\r\nNow the mapping of SMAPI commands to tapdisk actions is:\r\n * attach => tap.create\r\n * activate => tap.open\r\n * deactivate => tap.close\r\n * detach => tap.destroy\r\n\r\nTo achieve this, the plugin must remember the tapdisk created in attach so that\r\nit can be referred to in activate, deactivate and detach. (Note that it is not\r\npossible to rely on tapdisk.find_by_file as the filename is only associated with\r\nthe tapdisk instance after activate and before detach.) This is achieved by\r\npickling the Tapdisk object to non-persistent storage on the local host and\r\nunpickling it when required.\r\n\r\nAlthough it incurs filesystem I/O, it avoids the need to call\r\ntapdisk.find_by_file -- which invokes tap-ctl list, which can sometimes be very\r\nslow -- so is likely to improve performance, although this has not been\r\nmeasured.\r\n\r\n(Note that it is an explicit design decision for SMAPIv3 datapath plugins to\r\nmanage their own state to avoid making assumptions about other layers, so this\r\napproach is preferable to relying on the caller to carry tapdisk metadata across\r\ninvocations of datapath plugin functions.)\r\n\r\nSigned-off-by: Jonathan Davies <jonathan.davies@citrix.com>"},"comment":{"url":"https://api.github.com/repos/xapi-project/xapi-storage-datapath-plugins/issues/comments/164428545","html_url":"https://github.com/xapi-project/xapi-storage-datapath-plugins/pull/7#issuecomment-164428545","issue_url":"https://api.github.com/repos/xapi-project/xapi-storage-datapath-plugins/issues/7","id":164428545,"user":{"login":"robertbreker","id":4073077,"avatar_url":"https://avatars.githubusercontent.com/u/4073077?v=3","gravatar_id":"","url":"https://api.github.com/users/robertbreker","html_url":"https://github.com/robertbreker","followers_url":"https://api.github.com/users/robertbreker/followers","following_url":"https://api.github.com/users/robertbreker/following{/other_user}","gists_url":"https://api.github.com/users/robertbreker/gists{/gist_id}","starred_url":"https://api.github.com/users/robertbreker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robertbreker/subscriptions","organizations_url":"https://api.github.com/users/robertbreker/orgs","repos_url":"https://api.github.com/users/robertbreker/repos","events_url":"https://api.github.com/users/robertbreker/events{/privacy}","received_events_url":"https://api.github.com/users/robertbreker/received_events","type":"User","site_admin":false},"created_at":"2015-12-14T12:49:14Z","updated_at":"2015-12-14T12:49:14Z","body":"@jjd27 - I've noticed that you've moved around some of this code on your private repo. Please shout once it's ready for final review and merge."}}