title: Using custom qemu binary with libvirt fails?
body: <p>I have a locally built qemu. I am using libvirt python API to defineXML. I get the error:</p>
  
  <blockquote>
    <p>libvirt:  error : internal error: Child process (LC_ALL=C
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    /home/deepti/testqemu/bin/qemu-system-arm -help) unexpected exit
    status 126: libvirt:  error : cannot execute binary
    /home/deepti/testqemu/bin/qemu-system-arm: Permission denied Traceback
    (most recent call last):   File "testcustomQemu.py", line 70, in
    
        dom = conn.defineXML(xmlconfig)   File "/home/deepti/.virtualenvs/testlibvirt/local/lib/python2.7/site-packages/libvirt.py",
    line 3685, in defineXML
        if ret is None:raise libvirtError('virDomainDefineXML() failed', conn=self) libvirt.libvirtError: internal error: Child process
    (LC_ALL=C
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    /home/deepti/testqemu/bin/qemu-system-arm -help) unexpected exit
    status 126: libvirt:  error : cannot execute binary
    /home/deepti/testqemu/bin/qemu-system-arm: Permission denied</p>
  </blockquote>
  
  <p>The ownership for <code>/home/deepti/testqemu</code> is <code>root:root</code>. Changing the permission to <code>+x</code> also does not work.</p>
  
  <p>What am I missing. How can I get my custom qemu to be taken?</p>
  
  <p>My script and xml are as below:</p>
  
  <pre><code>import libvirt
  import sys
  
  xmlconfig = """&lt;domain type='qemu' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'&gt;
    &lt;name&gt;limom_instance&lt;/name&gt;
    &lt;uuid&gt;35615c44-b004-4b3f-9f42-da182b9662ef&lt;/uuid&gt;
    &lt;memory unit='KiB'&gt;786432&lt;/memory&gt;
    &lt;currentMemory unit='KiB'&gt;786432&lt;/currentMemory&gt;
    &lt;vcpu&gt;1&lt;/vcpu&gt;
    &lt;os&gt;
      &lt;type arch='armv7l' machine='limott'&gt;hvm&lt;/type&gt;
      &lt;kernel&gt;/home/deepti/limom/FinalArtifacts/kerneldist1/zImage&lt;/kernel&gt;
      &lt;dtb&gt;/home/deepti/limom/FinalArtifacts/dtbdist1/emmc.dtb&lt;/dtb&gt;
    &lt;/os&gt;
    &lt;clock offset='utc'/&gt;
    &lt;on_poweroff&gt;destroy&lt;/on_poweroff&gt;
    &lt;on_reboot&gt;restart&lt;/on_reboot&gt;
    &lt;on_crash&gt;destroy&lt;/on_crash&gt;
    &lt;devices&gt;
      &lt;emulator&gt;/home/deepti/testqemu/bin/qemu-system-arm&lt;/emulator&gt;
      &lt;serial type='pty'&gt;
        &lt;target port='0'/&gt;
      &lt;/serial&gt;
      &lt;serial type='pty'&gt;
        &lt;target port='1'/&gt;
      &lt;/serial&gt;
      &lt;serial type='pty'&gt;
        &lt;target port='2'/&gt;
      &lt;/serial&gt;
      &lt;serial type='pty'&gt;
        &lt;target port='3'/&gt;
      &lt;/serial&gt;
      &lt;console type='pty'&gt;
        &lt;target type='serial' port='0'/&gt;
      &lt;/console&gt;
      &lt;memballoon model='none'/&gt;
    &lt;/devices&gt;
    &lt;qemu:commandline&gt;
      &lt;qemu:arg value='-sdl'/&gt;  
      &lt;qemu:arg value='-show-cursor'/&gt;
      &lt;qemu:arg value='-nographic'/&gt;
      &lt;qemu:arg value='-sd'/&gt;
      &lt;qemu:arg value='/home/deepti/limom/FinalArtifacts/emmc.dat'/&gt;
    &lt;/qemu:commandline&gt;
  &lt;/domain&gt;"""
  
  conn = libvirt.open('qemu:///system')
  if conn == None:
      print('Failed to open connection to qemu:///system')
      exit(1)
  
  uri = conn.getURI()
  print('Canonical URI: '+uri)
  dom = conn.defineXML(xmlconfig)
  if dom == None:
      print('Failed to define a domain from an XML definition')
      exit(1)
  
  
  conn.close()
  </code></pre>