Split out body of loop in _sync_power_states in compute manager
Split out body of loop in _sync_power_states in compute manager

The _sync_power_states method in the compute manager iterates
over all instances in the DB, synchronizing their power
states. The introduction of async events to the compute
drivers requires a method for synchronizing the power state
of a single instance at a time. Split out the body of the
loop in _sync_power_states to a method _sync_instance_power_state

Blueprint: compute-driver-events
Change-Id: I5eee72b39f765a2444388005fabba2cff7ff4b29
Signed-off-by: Daniel P. Berrange <bb938cf255e055ff3507f2627d214e8e62118fcf@redhat.com>

yrobla/nova,j-carpentier/nova,Yusuke1987/openstack_template,sridevikoushik31/nova,zhimin711/nova,raildo/nova,alexandrucoman/vbox-nova-driver,varunarya10/nova_test_latest,gspilio/nova,imsplitbit/nova,Juniper/nova,cyx1231st/nova,belmiromoreira/nova,devendermishrajio/nova_test_latest,cloudbase/nova,jeffrey4l/nova,vmturbo/nova,bclau/nova,Triv90/Nova,Yusuke1987/openstack_template,ntt-sic/nova,mahak/nova,isyippee/nova,mandeepdhami/nova,SUSE-Cloud/nova,tudorvio/nova,felixma/nova,varunarya10/nova_test_latest,mandeepdhami/nova,CloudServer/nova,sebrandon1/nova,dims/nova,cloudbau/nova,rahulunair/nova,scripnichenko/nova,edulramirez/nova,thomasem/nova,joker946/nova,tealover/nova,shootstar/novatest,mikalstill/nova,yrobla/nova,TwinkleChawla/nova,akash1808/nova,badock/nova,barnsnake351/nova,akash1808/nova_test_latest,dawnpower/nova,luogangyi/bcec-nova,rajalokan/nova,TieWei/nova,ted-gould/nova,spring-week-topos/nova-week,scripnichenko/nova,shail2810/nova,openstack/nova,cloudbase/nova,cernops/nova,jeffrey4l/nova,tudorvio/nova,CCI-MOC/nova,projectcalico/calico-nova,phenoxim/nova,rickerc/nova_audit,zaina/nova,dstroppa/openstack-smartos-nova-grizzly,shahar-stratoscale/nova,sebrandon1/nova,BeyondTheClouds/nova,tangfeixiong/nova,sridevikoushik31/nova,alexandrucoman/vbox-nova-driver,isyippee/nova,phenoxim/nova,TwinkleChawla/nova,jianghuaw/nova,petrutlucian94/nova_dev,mmnelemane/nova,ewindisch/nova,j-carpentier/nova,eharney/nova,blueboxgroup/nova,citrix-openstack-build/nova,vladikr/nova_drafts,alvarolopez/nova,JioCloud/nova,noironetworks/nova,watonyweng/nova,CEG-FYP-OpenStack/scheduler,sridevikoushik31/openstack,Juniper/nova,apporc/nova,citrix-openstack-build/nova,angdraug/nova,LoHChina/nova,leilihh/novaha,mmnelemane/nova,apporc/nova,Triv90/Nova,Yuriy-Leonov/nova,sacharya/nova,CiscoSystems/nova,jianghuaw/nova,silenceli/nova,ruslanloman/nova,vmturbo/nova,affo/nova,projectcalico/calico-nova,cernops/nova,maheshp/novatest,mahak/nova,Brocade-OpenSource/OpenStack-DNRM-Nova,Metaswitch/calico-nova,akash1808/nova,alaski/nova,jianghuaw/nova,sridevikoushik31/openstack,virtualopensystems/nova,CEG-FYP-OpenStack/scheduler,yatinkumbhare/openstack-nova,zzicewind/nova,Stavitsky/nova,joker946/nova,tanglei528/nova,rahulunair/nova,CloudServer/nova,double12gzh/nova,leilihh/novaha,redhat-openstack/nova,tianweizhang/nova,sebrandon1/nova,vmturbo/nova,eayunstack/nova,orbitfp7/nova,noironetworks/nova,NeCTAR-RC/nova,whitepages/nova,maheshp/novatest,saleemjaveds/https-github.com-openstack-nova,adelina-t/nova,Juniper/nova,eayunstack/nova,zhimin711/nova,tianweizhang/nova,DirectXMan12/nova-hacking,silenceli/nova,watonyweng/nova,cernops/nova,rickerc/nova_audit,LoHChina/nova,rajalokan/nova,spring-week-topos/nova-week,petrutlucian94/nova_dev,akash1808/nova_test_latest,alaski/nova,openstack/nova,shahar-stratoscale/nova,dstroppa/openstack-smartos-nova-grizzly,tealover/nova,rajalokan/nova,thomasem/nova,leilihh/nova,JioCloud/nova_test_latest,maelnor/nova,MountainWei/nova,MountainWei/nova,ntt-sic/nova,eonpatapon/nova,iuliat/nova,Brocade-OpenSource/OpenStack-DNRM-Nova,dawnpower/nova,gspilio/nova,cloudbase/nova-virtualbox,cloudbase/nova-virtualbox,virtualopensystems/nova,takeshineshiro/nova,JianyuWang/nova,sridevikoushik31/nova,CCI-MOC/nova,klmitch/nova,OpenAcademy-OpenStack/nova-scheduler,badock/nova,dims/nova,gooddata/openstack-nova,devendermishrajio/nova_test_latest,angdraug/nova,mgagne/nova,affo/nova,rajalokan/nova,sacharya/nova,Francis-Liu/animated-broccoli,bgxavier/nova,gooddata/openstack-nova,klmitch/nova,qwefi/nova,CiscoSystems/nova,zaina/nova,edulramirez/nova,mgagne/nova,hanlind/nova,shail2810/nova,yosshy/nova,hanlind/nova,JioCloud/nova,yosshy/nova,belmiromoreira/nova,Yuriy-Leonov/nova,Stavitsky/nova,bigswitch/nova,iuliat/nova,Francis-Liu/animated-broccoli,shootstar/novatest,NeCTAR-RC/nova,fnordahl/nova,petrutlucian94/nova,kimjaejoong/nova,zzicewind/nova,Triv90/Nova,takeshineshiro/nova,whitepages/nova,viggates/nova,bgxavier/nova,eharney/nova,maelnor/nova,berrange/nova,Metaswitch/calico-nova,gooddata/openstack-nova,ewindisch/nova,felixma/nova,nikesh-mahalka/nova,saleemjaveds/https-github.com-openstack-nova,mahak/nova,eonpatapon/nova,leilihh/nova,rrader/nova-docker-plugin,Tehsmash/nova,devendermishrajio/nova,imsplitbit/nova,bigswitch/nova,adelina-t/nova,hanlind/nova,double12gzh/nova,kimjaejoong/nova,jianghuaw/nova,tanglei528/nova,SUSE-Cloud/nova,BeyondTheClouds/nova,redhat-openstack/nova,blueboxgroup/nova,plumgrid/plumgrid-nova,BeyondTheClouds/nova,vladikr/nova_drafts,barnsnake351/nova,mikalstill/nova,fnordahl/nova,alvarolopez/nova,OpenAcademy-OpenStack/nova-scheduler,petrutlucian94/nova,JioCloud/nova_test_latest,ted-gould/nova,TieWei/nova,cloudbau/nova,ruslanloman/nova,klmitch/nova,maheshp/novatest,berrange/nova,devendermishrajio/nova,yrobla/nova,Tehsmash/nova,plumgrid/plumgrid-nova,rrader/nova-docker-plugin,Juniper/nova,yatinkumbhare/openstack-nova,qwefi/nova,gspilio/nova,raildo/nova,luogangyi/bcec-nova,vmturbo/nova,DirectXMan12/nova-hacking,rahulunair/nova,mikalstill/nova,dstroppa/openstack-smartos-nova-grizzly,nikesh-mahalka/nova,devoid/nova,openstack/nova,gooddata/openstack-nova,JianyuWang/nova,klmitch/nova,bclau/nova,tangfeixiong/nova,orbitfp7/nova,devoid/nova,cyx1231st/nova,DirectXMan12/nova-hacking,cloudbase/nova,viggates/nova,sridevikoushik31/nova,sridevikoushik31/openstack