aboutsummaryrefslogtreecommitdiffstats
path: root/tools/ioemu
Commit message (Collapse)AuthorAgeFilesLines
...
* pv-qemu 7/10: Async negotiation with xenfb frontendKeir Fraser2007-10-253-308/+401
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch re-factors the paravirt console xenfb_attach_dom method. The original method blocks the caller until the front & backends have both switched to the connected state. This isn't an immediate problem, but patches which follow will extend qemu to also handle the text console so blocking on graphics console startup will block the text console processing. The new code is basically a state machine. It starts off with a watch waiting for the KBD backend to switch to 'initialized' mode, then does the same for the FB backend. Now it waits for KBD & FB frontend devices to initialize, reading & mapping the framebuffer & its config at the appropriate step. When the KBD frontend finally reaches the connected state it registers a graphical console with QEMU and sets up the various framebuffer, mouse & keyboard event handlers. If a client connects to the VNC server before this is completed, then they will merely see a text console (or perhaps the monitor if configured that way). The main difference from previous versions of this patch, is that at the suggestion of Markus Armbruster, I'vere-ordered the individual static functions so they are in order-of-call, rather than reversed. Although I now have to pre-declare them, it is much easier to read the code. I have also fixed the keycode -> keysym translations to match previous behaviour. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* pv-qemu 6/10: Merge private & public xenfb structsKeir Fraser2007-10-253-91/+70
| | | | | | | | | | | This patch merges the public & private structs from the paravirt FB into a single struct. Since QEMU is the only consumer of this code there is no need for the artifical pub/priv split. Merging the two will make it possible to more tightly integrate with QEMU's event loop and do asynchronous non-blocking negoiation with the frontend devices (see next patch). Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* pv-qemu 5/10: Refactor QEMU console integrationKeir Fraser2007-10-253-267/+280
| | | | | | | | This patch moves a bunch of code out of the xen_machine_pv.c file and into the xenfb.c file. This is simply a re-factoring to facilitate the two patches which follow. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* pv-qemu 4/10: Refactor xenfb event handlersKeir Fraser2007-10-253-167/+94
| | | | | | | | This patch is a simple code re-factoring to move the event loop integration directly into the xenfb.c file. It is to facilitate the patches which follow. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* pv-qemu: Remove standalone xenfb codeKeir Fraser2007-10-254-2/+860
| | | | | | | | | | | This patch removes all trace of the standalone paravirt framebuffer daemon. With this there is no longer any requirement for LibVNCServer. Everything is handled by the QEMU device model. The xenfb.c and xenfb.h files are now moved (without code change) into tools/ioemu/hw/ & the temporary Makefile hack from the previous patch is removed. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* pv-qemu 2/10: Add a QEMU machine type for paravirt guestsKeir Fraser2007-10-255-4/+324
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-254-239/+304
| | | | | | | | | | | | 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>
* hvm, vt-d: Add memory cache-attribute pinning domctl for HVMKeir Fraser2007-10-231-0/+6
| | | | | | guests. Use this to pin virtual framebuffer VRAM as attribute WB, even if guest tries to map with other attributes. Signed-off-by: Disheng Su <disheng.su@intel.com>
* vt-d: Fix PCI=device parsing.Keir Fraser2007-10-221-4/+4
| | | | Signed-off-by: Weidong Han <weidong.han@intel.com>
* ia64: make buffered pio aware of save/restore.Keir Fraser2007-10-223-5/+62
| | | | Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
* hvm: Fix PCI-passthru string parsing.Keir Fraser2007-10-201-34/+10
| | | | | Fixes crash of xend during HVM domain ccreation. Signed-off-by: Keir Fraser <keir@xensource.com>
* vt-d: Detect and report failure to assign a pass-thru PCI device.Keir Fraser2007-10-191-42/+43
| | | | Signed-off-by: Weidong Han <weidong.han@intel.com>
* tools: Remove bogus external uses of xc_private.h. Clean up libflask.Keir Fraser2007-10-181-1/+0
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* ioemu: Allow xvd* to co-exist with hd*.Keir Fraser2007-10-161-2/+23
| | | | | | | - Whether hdN is defined first is checked. - If hdN is defined, xvdN is not replaced with hdN. Signed-off-by: Takanori Kasai <kasai.takanori@jp.fujitsu.com>
* ioemu: Add keymap definitions to the Dutch Belgium keymap file.Keir Fraser2007-10-151-0/+66
| | | | Signed-off-by: Pat Campbell <plc@novell.com>
* ioemu: Allow blktap to be able to be booted as system volume for PV-on-HVMKeir Fraser2007-10-151-1/+26
| | | | | | | - All xvdN disk is looked like hdN. - All tap disks are checked.(tap:aio, tap:sync, tap:vmdk, etc.) Signed-off-by: Takanori Kasai <kasai.takanori@jp.fujitsu.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-2714-46/+148
| | | | Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
* ioemu: security fixes for not-built or not-default-configured subsystems.Keir Fraser2007-09-263-6/+17
| | | | | | | Patches originally proposed by S. Caglar Onur and cleaned up for xen-unstable by Robert Buchholz <rbu@gentoo.org>. Signed-off-by: Keir Fraser <keir@xensource.com>
* [VTD] dynamically determines whether to link with libpci or not in QEMU.Keir Fraser2007-09-201-6/+10
| | | | | | | | | | | This patch to ioemu/Makefile.target dynamically decides whether to link with libpci or not base on the existence of /usr/include/pci directory. If /usr/include/pci exists, PCI passthrough is enabled. Otherwise, it is disabled. Signed-off-by: Allen Kay <allen.m.kay@intel.com>
* PCI passthru: tools changes (generic and vt-d)kfraser@localhost.localdomain2007-09-146-9/+581
| | | | | | | | | | | | | 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-dm: fix block-raw io debug printkfraser@localhost.localdomain2007-09-141-5/+5
| | | | Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
* [QEMU] Enhance raw io reliabilitykfraser@localhost.localdomain2007-09-111-2/+92
| | | | | | | | | For raw block device only : log any I/O error and perform automatic read retry for CDrom (improves MediaCheck with old installers). Signed-off-by: Ben Guthro <bguthro@virtualiron.com> Signed-off-by: Josh Nicholas <jnicholas@virtualiron.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>
* xc_map_foreign_pages(), a convenient alternative to xc_map_foreign_batch()kfraser@localhost.localdomain2007-09-072-2/+2
| | | | | | | | | xc_map_foreign_batch() can succeed partially. It is awkward to use when you're only interested in complete success. Provide new xc_map_foreign_pages() convenience function for that kind of use. Also convert two obvious calls to use it. Signed-off-by: Markus Armbruster <armbru@redhat.com>
* qemu: Allow more IDE power management.kfraser@localhost.localdomain2007-08-301-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | Made the QEMU IDE disk tolerate more power-mgmt commands, specifically: WIN_SETFEATURE(EN_AAM) - enable automatic acoustic mgmt WIN_SETFEATURE(DIS_AAM) - disable automatic acoustic mgmt WIN_SETFEATURE(DIS_APM) - disable automatic power mgmt WIN_STANDBY WIN_SETIDLE1 WIN_SLEEPNOW1 WIN_STANDBY2 WIN_SETIDLE2 WIN_SLEEPNOW2 WIN_STANDBYNOW2 These are all essentially no-ops, like existing support for EN_RLA (enable read lookahead) and WIN_STANDBYNOW1. This fixes a crash in the SLES9-SP3 64bit kernel when the powersaved was started (with ACPI or ACM). This guest really only needs EN_AAM, DIS_APM, and WIN_SETIDLE1 support, but the others seemed sensible to include. I've excluded EN_APM since I'm unsure of what that's agreeing to do. It's probably ok to include. Signed-off-by: Ben Guthro <bguthro@virtualiron.com> Signed-off-by: David Lively <dlively@virtualiron.com>
* qemu: Remove mapcache lock - we no longer have multiple threads in core qemu ↵kfraser@localhost.localdomain2007-08-303-27/+1
| | | | | | code. Signed-off-by: Keir Fraser <keir@xensource.com>
* ioemu: Avoid unaligned guest memory accesses on ia64.kfraser@localhost.localdomain2007-08-291-0/+6
| | | | | Signed-off-by: Alex Williamson <alex.williamson@hp.com> Signed-off-by: Keir Fraser <keir@xensource.com>
* ioemu: Avoid struct members clashing with POSIX apiskfraser@localhost.localdomain2007-08-281-12/+12
| | | | | | | | | | | | | | The TPM code in tools/ioemu/hw/tpm_tis.c has a struct containing a number of function pointers with names open, close, read, write which are the same as various POSIX apis already #included in the file. POSIX allows these functions to be defined as macros and latest GCC/glibc does indeed define them as macros depending on compiler flags. This causes compile errors when deferencing the struct members. The solution is either to change calls like ctx->open () to be (* ctx->open) (), or simply to rename the struct members. Since this struct was only used inside that one file I simply renamed them. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* ioemu: error checkin when setting up the Cirrus Logic video device.kfraser@localhost.localdomain2007-08-281-1/+6
| | | | | | | | | | set_mm_mapping() may fail because of xc_domain_populate_physmap(). In this case, we should not blindly go on; the xc_map_foreign_batch() that follows will cause a page fault and, at best, get mapped in a zeroed page from the dom0 (which is not what we want). While I'm in here, fix a memory leak on an error path. Signed-off-by: Chris Lalancette <clalance@redhat.com>
* [HVM] Live-migration fixups after 15639:c585f993385cTim Deegan2007-07-242-22/+20
| | | | | | Use the same xenstore area for log-dirty commands as for save/continue, and avoid a race condition by acking the save command after the save. Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
* [HVM] Control qemu's state-save via xenstore, instead of SIGUSR1Tim Deegan2007-07-245-41/+92
| | | | | | | This lets us verify that qemu has indeed stopped processing before we start saving guest memory. Also allow qemu to continue processing after the save has happened, instead of exiting immediately. Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
* [IOEMU] Fix shift key for graphical vnc displaykfraser@localhost.localdomain2007-07-232-8/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a problem in the input of the key in the VNC connection on the HVM domain. When client's keyboard is not the same as the kind of the keyboard of qemu-dm and GuestOS, it is not possible to input it correctly. VNC client qemu-dm & GuestOS --------------+----------------------- ja en-us ==> NG en-us en-us ==> OK Originally, the same keysym-code between client and qemu-dm is transmitted. However, even if it is the same character, the state of shift is different according to the kind of keyboard. ex. "=" charactor --------------------- en-us : "=" ja : shift + "-" Therefore, it is necessary to handle the state of the shift by setting qemu-dm and GuestOS. There is information on whether shift is necessary for each key for the keymap of qemu-dm. ex. VNC client : ja qemu-dm & GuestOS : en-us input key : "=" event client to qemu-dm : shift(push) >> "="(push) >> "="(release) >> shift(release) event qemu-dm to guest : shift(push) >> shift(release) >> "="(push) >> "="(release) >> shift(push) >> shift(release) This patch handled the state of shift from the set keymap. When client's keyboard is not same as the kind of qemu-dm/GuestOS, it is possible to input it correctly. It was confirmed to input it correctly mutually with this patch between en-us and ja. Signed-off-by: Takanori Kasai <kasai.takanori@jp.fujitsu.com>
* [HVM] Qemu rtl8139: correct rx CRC calculationTim Deegan2007-07-161-5/+4
| | | | Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
* [HVM] Qemu rtl8139: correct ring-buffer wrapping.Tim Deegan2007-07-161-1/+1
| | | | | The rx DMA should never overrun when it hits the end of a 64k buffer Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
* Merge with ia64 xen tree.kfraser@localhost.localdomain2007-07-123-10/+4
|\
| * hvm: Re-introduce LPT1 device in ACPI tables.kfraser@localhost.localdomain2007-07-111-5/+0
| | | | | | | | | | | | | | | | | | Once the presence of LPT1 is baked into a Windows guest, it gets upset if it is subsequently removed. Hence we add the 'LTP1' device object back into the ACPI DSDT, and remove IRQ 7 from the list of IRQs usable by the PCI-ISA links. Signed-off-by: Keir Fraser <keir@xensource.com>
| * Make QEMU consistently report write caching support for emulated IDEkfraser@localhost.localdomain2007-07-111-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | drives to fix a hang during SLES 9 HVM guest installation. Without this, the SLES 9 installer kernels (32 and 64 bit) were getting inconsistent information from QEMU as to whether the (emulated) IDE drives support write caching (which they do). So part of the kernel thought write caching was enabled (and enabled the usage of barrier writes) and part of it didn't, which triggered a bug in which the same barrier write is submitted over and over again ... Fixed by setting another bit in the WIN_IDENTIFY (IDE drive "identify" command) response to indicate we really, truly support write caching. Signed-off-by: David Lively <dlively@virtualiron.com> Signed-off-by: Ben Guthro <bguthro@virtualiron.com>
| * hvm: Fix memcpy_words() asm in ioemu.kfraser@localhost.localdomain2007-07-101-4/+2
| | | | | | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* | merge with xen-unstable.hgAlex Williamson2007-07-103-3/+6
|\|
| * Revert 15471:7ac7f147241405af83e7a9d748cf7b01279734fckfraser@localhost.localdomain2007-07-061-4/+2
| | | | | | | | | | | | | | | | Block-device specifiers in ioemu can contain colons, so skipping always past the first colon is not a good idea. Better solutions are in the pipeline to solve the blktap issues. Signed-off-by: Keir Fraser <keir@xensource.com>
| * hvm: Fix vnc keymap for Japanese keyboards.kfraser@localhost.localdomain2007-07-062-1/+4
| | | | | | | | | | Signed-off-by: Takanori Kasai <kasai.takanori@jp.fujitsu.com> Signed-off-by: Junko Ichino <ichino.junko@jp.fujitsu.com>
| * hvm: Allow blktap to be able to be booted as system volume for PV-on-HVMkfraser@localhost.localdomain2007-07-061-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When blktap was booting system volume, PV-on-HVM domain was not able to be started. The configuration file is specified as follows. disk = [ 'tap:aio:/xen/test/rhel5ga_full.img,hda,w' ] The error occurred by the initialization of system volume in qemu-dm. qemu: could not open hard disk image 'aio:/xen/test/rhel5ga_full.img' Signed-off-by: Takanori Kasai <kasai.takanori@jp.fujitsu.com> Signed-off-by: Tomonari Horikoshi <t.horikoshi@jp.fujitsu.com> Signed-off-by: Tsunehisa Doi <Doi.Tsunehisa@jp.fujitsu.com> Signed-off-by: Keir Fraser <keir@xensource.com>
| * hvm: Fix keymap for Windows keys.kfraser@localhost.localdomain2007-07-031-2/+2
| | | | | | | | | | Signed-off-by: Takanori Kasai <kasai.takanori@jp.fujitsu.com> Signed-off-by: Junko Ichino <ichino.junko@jp.fujitsu.com>
* | [IA64] Typo fixAlex Williamson2007-07-021-1/+1
| | | | | | | | Signed-off-by: Alex Williamson <alex.williamson@hp.com>
* | merge with xen-unstable.hgAlex Williamson2007-07-021-1/+1
|\|
| * ioemu: Fix ifdef __x86_64__kfraser@localhost.localdomain2007-06-251-1/+1
| | | | | | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* | [IA64] Fix NVRAM data cannot be saved when guest execute "reboot"Alex Williamson2007-07-022-0/+10
|/ | | | | | Also fix "xm reboot" instruction in Xend. Signed-off-by: Zhang Xin <xing.z.zhang@intel.com>
* hvm: Fix ioemu Qcow support.kfraser@localhost.localdomain2007-06-202-1/+13
| | | | | | | | | | | | | | | | | | | | | | Normally by default, SIGUSR2 is not blocked, so the signal masks of SIGUSR2 in all threads is unblocked. When creating HVM guest, if we use the Qcow format image file, in the main thread, Qcow uses SIGUSR2 to be notified of the completion of the request after it issues an AIO request; in tools/ioemu/block.c: bdrv_read_em(), in some point between bdrv_aio_read() and qemu_aio_wait(), Dom0 may send a SIGUSR2 to Qemu immediately to indicate the completion of an AIO request -- since at the moment SIGUSR2 in main thread is blocked by qemu_aio_wait_start(), the signal may be delivered to one non-main thread, causing the signal handler of SIGUSR2 is invoked, then the main thread hangs in qemu_aio_wait()->syswait()... This patch blocks SIGUSR2 at the beginning of Qemu's main(), so it ensures SIGUSR2 is blocked by default when a new thread is created, then only the threads that use the signal unblock it. Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
* ioemu: Assembler memcpy() for x86, and lowest-common-denominatorkfraser@localhost.localdomain2007-06-191-9/+31
| | | | | | memcpy() function for all others, avoiding noisy longword copies on ia64. Signed-off-by: Keir Fraser <keir@xensource.com>