QEMU Upstream: Difference between revisions
(Import from old wiki) |
(Update SeaBIOS information) |
||
Line 35: | Line 35: | ||
== Use with SeaBIOS == |
== Use with SeaBIOS == |
||
* Get SeaBIOS from git://git.seabios.org/seabios.git |
|||
SeaBIOS support is now fully integrated into the Xen build system (in xen-unstable and xen-4.2 onwards) and is always used when using ''device_model_version = "qemu-xen"''. |
|||
** As of commit ee2bc468cbc7 in that tree no patches to SeaBIOS are required. |
|||
** You can take the .config file [[Media:QEMUUpstream$seabios-xen.config|here]] to put in the root of your source tree |
|||
If you want to build a version of SeaBIOS other than the [http://xenbits.xen.org/gitweb/?p=seabios.git;a=shortlog;h=refs/heads/xen-unstable default] then you can override ''SEABIOS_UPSTREAM_URL'' and/or ''SEABIOS_UPSTREAM_TAG'' via ''.config''. For reference the upstream SeaBIOS repository is [[git://git.seabios.org/seabios.git]]. |
|||
** and build SeaBIOS (make). |
|||
* In xen-unstable source tree, add the file .config with ''SEABIOS_DIR = /path/to/seabios''. If this does not work a temporary hack is to modify the SEABIOS_ROM path in tools/firmware/hvmloader/Makefile to point to path_to_seabios/out/bios.bin |
|||
* Build Xen, at least ''make tools'' to update the "xen-bios" |
|||
** tips: '''make -C tools/firmware clean''' before make tools to take into account the new SEABIOS_DIR parameter. |
|||
* Run it! |
Revision as of 09:46, 13 March 2012
How to build QEMU (upstream version) with Xen
Get the source
- Get Xen source (version 4.2 aka xen-unstable development version)
- Get QEMU upstream source from:
- Recommended: xen-stable-0.15 qemu branch
- git://xenbits.xen.org/people/sstabellini/qemu-dm.git xen-stable-0.15
- Announcement of the "xen-stable-0.15" qemu branch and more info here: http://lists.xensource.com/archives/html/xen-devel/2011-07/msg01359.html
- Recommended: xen-stable-0.15 qemu branch
- Other option: Anthony's git tree used for development
- Example for "xen-stable-0.15" branch
- git clone git://xenbits.xen.org/people/sstabellini/qemu-dm.git qemu-dm.git
- cd qemu-dm.git
- git checkout -b xen-stable-0.15 origin/xen-stable-0.15
Build it!
- Build Xen
- make xen tools, if it fail see bellow.
- Build QEMU upstream with Xen
- For xen-unstable.hg versions between 23412:996c7726a376 and 23632:33717472f37e you will need to copy path_to_xen/tools/libxc/xc_e820.h to $path_to_xen_source/dist/install/usr/include" for configuration script to work. After 23632:33717472f37e xc_e820.h was squashed into xenctrl.h
- ./configure --enable-xen --target-list=i386-softmmu --extra-cflags="-I$path_to_xen_source/tools/include -I$path_to_xen_source/tools/libxc -I$path_to_xen_source/tools/xenstore" --extra-ldflags="-L$path_to_xen_source/tools/libxc -L$path_to_xen_source/tools/xenstore"
- make
Troubleshooting compilation errors: If you get an error from configure like "ERROR: User requested feature xen ERROR: configure was not able to find it" then see this: http://xen.1045712.n5.nabble.com/Upstream-Qemu-With-Xen-configuration-problem-td4561779.html , ie. you need to point the paths for "configure" to xen source directory, not to xen dist directory.
Run it!
Either:
- Add "device_model = path/to/new/qemu" in your VM configuration files.
- This have been change in the latest xen-unstable tree: now use:
- device_model_override = '/root/work/qemu/_build/i386-softmmu/qemu'
- device_model_version = 'qemu-xen'
- This have been change in the latest xen-unstable tree: now use:
- Replace /usr/lib/xen/bin/qemu-dm by the qemu present in i386-softmmu/qemu of the build of QEMU.
with the last xen-unstable, device_model_version = 'qemu-xen' is needed in the guest configuration file.
Now xl will always try run qemu upstream with seabios, so build xen with seabios.
- For troubleshooting device_model related errors (Xen specific options -domain-name, -vcpus, etc) see: http://xen.1045712.n5.nabble.com/Upstream-QEMU-not-working-with-Xen-unstable-lacks-option-definitions-td4372252.html
Use with SeaBIOS
SeaBIOS support is now fully integrated into the Xen build system (in xen-unstable and xen-4.2 onwards) and is always used when using device_model_version = "qemu-xen".
If you want to build a version of SeaBIOS other than the default then you can override SEABIOS_UPSTREAM_URL and/or SEABIOS_UPSTREAM_TAG via .config. For reference the upstream SeaBIOS repository is [[1]].