summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-06-10fsdev: Fix archs that dont use fsdevEdgar E. Iglesias1-0/+8
Fix provided by: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-06-08Merge remote-tracking branch 'qmp/for-anthony' into stagingAnthony Liguori6-25/+91
2011-06-08Merge remote-tracking branch 'jvrao/for-anthony' into stagingAnthony Liguori15-290/+388
2011-06-08Merge remote-tracking branch 'spice/spice.v37' into stagingAnthony Liguori7-19/+53
Conflicts: vl.c
2011-06-08Merge remote-tracking branch 'stefanha/trivial-patches' into stagingAnthony Liguori25-52/+24
2011-06-08qemu-img create: Fix displayed default cluster sizeKevin Wolf4-5/+11
When not specifying a cluster size on the command line, qemu-img printed a cluster size of 0: Formatting '/tmp/test.qcow2', fmt=qcow2 size=67108864 encryption=off cluster_size=0 This patch adds the default cluster size to the QEMUOptionParameter list, so that it displays the default value that is used. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-06-08bdrv_img_create: Fix segfaultKevin Wolf1-2/+3
Block drivers that don't support creating images don't have a size option. Fail gracefully instead of segfaulting when trying to access the option's value. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-06-08qcow2: Fix memory leaks in error casesKevin Wolf2-4/+7
This fixes memory leaks that may be caused by I/O errors during L1 table growth (can happen during save_vm) and in qemu-img check. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-06-08rbd: Add bdrv_truncate implementationJosh Durgin1-0/+14
Reviewed-by: Christian Brunner <chb@muc.de> Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-06-08rbd: check return values when scheduling aioJosh Durgin1-4/+20
If scheduling fails, the number of outstanding I/Os must be correct, or there will be a hang when waiting for everything to be flushed. Reviewed-by: Christian Brunner <chb@muc.de> Reported-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-06-08rbd: allow configuration of rados from the rbd filenameJosh Durgin1-17/+102
The new format is rbd:pool/image[@snapshot][:option1=value1[:option2=value2...]] Each option is used to configure rados, and may be any Ceph option, or "conf". The "conf" option specifies a Ceph configuration file to read. This allows rbd volumes from more than one Ceph cluster to be used by specifying different monitor addresses, as well as having different logging levels or locations for different volumes. Reviewed-by: Christian Brunner <chb@muc.de> Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-06-08rbd: use the higher level librbd instead of just libradosJosh Durgin3-673/+226
librbd stacks on top of librados to provide access to rbd images. Using librbd simplifies the qemu code, and allows qemu to use new versions of the rbd format with few (if any) changes. Reviewed-by: Christian Brunner <chb@muc.de> Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com> Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-06-08block/raw-posix: get right partition sizeChristoph Egger1-0/+32
use the correct way to get the size of a disk device or partition From: Adam Hamsik <haad@netbsd.org> Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-06-08block/raw-posix: use a character device if a block device is givenChristoph Egger1-0/+43
On NetBSD a userland process is better with the character device interface. In addition, a block device can't be opened twice; if a Xen backend opens it, qemu can't and vice-versa. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-06-08vmdk: fix endianness bugsAlexander Graf1-8/+14
The vmdk code is sloppy when handling the header descriptor during creation of an image. Fix all header accesses in the create path to either store native endianness or convert it when appropriate. Reported-by: Yury Tsarev <ytsarev@novell.com> Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-06-08block: clarify the meaning of BDRV_O_NOCACHEChristoph Hellwig7-19/+13
Change BDRV_O_NOCACHE to only imply bypassing the host OS file cache, but no writeback semantics. All existing callers are changed to also specify BDRV_O_CACHE_WB to give them writeback semantics. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-06-08ide/core: Remove explicit setting of BM_STATUS_INTKevin Wolf1-3/+4
BM_STATUS_INT is automatically set during ide_set_irq(), there's no reason to set it manually in addition. There is even one case where the interrupt status bit was set, but no IRQ was raised. This is when the PRD table was reached but there is more data to transfer. The correct behaviour for this case is not to set BM_STATUS_INT. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-06-08virtio: Move virtio-pci to hw libraryJan Kiszka2-1/+1
This module has no target dependencies (except for target_phys_addr_t size) and can thus be built as part of libhw. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Reviewed-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-06-08target-i386: Make x86 mfence and lfence illegal without SSE2Martin Simmons1-1/+1
While trying to use qemu -cpu pentium3 to test for incorrect uses of certain SSE2 instructions, I found that QEMU allowed the mfence and lfence instructions to be executed even though Pentium 3 doesn't support them. According to the processor specs (and experience on a real Pentium 3), these instructions are only available with SSE2, but QEMU is checking for SSE. The check for the related sfence instruction is correct (it works with SSE). This trival patch fixes the test. Signed-off-by: Martin Simmons <martin@lispworks.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-06-08m68k: Replace gen_im32() by tcg_const_i32()Laurent Vivier1-23/+20
Signed-off-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-06-08slirp: fix guestfwd idAlexander Graf1-1/+1
When using -net user,guestfwd=... Qemu immediately complains about the id being in invalid format. This is because we pass in an id that contains a colon, while the id restrictions don't allow colons. This patch changes the colon into a dot, making guestfwd work again. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-06-08Fix compilation warning due to missing header for sigaction (followup)Alexandre Raymond19-26/+0
This patch removes all references to signal.h when qemu-common.h is included as they become redundant. Signed-off-by: Alexandre Raymond <cerbere@gmail.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-06-08Fix compilation warning due to missing header for sigactionAlexandre Raymond1-0/+1
Fix the following warning by including signal.h directly in qemu-common.h ----8<---- iohandler.c: In function ‘qemu_init_child_watch’: iohandler.c:172: warning: implicit declaration of function ‘sigaction’ iohandler.c:172: warning: nested extern declaration of ‘sigaction’ ----8<---- Signed-off-by: Alexandre Raymond <cerbere@gmail.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-06-07Add an isa device for SGAGlauber Costa3-1/+66
This patch adds a dummy legacy ISA device whose responsibility is to deploy sgabios, an option rom for a serial graphics adapter. The proposal is that this device is always-on when -nographics, but can otherwise be enable in any setup when -device sga is used. [v2: suggestions on qdev by Markus ] [v3: cleanups and documentation, per list suggestions ] Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-06-07json-parser: add handling for NULL token listMichael Roth1-1/+5
Currently a NULL token list will crash the parser, instead we have it pass back a NULL QObject. Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-06-07json-streamer: add handling for JSON_ERROR token/stateMichael Roth1-12/+23
This allows a JSON_ERROR state to be passed to the streamer to force a flush of the current tokens and pass a NULL token list to the parser rather that have it churn on bad data. (Alternatively we could just not pass it to the parser at all, but it may be useful to push there errors up the stack. NULL token lists are not currently handled by the parser, the next patch will address that) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-06-07json-lexer: make lexer error-recovery more deterministicMichael Roth2-4/+22
Currently when we reach an error state we effectively flush everything fed to the lexer, which can put us in a state where we keep feeding tokens into the parser at arbitrary offsets in the stream. This makes it difficult for the lexer/tokenizer/parser to get back in sync when bad input is made by the client. With these changes we emit an error state/token up to the tokenizer as soon as we reach an error state, and continue processing any data passed in rather than bailing out. The reset token will be used to reset the tokenizer and parser, such that they'll recover state as soon as the lexer begins generating valid token sequences again. We also map chr(192,193,245-255) to an error state here, since they are invalid UTF-8 characters. QMP guest proxy/agent will use chr(255) to force a flush/reset of previous input for reliable delivery of certain events, so also we document that thoroughly here. Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-06-07json-lexer: fix flushing logic to not always go to error stateMichael Roth1-3/+3
Currently we flush the lexer by passing in a NULL character. This generally forces the lexer to go to the corresponding TERMINAL() state for whatever token type it is currently parsing, emits the token to the parser, then puts the lexer back into IN_START state. However, since a NULL character causes char_consumed to be 0, we always do a second pass after this, which puts us in the IN_ERROR state. Fix this behavior by adding a "flush" flag that tells the lexer not to do a more than 1 iteration. Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-06-07json-lexer: reset the lexer state on an invalid tokenAnthony Liguori1-0/+3
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-06-07json-parser: detect premature EOIAnthony Liguori1-1/+57
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-06-07json-streamer: make sure to reset token_size after emitting a token listAnthony Liguori2-0/+3
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-06-07json-streamer: limit the maximum recursion depth and maximum token countAnthony Liguori1-0/+17
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-06-07json-lexer: limit the maximum size of a given tokenAnthony Liguori1-0/+13
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-06-07json-streamer: allow recovery after bad inputAnthony Liguori1-2/+6
Once we detect a malformed message, make sure to reset our state. Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-06-07json-parser: propagate error from parserAnthony Liguori5-7/+25
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-06-07Introduce the new error frameworkLuiz Capitulino4-1/+240
New error-handling framework that allows for exception-like error propagation. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-06-07QError: Introduce qerror_format()Luiz Capitulino2-0/+16
Will be used by new error propagation framework to convert Error objects into human-readable form. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-06-07QError: Introduce qerror_format_desc()Luiz Capitulino1-19/+25
Refactor non-QError-specific bits out of qerror_human() into general function that can be used by the error_get_pretty() analogue in the new error-propagation framework. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-06-07docs: qdev-device-use.txt has become stale, update itMarkus Armbruster1-66/+114
Document more bus addresses. Update for bugs fixed. Describe where exactly the -drive options go. Update for recent split of qdev ide-drive into ide-{cd,hd}, scsi-disk into scsi-{cd,hd}. Document scsi-hd's removable property only for usb-storage, because that's where it's used. Fix description of -global isa.fdc. Document usb-storage lossage. Clean up misleading description of network device's split into guest and host part. Document -vga's machine dependence. New qdevs: virtconsole, qxl-vga, isa-vga, intel-hda, usb-ccid Update for changed pci-assign property iommu. New section "Default Devices". Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-06-07isa-vga: Make available with -device, like the other VGA qdevsMarkus Armbruster2-1/+1
Switch no_user off and make it suppress the default VGA. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-06-06Fix regression introduced by -machine accel=Anthony Liguori1-1/+2
Commit 85097db6 changed the timing when kvm_allowed is set until after kvm is initialized. During initialization, the ioeventfd initialization code checks kvm_enabled() and after this change, ioeventfd is effectively disabled. This causes a significant regression in performance. Fix this by setting kvm_allowed before calling init. Reported-by: Khoa Huynh <khoa@us.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-06-06timer: drop HPET and RTCAnthony Liguori1-120/+0
dynticks will provide equally good timer granularity on all modern Linux systems. This is more or less dead code these days. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-06-06qxl: fix cmdlog for vgaAlon Levy1-1/+3
Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-06spice: require spice 0.6.0 or newer.Gerd Hoffmann2-9/+1
This patch raises the minimum required spice version to 0.6.0 and drops a few ifdefs. 0.6.0 is the first stable release with the current libspice-server API, there shouldn't be any 0.5.x development versions deployed any more. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-06qemu-config: comment spell fixGerd Hoffmann1-3/+3
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-06spice: add SASL supportMarc-André Lureau3-0/+28
Turn on SASL support by appending "sasl" to the spice arguments, which requires that the client use SASL to authenticate with the spice. The exact choice of authentication method used is controlled from the system / user's SASL configuration file for the 'qemu' service. This is typically found in /etc/sasl2/qemu.conf. If running QEMU as an unprivileged user, an environment variable SASL_CONF_PATH can be used to make it search alternate locations for the service config. While some SASL auth methods can also provide data encryption (eg GSSAPI), it is recommended that SASL always be combined with the 'tls' and 'x509' settings to enable use of SSL and server certificates. This ensures a data encryption preventing compromise of authentication credentials. It requires support from spice 0.8.1. [ kraxel: moved spell fix to separate commit ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-06qxl: add to the list of devices which disable the default vgaGerd Hoffmann1-0/+1
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-06spice: add option for disabling copy paste supportHans de Goede3-0/+12
Some people want to be able disable spice's guest <-> client copy paste support because of security considerations. [ kraxel: drop old-version error message ]
2011-06-06spice-qemu-char: Fix flow control in client -> guest directionHans de Goede1-6/+5
In the old spice-vmc device we used to have: last_out = virtio_serial_write(&svc->port, p, MIN(len, VMC_MAX_HOST_WRITE)); if (last_out > 0) ... Now in the chardev backend we have: last_out = MIN(len, VMC_MAX_HOST_WRITE); qemu_chr_read(scd->chr, p, last_out); if (last_out > 0) { ... Which causes us to no longer detect if the virtio port is not ready to receive data from us. chardev actually has a mechanism to detect this, but it requires a separate call to qemu_chr_can_read, before calling qemu_chr_read (which return void). This patch uses qemu_chr_can_read to fix the flow control from client to guest. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2011-06-05scsi: fix tracing of scsi requests with simple backendPaolo Bonzini2-2/+7
The simple backend only supports a maximum of 6 arguments. Split the scsi_req_parsed event in two parts to cope with the limit. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>