Mark Wu has uploaded a new change for review.
Change subject: Move actual VM creation function to libvirtvm.py ......................................................................
Move actual VM creation function to libvirtvm.py
To avoid using API in clientIF.py, we move the VM creation function to libvirtvm.py. It should be safe to skip the VM parameters validation in the VM.create() API for recovering exsiting VMs.
If this patch is accepted, we can add a singleton interface for clientIF which can be used for API.py. Otherwise, it will cause circular importing.
Change-Id: I38644263e4b4c3fe836a60405b251768db0a471c Signed-off-by: Mark Wu wudxw@linux.vnet.ibm.com --- M vdsm/API.py M vdsm/clientIF.py M vdsm/libvirtvm.py 3 files changed, 27 insertions(+), 24 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/08/4808/1 -- To view, visit http://gerrit.ovirt.org/4808 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange Gerrit-Change-Id: I38644263e4b4c3fe836a60405b251768db0a471c Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Mark Wu wudxw@linux.vnet.ibm.com
Mark Wu has posted comments on this change.
Change subject: Move actual VM creation function to libvirtvm.py ......................................................................
Patch Set 1: Verified
After applying this patch, I create a VM using vdsm API successfully. After that, I restart vdsmd and see vdsm recovery the existing vm successfully.
-- To view, visit http://gerrit.ovirt.org/4808 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I38644263e4b4c3fe836a60405b251768db0a471c Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com
Adam Litke has posted comments on this change.
Change subject: Move actual VM creation function to libvirtvm.py ......................................................................
Patch Set 1: I would prefer that you didn't submit this
(2 inline comments)
.................................................... File vdsm/libvirtvm.py Line 1363: def create(cls, cif, vmParams): I think this can become a @staticmethod and drop the cls parameter. You will always instantiate a LibvirtVm object so you can use that name explicitly on line 1373.
Line 1380: return {'status': doneCode, 'vmList': vm.status()} Most of this code deals with vmContainerLock management so it feels wrong for it to be here. Why not move this code directly into clientIF? Wouldn't that also solve your circular dependency problem?
-- To view, visit http://gerrit.ovirt.org/4808 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I38644263e4b4c3fe836a60405b251768db0a471c Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com
Dan Kenigsberg has posted comments on this change.
Change subject: Move actual VM creation function to clientIF.py ......................................................................
Patch Set 2: Looks good to me, but someone else must approve
(1 inline comment)
.................................................... File vdsm/clientIF.py Line 290: self.vmContainerLock.acquire() in another patch (not now), you could replace this with with.
-- To view, visit http://gerrit.ovirt.org/4808 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I38644263e4b4c3fe836a60405b251768db0a471c Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com
Dan Kenigsberg has posted comments on this change.
Change subject: Move actual VM creation function to clientIF.py ......................................................................
Patch Set 3: Looks good to me, but someone else must approve
-- To view, visit http://gerrit.ovirt.org/4808 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I38644263e4b4c3fe836a60405b251768db0a471c Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Gal Hammer ghammer@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com
Xu He Jie has posted comments on this change.
Change subject: Move actual VM creation function to clientIF.py ......................................................................
Patch Set 3: Looks good to me, but someone else must approve
-- To view, visit http://gerrit.ovirt.org/4808 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I38644263e4b4c3fe836a60405b251768db0a471c Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Gal Hammer ghammer@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Xu He Jie xuhj@linux.vnet.ibm.com
Mark Wu has posted comments on this change.
Change subject: Move actual VM creation function to clientIF.py ......................................................................
Patch Set 4: Verified
-- To view, visit http://gerrit.ovirt.org/4808 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I38644263e4b4c3fe836a60405b251768db0a471c Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Gal Hammer ghammer@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Xu He Jie xuhj@linux.vnet.ibm.com
Dan Kenigsberg has posted comments on this change.
Change subject: Move actual VM creation function to clientIF.py ......................................................................
Patch Set 4: Looks good to me, approved
-- To view, visit http://gerrit.ovirt.org/4808 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I38644263e4b4c3fe836a60405b251768db0a471c Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Gal Hammer ghammer@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Xu He Jie xuhj@linux.vnet.ibm.com
Dan Kenigsberg has submitted this change and it was merged.
Change subject: Move actual VM creation function to clientIF.py ......................................................................
Move actual VM creation function to clientIF.py
To avoid using API in clientIF.py, we move the VM creation function to clientIF.py. It should be safe to skip the VM parameters validation in the VM.create() API for recovering exsiting VMs.
If this patch is accepted, we can add a singleton interface for clientIF which can be used for API.py. Otherwise, it will cause circular importing.
Change-Id: I38644263e4b4c3fe836a60405b251768db0a471c Signed-off-by: Mark Wu wudxw@linux.vnet.ibm.com --- M vdsm/API.py M vdsm/clientIF.py 2 files changed, 27 insertions(+), 25 deletions(-)
Approvals: Mark Wu: Verified Dan Kenigsberg: Looks good to me, approved
-- To view, visit http://gerrit.ovirt.org/4808 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: merged Gerrit-Change-Id: I38644263e4b4c3fe836a60405b251768db0a471c Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Gal Hammer ghammer@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Xu He Jie xuhj@linux.vnet.ibm.com
vdsm-patches@lists.fedorahosted.org