Ryan Harper has uploaded a new change for review.
Change subject: Fix vdsm-faqemu VM launch failure on hosts with newer libvirt ......................................................................
Fix vdsm-faqemu VM launch failure on hosts with newer libvirt
Since January 2012, libvirt now checks[1] for the presence of /dev/kvm before starting a VM to generate better error messages when a VM doesn't start. This breaks faqemu running in a VM (non-nested) or a host which doesn't have KVM modules loaded. Work around this by touching the device node.
v1->v2 - replace exec of touch with open+write+close
1. libvirt commit hash 32f63e912d3bef42a7fa70a0f2d5b04b98afe936
Change-Id: Iffe19758171e3808e42ed50d309dc4be1f9492cc Signed-off-by: Ryan Harper ryanh@us.ibm.com --- M vdsm_hooks/faqemu/vdsm-faqemu 1 file changed, 4 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/59/7359/1
diff --git a/vdsm_hooks/faqemu/vdsm-faqemu b/vdsm_hooks/faqemu/vdsm-faqemu index 218af7f..85822a9 100644 --- a/vdsm_hooks/faqemu/vdsm-faqemu +++ b/vdsm_hooks/faqemu/vdsm-faqemu @@ -19,4 +19,8 @@ qemu_argv += [ "-no-kvm" ]
qemu_argv += filter(lambda x: x != "-enable-kvm", sys.argv[1:]) +# libvirt 0.9.10+ checks for the presence of /dev/kvm to provide +# better error messages, but this breaks this hook, fake it out +if not os.path.exists('/dev/kvm'): + open('/dev/kvm', 'w+').close() os.execv(qemu_bin, qemu_argv)
-- To view, visit http://gerrit.ovirt.org/7359 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange Gerrit-Change-Id: Iffe19758171e3808e42ed50d309dc4be1f9492cc Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Ryan Harper ryanh@us.ibm.com
Ryan Harper has posted comments on this change.
Change subject: Fix vdsm-faqemu VM launch failure on hosts with newer libvirt ......................................................................
Patch Set 1: Verified
Updated this patch to replace exec of touch. Also added a check to only attempt to touch /dev/kvm if it's not present. This prevents the need to actually open the file for writing, which fails permission checks if the file already exists (for example from a previous exec of the hook).
I've tested this with:
1) running 3.1 release engine against to F17 VMs with the hook installed. 2) Creating a VM on the host (fails without this) 3) stopping a VM on the host 4) starting the VM a second time (this failed without the check to see if /dev/kvm already exists).
-- To view, visit http://gerrit.ovirt.org/7359 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Iffe19758171e3808e42ed50d309dc4be1f9492cc Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Fix vdsm-faqemu VM launch failure on hosts with newer libvirt ......................................................................
Patch Set 1:
Build Successful
http://jenkins.ovirt.info/job/patch_vdsm_unit_tests/544/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/7359 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Iffe19758171e3808e42ed50d309dc4be1f9492cc Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has posted comments on this change.
Change subject: Fix vdsm-faqemu VM launch failure on hosts with newer libvirt ......................................................................
Patch Set 1: Looks good to me, but someone else must approve
-- To view, visit http://gerrit.ovirt.org/7359 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Iffe19758171e3808e42ed50d309dc4be1f9492cc Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Mark Wu has posted comments on this change.
Change subject: Fix vdsm-faqemu VM launch failure on hosts with newer libvirt ......................................................................
Patch Set 1: Looks good to me, but someone else must approve
-- To view, visit http://gerrit.ovirt.org/7359 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Iffe19758171e3808e42ed50d309dc4be1f9492cc Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has submitted this change and it was merged.
Change subject: Fix vdsm-faqemu VM launch failure on hosts with newer libvirt ......................................................................
Fix vdsm-faqemu VM launch failure on hosts with newer libvirt
Since January 2012, libvirt now checks[1] for the presence of /dev/kvm before starting a VM to generate better error messages when a VM doesn't start. This breaks faqemu running in a VM (non-nested) or a host which doesn't have KVM modules loaded. Work around this by touching the device node.
v1->v2 - replace exec of touch with open+write+close
1. libvirt commit hash 32f63e912d3bef42a7fa70a0f2d5b04b98afe936
Change-Id: Iffe19758171e3808e42ed50d309dc4be1f9492cc Signed-off-by: Ryan Harper ryanh@us.ibm.com --- M vdsm_hooks/faqemu/vdsm-faqemu 1 file changed, 4 insertions(+), 0 deletions(-)
Approvals: Ryan Harper: Verified Mark Wu: Looks good to me, but someone else must approve Dan Kenigsberg: Looks good to me, approved
-- To view, visit http://gerrit.ovirt.org/7359 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: merged Gerrit-Change-Id: Iffe19758171e3808e42ed50d309dc4be1f9492cc Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has posted comments on this change.
Change subject: Fix vdsm-faqemu VM launch failure on hosts with newer libvirt ......................................................................
Patch Set 1: Looks good to me, approved
If Mark is happy with this, so am I ;-)
Thanks, Ryan.
-- To view, visit http://gerrit.ovirt.org/7359 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Iffe19758171e3808e42ed50d309dc4be1f9492cc Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
vdsm-patches@lists.fedorahosted.org