summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2010-10-11Update version for 0.13.0-rc2v0.13.0-rc2Anthony Liguori1-1/+1
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-10-11Fix ivshmem build on 32-bit hostsAvi Kivity1-3/+4
stat() fields can be more or less anything depending on configuration, cast explicitly to uint64_t to avoid printf() format mismatches. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com> (cherry picked from commit ad0a4ac1c0e1859eb0c67900dba696cc459b42a7)
2010-10-11hw/ivshmem.c don't check for negative values on unsigned data typesJes Sorensen1-2/+2
There is no need to check for dest < 0 or vector >= 0 as both are uint16_t. This should fix problems with broken build with aggressive compiler flags. Reported by Xudong Hao <xudong.hao@intel.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Acked-by: Cam Macdonell <cam@cs.ualberta.ca> Signed-off-by: Blue Swirl <blauwirbel@gmail.com> (cherry picked from commit 1b27d7a1e8609b2eeb6238f2c629eb82217523f6)
2010-10-11Disable build of ivshmem on non-KVM systemsCam Macdonell1-1/+1
Signed-off-by: Cam Macdonell <cam@cs.ualberta.ca> Signed-off-by: Blue Swirl <blauwirbel@gmail.com> (cherry picked from commit 3dcbf8f9ca5f361a38bf1b699080daeb40d5185e)
2010-10-11Add kvm_set_ioeventfd_mmio_long definition for non-KVM systemsCam Macdonell1-0/+5
Signed-off-by: Cam Macdonell <cam@cs.ualberta.ca> Signed-off-by: Blue Swirl <blauwirbel@gmail.com> (cherry picked from commit 1fd74012750dcd8542708bdcc10becb8780f7493)
2010-10-11RESEND: Inter-VM shared memory PCI deviceCam Macdonell5-0/+883
resend for bug fix related to removal of irqfd Support an inter-vm shared memory device that maps a shared-memory object as a PCI device in the guest. This patch also supports interrupts between guest by communicating over a unix domain socket. This patch applies to the qemu-kvm repository. -device ivshmem,size=<size in format accepted by -m>[,shm=<shm name>] Interrupts are supported between multiple VMs by using a shared memory server by using a chardev socket. -device ivshmem,size=<size in format accepted by -m>[,shm=<shm name>] [,chardev=<id>][,msi=on][,ioeventfd=on][,vectors=n][,role=peer|master] -chardev socket,path=<path>,id=<id> The shared memory server, sample programs and init scripts are in a git repo here: www.gitorious.org/nahanni Signed-off-by: Cam Macdonell <cam@cs.ualberta.ca> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 6cbf4c8c6416237e9c323661b87d60792a9d51af)
2010-10-11Support marking a device as non-migratableCam Macdonell2-3/+43
A non-migratable device should be removed before migration and re-added after. Signed-off-by: Cam Macdonell <cam@cs.ualberta.ca> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 2431296806bc7a40c29b7775e16f36dc1cda4d06)
2010-10-11Add function to assign ioeventfd to MMIO.Cam Macdonell2-0/+33
Signed-off-by: Cam Macdonell <cam@cs.ualberta.ca> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 44f1a3d8765b19ee88ca493e8e13cefb6ee50cbe)
2010-10-11Device specification for shared memory PCI deviceCam Macdonell1-0/+96
Signed-off-by: Cam Macdonell <cam@cs.ualberta.ca> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit b6828931ebac027b869e40ec9518a291078dafe5)
2010-10-11Add qemu_ram_alloc_from_ptr functionCam Macdonell2-0/+45
Provide a function to add an allocated region of memory to the qemu RAM. This patch is copied from Marcelo's qemu_ram_map() in qemu-kvm and given the clearer name qemu_ram_alloc_from_ptr(). Signed-off-by: Cam Macdonell <cam@cs.ualberta.ca> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 84b89d782f03b99770759f1d9d6e4e95a2641c35)
2010-08-31Update version for 0.13.0-rc1v0.13.0-rc1Anthony Liguori1-1/+1
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-08-30posix-aio-compat: Fix async_conmtext for ioctlAndrew de Quincey1-0/+1
Set the async_context_id field when queuing an async ioctl call Signed-off-by: Andrew de Quincey <adq@lidskialf.net> Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 34cf0081294513bc734896c9051c20ca6c19c3db)
2010-08-30vvfat: fat_chksum(): fix access above array boundsLoïc Minier1-1/+1
Signed-off-by: Loïc Minier <loic.minier@linaro.org> Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 2aa326be0d2039f51192707bdb2fc935d0e87c21)
2010-08-30qemu-img rebase: Open new backing file read-onlyKevin Wolf1-1/+1
We never write to a backing file, so opening rw is useless. It just means that you can't rebase on top of a file for which you don't have write permissions. Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit cdbae85169c384d1641aa1ae86cdeefe16285745)
2010-08-30block: Fix image re-open in bdrv_commitKevin Wolf1-4/+9
Arguably we should re-open the backing file with the backing file format and not with the format of the snapshot image. Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit ee1811965fd15e0b41f8d508b951a8ab826ae3a7) Conflicts: block.c Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-08-30virtio-blk: Fix migration of queued requestsKevin Wolf1-0/+5
in_sg[].iovec and out_sg[].ioved are pointer to (source) host memory and therefore invalid after migration. When loading the device state we must create a new mapping on the destination host. Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit b6a4805b55b409134dc712677fdc4f6a8795e965)
2010-08-30virtio: Factor virtqueue_map_sg outKevin Wolf2-14/+27
Separate the mapping of requests to host memory from the descriptor iteration. The next patch will make use of it in a different context. Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 42fb2e0720511fa1da2f8e751be393f851b71d80)
2010-08-03ide: Avoid canceling IDE DMAAndrea Arcangeli1-2/+21
The reason for not actually canceling the I/O is because with virtualization and lots of VM running, a guest fs may mistake a overload of the host, as an IDE timeout. So rather than canceling the I/O, it's safer to wait I/O completion and simulate that the I/O has completed just before the io cancellation was requested by the guest. This way if ntfs or an app writes data without checking for -EIO retval, and it thinks the write has succeeded, it's less likely to run into troubles. Similar issues for reads. Furthermore because the DMA operation is splitted into many synchronous aio_read/write if there's more than one entry in the SG table, without this patch the DMA would be cancelled in the middle, something we've no idea if it happens on real hardware too or not. Overall this seems a great risk for zero gain. This approach is sure safer than previous code given we can't pretend all guest fs code out there to check for errors and reply the DMA if it was completed partially, given a timeout would never materialize on a real harddisk unless there are defective blocks (and defective blocks are practically only an issue for reads never for writes in any recent hardware as writing to blocks is the way to fix them) or the harddisk breaks as a whole. Signed-off-by: Izik Eidus <ieidus@redhat.com> Signed-off-by: Andrea Arcangeli <aarcange@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 953844d102f5b682f0835f021f2ed2ad9fb7734c)
2010-08-03block: Change bdrv_eject() not to drop the imageMarkus Armbruster2-3/+5
bdrv_eject() gets called when a device model opens or closes the tray. If the block driver implements method bdrv_eject(), that method gets called. Drivers host_cdrom implements it, and it opens and closes the physical tray, and nothing else. When a device model opens, then closes the tray, media changes only if the user actively changes the physical media while the tray is open. This is matches how physical hardware behaves. If the block driver doesn't implement method bdrv_eject(), we do something quite different: opening the tray severs the connection to the image by calling bdrv_close(), and closing the tray does nothing. When the device model opens, then closes the tray, media is gone, unless the user actively inserts another one while the tray is open, with a suitable change command in the monitor. This isn't how physical hardware behaves. Rather inconvenient when programs "helpfully" eject media to give you a chance to change it. The way bdrv_eject() behaves here turns that chance into a must, which is not what these programs or their users expect. Change the default action not to call bdrv_close(). Instead, note the tray status in new BlockDriverState member tray_open. Use it in bdrv_is_inserted(). Arguably, the device models should keep track of tray status themselves. But this is less invasive. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 4be9762adb0947a353e6efef2fed354f69218bfb)
2010-08-03block: Fix bdrv_has_zero_initKevin Wolf5-10/+28
Assuming that any image on a block device is not properly zero-initialized is actually wrong: Only raw images have this problem. Any other image format shouldn't care about it, they initialize everything properly themselves. Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 336c1c12551ff0a6e1a2af226d6cbdbadd2e02b5)
2010-07-30savevm: Fix memory leak of compat structAlex Williamson1-0/+6
Forgot to check for and free these. Found-by: Zachary Amsden <zamsden@redhat.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> (cherry picked from commit 69e58af92cf90a1a0551c73880928afa6753fa5f)
2010-07-30linux-user: fix build on hosts not using guest baseAurelien Jarno2-7/+9
Commit 68a1c816868b3e35a1da698af412b29e61b1948a broke qemu on hosts not using guest base. It uses reserved_va unconditionally in mmap.c. To avoid to many #ifdef #endif blocks, define RESERVED_VA as either reserved_va or 0ul, and use it instead of reserved_va, similarly to what has been done with guest_base/GUEST_BASE. (cherry picked from commit 18e9ea8a3f36b0a3845e1ac6d8acd180063bed8f)
2010-07-28Fix -snapshot deleting images on disk changeBlue Swirl3-0/+7
Block device change command did not copy BDRV_O_SNAPSHOT flag. Thus the new image did not have this flag and the file got deleted during opening. Fix by copying BDRV_O_SNAPSHOT flag. Signed-off-by: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 199630b62ec7cc5efd6f860ff545b449c7b5cdb8) Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-07-28block: Use error codes from lower levels for error messageStefan Weil1-8/+19
"No such file or directory" is a misleading error message when a user tries to open a file with wrong permissions. Cc: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit c98ac35d87fbd41618c1f02c64bcd4019e42513e) Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-07-28block: default to 0 minimal / optiomal I/O sizeChristoph Hellwig1-2/+2
Currently we set them to 512 bytes unless manually specified. Unforuntaly some brain-dead partitioning tools create unaligned partitions if they get low enough optiomal I/O size values, so don't report any at all unless explicitly set. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 55459498b226ab3314c463b2d5766f3650949e80) Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-07-28move 'unsafe' to end of caching modes in helpBruce Rogers1-1/+1
Libvirt parses qemu help output to determine qemu features. In particular it probes for the following: "cache=writethrough|writeback|none". The addition of the unsafe cache mode was inserted within this string, as opposed to being added to the end, which impacted libvirt's probe. Unbreak libvirt by keeping the existing cache modes intact and add unsafe to the end. This problem only manifests itself if a caching mode is explicitly specified in the libvirt xml, in which case older syntax for caching is passed to qemu, which it no longer understands. Signed-off-by: Bruce Rogers <brogers@novell.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 6c6b6ba20a167a89f85606125ee1e10eafef5b33) Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-07-28virtio-blk: Create exit function to unregister savevmAlex Williamson3-0/+10
Otherwise we can't migrate after we've removed a virtio block device. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 9d0d3138590c26cee1b1c440db6bcdd1986a5a20) Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-07-28block migration: propagate return value when bdrv_write() returns < 0Yoshiaki Tamura1-1/+5
Currently block_load() doesn't check return value of bdrv_write(), and even the destination weren't prepared to execute block migration, it proceeds and guest boots on the target. This patch fix this issue. Signed-off-by: Yoshiaki Tamura <tamura.yoshiaki@lab.ntt.co.jp> Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit b02bea3a85cc939f09aa674a3f1e4f36d418c007) Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-07-28ide/atapi: add support for GET EVENT STATUS NOTIFICATIONAurelien Jarno1-0/+15
The GET EVENT STATUS NOTIFICATION is a mandatory command according to MMC-3, even if event status notification is not supported. This patch adds support for this command. It returns NEA ("No Event Available") with an empty "Supported Event Classes" to show that it doesn't event support status notification. If asychronous operation is requested, which requires NCQ support, it returns an error according to the specifications. This fixes HAL support on FreeBSD and derivatives, which fill up the logs every second with: acd0: FAILURE - unknown CMD (0x03) ILLEGAL REQUEST asc=0x20 ascq=0x00 Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 253cb7b9909806b83d73269afb9cf0ab3fa2ce2c) Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-07-27Update version for 0.13.0-rc0v0.13.0-rc0Anthony Liguori1-1/+1
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-07-26vnc: better default values for VNC optionsCorentin Chary1-7/+7
vnc_jpeg and vnc_png are now "auto" by default, this means that if the dependencies are installed (libjpeg or libpng), then they will be enabled. vnc_thread is disabled by default. It should be enabled by default as soon as it's stable enougth. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-07-26vnc: tight: split send_sub_rectCorentin Chary1-25/+55
Split send_sub_rect in send_sub_rect_jpeg and send_sub_rect_nojpeg to remove all these #ifdef CONFIG_JPEG. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-07-26vnc: tight: fix rgb_prepare_rowCorentin Chary1-5/+10
rgb_prepare_row bpp depends on the server display surface, not the client. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-07-26vnc: add missing lock for vnc_cursor_define()Corentin Chary1-0/+2
All vnc_write() calls must be locked (except the ones present before the protocol initialization). Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-07-26vnc: threaded VNC serverCorentin Chary7-26/+682
Implement a threaded VNC server using the producer-consumer model. The main thread will push encoding jobs (a list a rectangles to update) in a queue, and the VNC worker thread will consume that queue and send framebuffer updates to the output buffer. The threaded VNC server can be enabled with ./configure --enable-vnc-thread. If you don't want it, just use ./configure --disable-vnc-thread and a syncrhonous queue of job will be used (which as exactly the same behavior as the old queue). If you disable the VNC thread, all thread related code will not be built and there will be no overhead. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-07-26qemu-thread: add qemu_mutex/cond_destroy and qemu_mutex_exitCorentin Chary2-0/+26
Add some missing functions in qemu-thread. Currently qemu-thread is only used for io-thread but it will used by the vnc server soon and we need those functions instead of calling pthread directly. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-07-26vnc: fix tight png memory leakCorentin Chary1-0/+3
The tight.png buffer was never released. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-07-26vnc: encapsulate encoding membersCorentin Chary5-156/+163
This will allow to implement the threaded VNC server in a more cleaner way. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-07-26vnc: tight: stop using qdict for palette stuffCorentin Chary4-129/+235
Profiling with callgrind seems to show that a lot of time is spent in the palette code (mostly due to memory allocation and qdict to int conversion). This patch adds a VncPalette implementation. The palette is stored in a hash table, like qdict, but which does way less memory allocations, and doesn't suffer from the QObject overhead. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-07-26vnc: tight: specific zlib level and filters for each compression levelCorentin Chary1-1/+18
Disable png filters for lower compression levels. This should lower the CPU consumption and reduce encoding time. This isn't in tight_conf because: * tight_conf structure must not change, because it's shared with other tight implementations (libvncserver, etc..). * it'd exceed the 80 col limit. * PNG_ macros are only defined if CONFIG_VNC_PNG is defined Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-07-26vnc: tight add PNG encodingCorentin Chary6-54/+342
Introduce a new encoding: VNC_ENCODING_TIGHT_PNG [1] (-269) with a new tight filter VNC_TIGHT_PNG (0x0A). When the client tells it supports the Tight PNG encoding, the server will use tight, but will always send encoding pixels using PNG instead of zlib. If the client also told it support JPEG, then the server can send JPEG, because PNG will only be used in the cases zlib was used in normal tight. This encoding was introduced to speed up HTML5 based VNC clients like noVNC [2], but can also be used on devices like iPhone where PNG can be rendered in hardware. [1] http://wiki.qemu.org/VNC_Tight_PNG [2] http://github.com/kanaka/noVNC/ Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-07-26vnc: tight: remove a memleak in send_jpeg_rect()Corentin Chary1-2/+3
buf was never freed. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-07-26vnc: tight: don't forget do at the last colorCorentin Chary1-1/+1
While using indexed colors, the last color was never added to the palette. Triggered with ubuntu livecd. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-07-26vnc: rename vnc-encoding-* vnc-enc-*Corentin Chary6-9/+9
For the same reason that we don't use vnc-authentication-sasl.c but vnc-auth-sals.c. Because it's tooooo long. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-07-26ui: move all ui components in ui/Corentin Chary31-44/+18
Move sdl, vnc, curses and cocoa UI into ui/ to cleanup the root directory. Also remove some unnecessary explicit targets from Makefile. aliguori: fix build when srcdir != objdir Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-07-26vnc: add lossy optionCorentin Chary4-0/+15
The lossy option can be used to enable lossy compression methods like gradient or jpeg. This patch disable them by default. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-07-26vnc: JPEG should be disabled if the client don't set tight qualityCorentin Chary1-1/+1
Disable JPEG compression by default and only enable it if the VNC client has sent the requested quality. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-07-26vnc: tight: add JPEG and gradient subencoding with smooth image detectionCorentin Chary5-1/+601
Add gradient filter and JPEG compression with an heuristic to detect how lossy the comppression will be. This code has been adapted from libvncserver/tight.c. JPEG support can be enabled/disabled at compile time with --enable-vnc-jpeg and --disable-vnc-jpeg. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-07-26Initial documentation for migrationJuan Quintela1-0/+303
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-07-26ide: fix migration in the middle of a bmdma transferJuan Quintela1-0/+30
It reintroduces Revert "ide save/restore pio/atapi cmd transfer fields and io buffer" but using subsections. Added bonus is the addition of ide_dummy_transfer_stop to transfer_end_table, that was missing. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>