aboutsummaryrefslogtreecommitdiffstats
path: root/tools/ioemu/vl.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove internal tools/ioemu tree.Keir Fraser2008-09-181-7995/+0
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* hvm: Use main memory for video memory.Keir Fraser2008-08-271-32/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | When creating an HVM domain, if e.g. another domain is created before qemu allocates video memory, the extra 8MB memory ballooning is not available any more, because it got consumed by the other domain. This fixes it by taking video memory from the main memory: - make hvmloader use e820_malloc to reserve some of the main memory and notify ioemu of its address through the Xen platform PCI card. - add XENMAPSPACE_mfn to the xen_add_to_physmap memory op, to allow ioemu to move the MFNs between the original position and the PCI mapping, when LFB acceleration is disabled/enabled - add a remove_from_physmap memory op, to allow ioemu to unmap it completely for the case of old guests with acceleration disabled. - add xc_domain_memory_translate_gpfn_list to libxc to allow ioemu to get the MFNs of the video memory. - have xend save the PCI memory space instead of ioemu: if a memory page is there, the guest can access it like usual memory, so xend can safely be responsible to save it. The extra benefit is that live migration will apply the logdirty optimization there too. - handle old saved images, populating the video memory from ioemu if really needed. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* prefix mini-os lists with minios_, drop QEMU_ prefix from QEMU_LIST_*Keir Fraser2008-08-081-5/+5
| | | | | | That permits to reduce the amount of difference with upstream. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* ioemu-stubdom: fix initialization of vm_change_state_headKeir Fraser2008-08-061-0/+2
| | | | | | | That is actually a no-op since it just sets it to NULL again, but makes sense. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* numa: Extend MEMOP_ allocation functions to take a node argument.Keir Fraser2008-07-051-2/+3
| | | | | | | | | The address_bits field will be limited to 8 bits and is now embedded in the mem_flags member, which additionally contains the node number (limited to 8 bit). Signed-off-by: Andre Przywara <andre.przywara@amd.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* ioemu: Fix usbdevice parameter to encode vbd type.Keir Fraser2008-06-181-1/+3
| | | | | | | | | usbdevice = "disk:<filename>" expect a raw device (as this probably is the most usual case) and usbdevice = "disk-qcow:<filename>" expect a COW image (autodetected, probably qcow2). Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* ioemu: generic PCI device config-space emulationKeir Fraser2008-06-181-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is an extension for qemu-dm to enable emulation of generic PCI devices. The information for the PCI devices can be passed by command line parameter. The command line parameter is "-pciemulation" followed by the information which contains a label and hex value of the configuration registers separated by ":". The configuration registers for each PCI device are below. vendorid deviceid command status revision classcode headertype subvendorid subsystemid interruputline interruptpin This is an example of command line parameter. -pciemulation hba1:1240:0780:0002:0:0:010000:0:10b5:0777:05:1 Signed-off-by: Shinji Matsumoto <smatsumoto@marathontechnologies.com>
* ioemu: cleaning DisplayState->dpy_resize interfaceKeir Fraser2008-06-091-1/+0
| | | | | | | | | | | Bring the DisplayState dpy_resize interface back to how it is in qemu mainstream, thus making the code easier to merge. In order to support sharing the framebuffer, I am adding a new resize interface called dpy_resize_shared that also has a depth and a pixels parameters. As a consequence I could remove the dpy_colourdepth callback and make the code cleaner and easier to read. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* ioemu: Force floppy disk images to be interpreted as raw.Keir Fraser2008-05-271-2/+3
| | | | | Fixes specifying fda/fdb image names in domain configs. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* pvfb/ioemu: transmit refresh interval advice from backend to frontendKeir Fraser2008-05-121-2/+2
| | | | | | which permits the frontend to avoid useless polls. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* blktap: Automatically start tapdisk-ioemu on demandKeir Fraser2008-04-231-7/+1
| | | | | | | | | When a domain wants to use a tap:ioemu disk but has no device model, start a tapdisk-ioemu instance as provider. Also, move the creation and removal of communication pipes to xend so that qemu-dm doesn't need the unwanted SIGHUP handler anymore. Signed-off-by: Kevin Wolf <kwolf@suse.de>
* Revert 17499:451ae3b8e5c8Keir Fraser2008-04-231-1/+7
| | | | | | Breaks HVM guest creation (bugzilla #1221). Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* blktap: Automatically start tapdisk-ioemu on demandKeir Fraser2008-04-221-7/+1
| | | | | | | | | When a domain wants to use a tap:ioemu disk but has no device model, start a tapdisk-ioemu instance as provider. Also, move the creation and removal of communication pipes to xend so that qemu-dm doesn't need the unwanted SIGHUP handler anymore. Signed-off-by: Kevin Wolf <kwolf@suse.de>
* stubdom: sparse application's BSS by linking it separately first, putKeir Fraser2008-04-161-6/+3
| | | | | | | markers at its beginning and end, and then link with mini-os. That permits to stick a bit more to upstream qemu. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* ioemu: drop duplicate memory reservationKeir Fraser2008-04-051-23/+0
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* stubdom: trivial warning fixupKeir Fraser2008-04-051-5/+7
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* stubdom: warn about disabled featuresKeir Fraser2008-04-021-1/+2
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* ioemu: Initialize ioport_opaque, ioport_read/write_table to zeroKeir Fraser2008-03-201-3/+3
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* ioemu: SDL rendering using OpenGLKeir Fraser2008-03-181-1/+14
| | | | | | | | | | | | | | | | | | Add opengl support for rendering the guest framebuffer in the SDL window. SDL is needed anyway to open the window and handle the events. Opengl rendering is optional and can be turned off at both compile time and in the vm configuration file. Some of the benefits of using opengl are: - faster rendering, less CPU intensive, especially with good graphic cards; - makes the window resizing possible and hardware accelerated, thus very efficient and smooth; - allows other optimizations like sharing directly a buffer in vram with the guest (not yet implemented). Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* Use ioemu block drivers through blktap.Keir Fraser2008-03-181-1/+7
| | | | | | | | | | Add support for a tap:ioemu pseudo driver. Devices using this driver won't use tapdisk (containing the code duplication) any more, but will connect to the qemu-dm of the domain. In this way no working configuration should be broken right now as you can still choose to use the tapdisk drivers. Signed-off-by: Kevin Wolf <kwolf@suse.de>
* ioemu: support shared framebuffer and linesize != width * depth.Keir Fraser2008-03-051-1/+1
| | | | | | | When sharing the buffer between e.g. xenfb and SDL, SDL must follow the line size. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* ioemu: Slown down refresh interval when SDL is minimizedKeir Fraser2008-03-051-1/+5
| | | | | | as that saves us the VGA refresh scanning. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* ioemu: Send logs to stderr and have xend redirect stderr to theKeir Fraser2008-02-281-3/+1
| | | | | | | | | | | | | | | | | correct log file. At the same time, this patch renames the logfile to be 'qemu-dm-{NAME}.log' instead of qemu-dm-{ID}.log. This makes it easier to track/find the QEMU logfile associated with a VM. It will also save 1 backup qemu-dm-{NAME}.log.1 so if a domain crashes & restart, you don't loose/overwrite the logfile immediately. Finally it changes the QEMU monitor prompt back to '(qemu)' instead of '(HVMXen)' because automated tools /scripts interacting with QEMU's monitor need a consistent prompt to look for & changing it for Xen serves no useful purpose. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* stubdom: use PVFB so as to e.g. permit SDL displayKeir Fraser2008-02-281-0/+4
| | | | | | | | This adds support in ioemu for PVFB frontend as stubdomain display. This permits for instance to use SDL in dom0 to perform the eventual display. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* ioemu: Fix the build.Keir Fraser2008-02-151-8/+6
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Enable HVM guest VT-d device hotplug via a simple ACPI hotplug device model.Keir Fraser2008-02-151-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | ** Currently only 2 virtual hotplug pci slots(6~7) are created so more than 2 vtd dev can't be hotplugged, but we can easily extend it in future. Three new commands are added: "xm pci-list domid" show the current assigned vtd device, like: VSlt domain bus slot func 0x6 0x0 0x02 0x00 0x0 "xm pci-detach" hot remove the specified vtd device by the virtual slot, like: xm pci-detach EdwinHVMDomainVtd 6 "xm pci-attach DomainID dom bus dev func [vslot]" hot add a new vtd device in the vslot. If no vslot specified, a free slot will be picked up. e.g. to insert '0000:03:00.0': xm pci-attach EdwinHVMDomainVtd 0 3 0 0 ** guest pci hotplug linux: pls. use 2.6.X and enable ACPI PCI hotplug ( Bus options=> PCI hotplug => ACPI PCI hotplug driver ) windows: 2000/xp/2003/vista are all okay Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
* ioemu: Support the WMVi pseudoencoding in the vnc server.Keir Fraser2008-02-141-9/+0
| | | | | | | If the client implements it, it is supposed to be able to change colour depth when receiving a WMVi message. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* Add stubdomain support. See stubdom/README for usage details.Keir Fraser2008-02-121-12/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Move PAGE_SIZE and STACK_SIZE into __PAGE_SIZE and __STACK_SIZE in arch_limits.h so as to permit getting them from there without pulling all the internal Mini-OS defines. - Setup a xen-elf cross-compilation environment in stubdom/cross-root - Add a POSIX layer on top of Mini-OS by linking against the newlib C library and lwIP, and implementing the Unixish part in mini-os/lib/sys.c - Cross-compile zlib and libpci too. - Add an xs.h-compatible layer on top of Mini-OS' xenbus. - Cross-compile libxc with an additional xc_minios.c and a few things disabled. - Cross-compile ioemu with an additional block-vbd, but without sound, tpm and other details. A few hacks are needed: - Align ide and scsi buffers at least on sector size to permit direct transmission to the block backend. While we are at it, just page-align it to possibly save a segment. Also, limit the scsi buffer size because of limitations of the block paravirtualization protocol. - Allocate big tables dynamically rather that letting them go to bss: when Mini-OS gets installed in memory, bss is not lazily allocated, and doing so during Mini-OS is unnecessarily trick while we can simply use malloc. - Had to change the Mini-OS compilation somehow, so as to export Mini-OS compilation flags to the Makefiles of libxc and ioemu. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* device-dm: Use SIGHUP before SIGKILLKeir Fraser2008-02-121-2/+4
| | | | | | | | | Make qemu unblock SIGHUP and make sure the default handler is in place. Have the domain killer send SIGHUP to the device-model script, allow the script 10s to clean up, and if still not dead, send SIGKILL. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* ioemu: Dynamic VNC colour depth.Keir Fraser2008-02-111-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The qemu vnc server changes its internal colour depth based on the client request. This way just one colour conversion is done: the one in vga_template.h, from the guest colour depth and the vnc server internal colour depth. This patch is meant to remove this colour conversion to improve performances. It accomplishes the goal making the qemu internal colour depth always the same as the guest colour depth. The basic idea is that the vnc client is the one that should do the colour conversion, if necessary. In general it should accept the pixel format suggested by the server during the initial negotiation. This behaviour can be set in most vnc clients (vncviewer included). If the guest changes colour depth, the qemu vnc server changes colour depth too and notifies the client. The problem is that the vnc protocol doesn't provide a message from the server to the client to ask for a colour depth change. So what I am doing is either: 1) quietly starting to do the conversion on vnc server (not gaining any performance here); 2) closing the vnc connection with the client, so the client can reconnect and choose the new pixel format. By default I am doing 1), however the second choice can be enabled passing the -vnc-switch-bpp command line option. In order to do the colour conversion on the vnc server I had to improve the colour conversion code already in place because it only supported conversions from 32 bpp. The patch adds colour conversion code that support conversions from any resolution to any resolution. A last note: to get most out of this patch it is best to set Windows to 16 bit colour depth, because the 24 bit mode is 24 bit depth and 24 bpp, meaning no alpha channel. The vnc protocol doesn't support 24 bpp, only 32 bpp, so this conversion is unavoidable. From: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* ioemu: save 3MB of ioport tables (on 64bit machines)Keir Fraser2008-02-111-20/+40
| | | | | | by keeping then initialized to NULL and check for it in the handlers. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* ioemu stubdom: make daemonize optionalKeir Fraser2008-02-111-2/+13
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* ioemu: some ifndef NO_UNIX_SOCKETS were missingKeir Fraser2008-02-111-7/+7
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* ioemu: Fix build after LIST->QEMU_LIST changes.Keir Fraser2008-02-071-5/+5
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* ioemu: config cleanup re AF_UNIX sockets on non-WindowsKeir Fraser2008-02-071-1/+1
| | | | | | | | | | | | Here is what I wrote in my submission to qemu upstream: The patch below makes it possible to disable AF_UNIX (unix-domain) sockets in host environments which do not define _WIN32, by adding -DNO_UNIX_SOCKETS to the compiler flags. This is useful in the effectively-embedded qemu host which are going to be using for device emulation in Xen. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* Revert 16947:32b898768217027. Breaks HVM qcow-backed discs.Keir Fraser2008-02-041-1/+1
| | | | Sigend-off-by: Keir Fraser <keir.fraser@citrix.com>
* ioemu: Stop PV guest from parsing xenstore and opening block devices.Keir Fraser2008-01-311-1/+1
| | | | | | | | | | | PV guests are now using QEMU for a vncserver. During initialization of QEMU xenstore_parse_config() is being called causing PV guests to open block devices. This patch makes a new function, xenstore_daemon_open(), so that the vnc password functions have an open xenstore handle and moves xenstore_parse_config() into the FV machine specific init function. Signed-off-by: Pat Campbell <plc@novell.com>
* ioemu: handle empty vnc passwdKeir Fraser2008-01-231-2/+1
| | | | | | | | | | | | Have xenstore_read_vncpasswd return -1 when it is unable to read the passwd from XenStore (and store an empty password). However, don't exit in such case since it may just mean that the use didn't set a passwd. If he really did, xend would have given the passwd flag in the -vnc option, and the empty passwd would make the vnc authentication reject any password anyway. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com> Acked-by: Daniel P. Berrange <berrange@redhat.com>
* ioemu: Do not close slave half of a pty.Keir Fraser2007-12-201-2/+0
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Fix master/slave handling in xenconsoled and qemuKeir Fraser2007-12-191-2/+65
| | | | | | | | | | | | | | | Fix a number of problems with the pty handling: - make openpty() implementation work on Solaris - set raw on the slave fd, not the master, as the master doesn't have a line discipline pushed on Solaris - make sure we don't leak the slave fd returned from openpty() - don't use the 'name' argument of openpty() as it's a security risk - note behaviour of a zero read of the master on Solaris - remove pointless tcget/setattr Signed-off-by: John Levon <john.levon@sun.com> Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
* [QEMU-DM] Modem control line & msl/mcr register support.Keir Fraser2007-12-051-0/+10
| | | | | | | | | | | | | | | | | | | | | This patch enables handling of the modem/flow control lines of a serial port when the backend for the virtual port is a physical serial port. During initialization, it tries to load the msr with the detected status from the real port (this is consistent with physical uart, which starts with its msr values set according to the status of the modem status lines). If the ioctl returns -ENOTSUP, then the code assumes the backend is not a real serial port and will disable any further attempts to manipulate or read the physical port's line status. It's tries to be as "correct" as possible in its msr/msl handling, with the exception of modem line status change interrupts. A real 16550 uart apparently have a delay time of 250ns between when a modem status line changes and the IRQ line goes high. In this patch, an "idle" port is polled for line status changes only if the guest has enabled UART_IER_MSI is enabled, and only polled every 10 ms. Signed-off-by: Trolle Selander <trolle.selander@gmail.com>
* qemu vnc auth 3/4: Add VNC auth support from upstream QEMUKeir Fraser2007-10-301-2/+8
| | | | | | | | | | | | | | | | | | | This patch adds in the upstream QEMU VNC authentication code. This spports the previous VNC password auth scheme, as well as the VeNCrypt protocol extension. The latter allows for performing a TLS handshake, and client verification of the server identify using x509 certificates. It is also possible for the server to request a client certificate and validate that as a simple auth scheme. The code depends on GNU TLS for SSL APIs, and the configure script will auto-detect this. The image.py code is changed to deal with the new syntax for the -vnc option. In particular password authentication is now enabled by giving the 'password' flag, eg -vnc 0.0.0:1,password Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* qemu vnc auth 2/4: Revert current VNC auth supportKeir Fraser2007-10-301-8/+0
| | | | | | | | | | This patch reverts the current Xen specific implementation of VNC authentication from the QEMU code. This is basically reverting 11840:02506a744315. The idea here is to get the VNC code back to more closely match upstream QEMU, before applying the upstream auth patches. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* qemu vnc auth 1/4: QEMU event handler bug fixKeir Fraser2007-10-301-4/+2
| | | | | | | | | This patch pulls in an upstream QEMU fix for dealing with a problem in the event dispatcher where a write callback gets unregistered while a write event is pending from poll. Without this the QEMU process with deference a NULL pointer and crash. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* pv-qemu 2/10: Add a QEMU machine type for paravirt guestsKeir Fraser2007-10-251-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a paravirt machine type to QEMU. This can be requested by passing the arg '-M xenpv' to qemu-dm. Aside from -d, and -domain-name, the only other args that are processed are the VNC / SDL graphics related args. Any others will be ignored. A tweak to helper2.c was made to stop it setting up a file handler watch when there are no CPUs registered. The paravirt machine is in hw/xen_machine_pv.c and registers an instance of the xenfb class, integrating it with the QEMU event loop and key/mouse handlers. A couple of methods were adding to xenfb.h to allow direct access to the file handles for xenstore & the event channel. The vfbif.py device controller is modified to launch qemu-dm instead of the old xen-vncfb / sdlfb daemons. When receiving framebuffer updates from the guest, the update has to be copied into QEMU's copy of the framebuffer. This is because QEMU stores the framebuffer in the format that is native to the SDL display, or VNC client. This is not neccessarily the same as the guest framebuffer which is always 32bpp. If there is an exact depth match we use memcpy for speed, but in the non-matching case we have to fallback to slow code to convert pixel formats. It fully supports all features of the paravirt framebuffer including the choice between absolute & relative pointers. The overall VIRT memory image size is about same as old xen-vncfb, but the resident memory size is a little increased due to copy of the framebuffer & some QEMU static state overhead. Most of this is shared across QEMU processes. To avoid both moving the xenfb.c and making changes to it in the same patch, this just uses a Makefile hack to link against the xenfb.o from the tools/xenfb/ directory. This will be removed in the following patch. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* pv-qemu 1/10: Add a QEMU machine type for fullvirt guestsKeir Fraser2007-10-251-239/+5
| | | | | | | | | | | | This patch does a (no functional change) re-arrangement of the code for starting up a fully virtualized guest. In particular it creates a new QEMU machine type for Xen fullyvirt guests which can be specified with '-M xenfv'. For compatibility this is in fact made to be the default. The code for setting up memory maps is moved out of vl.c, and into hw/xen_machine_fv.c. This is basically to ensure that it can be easily skipped when we add a paravirt machine type in the next patch. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Fix ioemu compile on SolarisKeir Fraser2007-10-021-0/+2
| | | | | Solaris doesn't have RLIMIT_RSS at least; don't try to set rlimits. Signed-off-by: John Levon <john.levon@sun.com>
* ioemu: Fixes for BSD.Keir Fraser2007-09-271-14/+70
| | | | Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
* PCI passthru: tools changes (generic and vt-d)kfraser@localhost.localdomain2007-09-141-3/+9
| | | | | | | | | | | | | I have added CONFIG_PASSTHROUGH in ioemu/Makefile.target and ioemu/hw/pc.c in attached vtd_tools2.patch. This should turn off libpci usage by default until user specifically enables it. This can be safely check-in without breaking builds for people who do not care about pass-through devices. I will try to think of a better way to enable this. Signed-off-by: Allen Kay <allen.m.kay@intel.com> Signed-off-by: Guy Zana <guy@neocleus.com>
* qemu: Backport qemu vnc/event-loop fix from upstream.kfraser@localhost.localdomain2007-09-111-6/+22
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>