Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Disable vhost-net #47

Closed
geertj opened this Issue · 5 comments

2 participants

@geertj

Hi,

I am generating images with Oz on Amazon EC2. Because EC2 does not support nested virtualization, I am using libvirt/qemu in emulation mode.

The VM is a Fedora 17 VM, and i'm using the latest Oz upstream (as of Dec 28). I need the following patch to make it work:

diff --git a/oz/Guest.py b/oz/Guest.py
index 8bef7f2..bf314e4 100644
--- a/oz/Guest.py
+++ b/oz/Guest.py
@@ -415,6 +415,8 @@ class Guest(object):
         interfaceMac.setProp("address", self.macaddr)
         interfaceModel = interface.newChild(None, "model", None)
         interfaceModel.setProp("type", self.nicmodel)
+        interfaceDriver = interface.newChild(None, "driver", None)
+        interfaceDriver.setProp("name", "qemu")
         # input
         inputdev = devices.newChild(None, "input", None)
         if self.mousetype == "ps2":

This basically disables the vhost-net driver.Without the patch above i get the following backtrace:

Traceback (most recent call last):
  File "/usr/bin/oz-install", line 7, in <module>
    execfile(__file__)
  File "/home/ec2-user/oz/oz-install", line 146, in <module>
    libvirt_xml = guest.install(timeout, force_download)
  File "/home/ec2-user/oz/oz/Guest.py", line 1534, in install
    return self._do_install(timeout, force, 0)
  File "/home/ec2-user/oz/oz/Guest.py", line 1515, in _do_install
    dom = self.libvirt_conn.createXML(xml, 0)
  File "/usr/lib64/python2.7/site-packages/libvirt.py", line 2420, in createXML
    if ret is None:raise libvirtError('virDomainCreateXML() failed', conn=self)
libvirt.libvirtError: internal error process exited while connecting to monitor: qemu-system-x86_64: -netdev tap,fd=22,id=hostnet0,vhost=on,vhostfd=23: vhost-net support is not compiled in
qemu-system-x86_64: -netdev tap,fd=22,id=hostnet0,vhost=on,vhostfd=23: vhost-net requested but could not be initialized
qemu-system-x86_64: -netdev tap,fd=22,id=hostnet0,vhost=on,vhostfd=23: Device 'tap' could not be initialized

I think this is a libvirt bug but i'm reporting it here as well in case other Oz users run into this.

@clalancette
Owner

Thanks for the report. I agree that it seems like a libvirt bug; let's see what they say on that bug report. I'll also take a look into a way that we can work around this in Oz, so we can be backwards compatible.

@clalancette
Owner

As an interesting data point, I've just tried something similar myself. I just installed a i386 Fedora 17 guest on an x86_64 host. I then fully updated the Fedora 17 guest to the latest packages. Next I used Oz to install an i386 Fedora 17 disk inside the guest, and that succeeded (though I had to increase the timeout for it to work properly). Now, this might be a difference between the qemu-system-x86_64 and qemu-system-i386, or it might be a difference between your older libvirt and my more updated libvirt. geertj, can you try updating your Fedora-17 EC2 instance to the latest libvirt and try again?

@geertj

I've updated to the latest libvirt, and still no luck. This is on public AMI ami-2ea50247 which is the official Fedora17 64-bit AMI in us-east-1.

I also tried to build a 32-bit image on this same EC2 VM by doing the following:

  • set <arch>i386</arch> in the TDL
  • hack oz/Guest.py to add a <emulator>/bin/qemu-system-i386</emulator> node to <devices>

I'm still getting the same error.

@clalancette
Owner

I'm going to close this one out for now. The BZ linked above has been closed out, and I'm not sure there is much that Oz can/should do about this. If you disagree or keep running into this problem, feel free to reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.