aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* qemu-kvm: virtio: Do not register mask notifiers without in-kernel irqchip ↵qemu-kvm-1.1.0-gentooJan Kiszka2012-07-081-2/+2
| | | | | | | | | | | support We crash if we registers mask notifiers without backing in-kernel irqchip. This corresponds to the check in QEMU upstream after 1.1 now. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* qemu-kvm: Add missing default machine optionsJan Kiszka2012-07-081-0/+2
| | | | | | | qemu-kvm-specific machine defaults were missing for pc-0.15 and pc-1.0. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* Add 'query-events' command to QMP to query async eventsDaniel P. Berrange2012-07-084-62/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes it is neccessary for an application to determine whether a particular QMP event is available, so they can decide whether to use compatibility code instead. This introduces a new 'query-events' command to QMP to do just that { "execute": "query-events" } {"return": [{"name": "WAKEUP"}, {"name": "SUSPEND"}, {"name": "DEVICE_TRAY_MOVED"}, {"name": "BLOCK_JOB_CANCELLED"}, {"name": "BLOCK_JOB_COMPLETED"}, ...snip... {"name": "SHUTDOWN"}]} * monitor.c: Turn MonitorEvent -> string conversion into a lookup from a static table of constant strings. Add impl of qmp_query_events monitor command handler * qapi-schema.json, qmp-commands.hx: Define contract of query-events command Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* fdc: fix implied seek while there is no media in drivePavel Hrdina2012-06-291-0/+4
| | | | | | | | | The Windows uses 'READ' command at the start of an instalation without checking the 'dir' register. We have to abort the transfer with an abnormal termination if there is no media in the drive. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* kvm: i8254: Fix conversion of in-kernel to userspace stateJan Kiszka2012-06-291-5/+52
| | | | | | | | | | | | | | | | Due to a offset between the clock used to generate the in-kernel count_load_time (CLOCK_MONOTONIC) and the clock used for processing this in userspace (vm_clock), reading back the output of PIT channel 2 via port 0x61 was broken. One use cases that suffered from it was the CPU frequency calibration of SeaBIOS, which also affected IDE/AHCI timeouts. This fixes it by calibrating the offset between both clocks on kvm_pit_get and adjusting the kernel value before saving it in the userspace state. As the calibration only works while the vm_clock is running, we cache the in-kernel state across stopped phases. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@redhat.com>
* Merge tag 'v1.1.0' into nextAvi Kivity2012-06-031-1/+1
|\ | | | | | | | | | | | | * tag 'v1.1.0': Update version for 1.1.0 release Signed-off-by: Avi Kivity <avi@redhat.com>
| * Update version for 1.1.0 releaseAnthony Liguori2012-06-011-1/+1
| | | | | | | | Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | pci-assign: Drop kvm_assigned_irq::host_irq initializationJan Kiszka2012-06-011-1/+0
| | | | | | | | | | | | | | | | real_device.irq is never set explicitly, thus remains 0. So we can simply drop this line as assigned_irq_data is zero-initialized anyway. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* | pci-assign: Drop write-only AssignedDevRegion::numJan Kiszka2012-06-011-2/+0
| | | | | | | | | | | | | | No one was reading back this field. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* | pci-assign: Privatize type definitionsJan Kiszka2012-06-012-96/+90
| | | | | | | | | | | | | | | | | | No need to carry the type definitions in device-assignment.h. Move them over to allow dropping the header once we use an INTx routing notifier instead of exporting assigned_dev_update_irqs. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* | pci-assign: Drop iommu propertyJan Kiszka2012-06-012-20/+8
| | | | | | | | | | | | | | | | | | Disabling the IOMMU for an assigned device was never more than a highly experimental features and is no longer supported by host kernels >= 3.2. So drop this useless control from property list. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* | pci-assign: Hide ioport regions on lacking sysfs supportJan Kiszka2012-06-011-3/+4
| | | | | | | | | | | | | | | | | | As suggested by Alex: Instead of failing if the kernel does not allow us to speak to an ioport region, warn the user but, hide the region and continue. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* | Merge branch 'upstream-merge'Marcelo Tosatti2012-05-3142-218/+584
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * upstream-merge: (44 commits) Update version for 1.1.0-rc4 release pc-bios: Update OpenBIOS images block: prevent snapshot mode $TMPDIR symlink attack xhci: add usage info to docs vnc: fix segfault in vnc_display_pw_expire() Expose CPUID leaf 7 only for -cpu host qemu-ga: avoid blocking on atime update when reading /etc/mtab qemu-ga: Fix use of environ on Darwin pci: call object_unparent() before free_qdev() fix multiboot loading if load_end_addr == 0 vga: fix vram double-mapping with -vga std and -M pc-0.12 cocoa: Suppress Cocoa frontend for -qtest arch_init: Fix AltiVec build on Darwin/ppc slirp: Avoid redefining MAX_TCPOPTLEN slirp: Avoid statements without effect on Big Endian host ISCSI: Switch to using READ16/WRITE16 for I/O to the LUN ISCSI: Only call READCAPACITY16 for SBC devices, use READCAPACITY10 for MMC ISCSI: get device type at connection time ISCSI: change num_blocks to 64-bit ISCSI: redo how we set up the events ... Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
| * | Merge commit 'b3dbb9546ade0108156a04b4983cd3057fd77563' into upstream-mergeMarcelo Tosatti2012-05-3142-218/+584
|/| | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'b3dbb9546ade0108156a04b4983cd3057fd77563': (44 commits) Update version for 1.1.0-rc4 release pc-bios: Update OpenBIOS images block: prevent snapshot mode $TMPDIR symlink attack xhci: add usage info to docs vnc: fix segfault in vnc_display_pw_expire() Expose CPUID leaf 7 only for -cpu host qemu-ga: avoid blocking on atime update when reading /etc/mtab qemu-ga: Fix use of environ on Darwin pci: call object_unparent() before free_qdev() fix multiboot loading if load_end_addr == 0 vga: fix vram double-mapping with -vga std and -M pc-0.12 cocoa: Suppress Cocoa frontend for -qtest arch_init: Fix AltiVec build on Darwin/ppc slirp: Avoid redefining MAX_TCPOPTLEN slirp: Avoid statements without effect on Big Endian host ISCSI: Switch to using READ16/WRITE16 for I/O to the LUN ISCSI: Only call READCAPACITY16 for SBC devices, use READCAPACITY10 for MMC ISCSI: get device type at connection time ISCSI: change num_blocks to 64-bit ISCSI: redo how we set up the events ... Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
| * Update version for 1.1.0-rc4 releaseAnthony Liguori2012-05-311-1/+1
| | | | | | | | Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
| * Merge remote-tracking branch 'origin/master' into stagingAnthony Liguori2012-05-315-1/+1
| |\ | | | | | | | | | | | | * origin/master: pc-bios: Update OpenBIOS images
| | * pc-bios: Update OpenBIOS imagesBlue Swirl2012-05-305-1/+1
| | | | | | | | | | | | | | | | | | Update OpenBIOS images to r1060 built from submodule. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
| * | Merge remote-tracking branch 'mdroth/qga-pull-5-29-12-v2' into stagingAnthony Liguori2012-05-301-1/+6
| |\ \ | | | | | | | | | | | | | | | | | | | | * mdroth/qga-pull-5-29-12-v2: qemu-ga: avoid blocking on atime update when reading /etc/mtab qemu-ga: Fix use of environ on Darwin
| | * | qemu-ga: avoid blocking on atime update when reading /etc/mtabMichael Roth2012-05-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently we re-read/re-process /etc/mtab to get an updated list of mounts when guest-fsfreeze-thaw is called. This can cause an atime update on /etc/mtab, which will block if we're in a frozen state. Instead, use /proc's version of mtab, which may not be up-to-date with options passed via -o remount, but is compatible for our use cases since we only care about the filesystem type. Reported-by: Matsuda, Daiki <matsudadik@intellilink.co.jp> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
| | * | qemu-ga: Fix use of environ on DarwinAndreas Färber2012-05-291-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use _NSGetEnviron() helper to access the environment. Signed-off-by: Andreas Färber <andreas.faerber@web.de> Cc: Charlie Somerville <charlie@charliesomerville.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
| * | | block: prevent snapshot mode $TMPDIR symlink attackJim Meyering2012-05-303-15/+31
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In snapshot mode, bdrv_open creates an empty temporary file without checking for mkstemp or close failure, and ignoring the possibility of a buffer overrun given a surprisingly long $TMPDIR. Change the get_tmp_filename function to return int (not void), so that it can inform its two callers of those failures. Also avoid the risk of buffer overrun and do not ignore mkstemp or close failure. Update both callers (in block.c and vvfat.c) to propagate temp-file-creation failure to their callers. get_tmp_filename creates and closes an empty file, while its callers later open that presumed-existing file with O_CREAT. The problem was that a malicious user could provoke mkstemp failure and race to create a symlink with the selected temporary file name, thus causing the qemu process (usually root owned) to open through the symlink, overwriting an attacker-chosen file. This addresses CVE-2012-2652. http://bugzilla.redhat.com/CVE-2012-2652 Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Jim Meyering <meyering@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
| * | xhci: add usage info to docsGerd Hoffmann2012-05-301-0/+15
| | | | | | | | | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
| * | vnc: fix segfault in vnc_display_pw_expire()Gerd Hoffmann2012-05-301-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | NULL pointer dereference in case no vnc server is configured. Catch this and return -EINVAL like vnc_display_password() does. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
| * | Expose CPUID leaf 7 only for -cpu hostEduardo Habkost2012-05-302-7/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes v2 -> v3; - Check for kvm_enabled() before setting cpuid_7_0_ebx_features Changes v1 -> v2: - Use kvm_arch_get_supported_cpuid() instead of host_cpuid() on cpu_x86_fill_host(). We should use GET_SUPPORTED_CPUID for all bits on "-cpu host" eventually, but I am not changing all the other CPUID leaves because we may not be able to test such an intrusive change in time for 1.1. Description of the bug: Since QEMU 0.15, the CPUID information on CPUID[EAX=7,ECX=0] is being returned unfiltered to the guest, directly from the GET_SUPPORTED_CPUID return value. The problem is that this makes the resulting CPU feature flags unpredictable and dependent on the host CPU and kernel version. This breaks live-migration badly if migrating from a host CPU that supports some features on that CPUID leaf (running a recent kernel) to a kernel or host CPU that doesn't support it. Migration also is incorrect (the virtual CPU changes under the guest's feet) if you migrate in the opposite direction (from an old CPU/kernel to a new CPU/kernel), but with less serious consequences (guests normally query CPUID information only once on boot). Fortunately, the bug affects only users using cpudefs with level >= 7. The right behavior should be to explicitly enable those features on [cpudef] config sections or on the "-cpu" command-line arguments. Right now there is no predefined CPU model on QEMU that has those features: the latest Intel model we have is Sandy Bridge. I would like to get this fixed on 1.1, so I am submitting this patch, that enables those features only if "-cpu host" is being used (as we don't have any pre-defined CPU model that actually have those features). After 1.1 is released, we can make those features properly configurable on [cpudef] and -cpu configuration. One problem is: with this patch, users with the following setup: - Running QEMU 1.0; - Using a cpudef having level >= 7; - Running a kernel that supports the features on CPUID leaf 7; and - Running on a CPU that supports some features on CPUID leaf 7 won't be able to live-migrate to QEMU 1.1. But for these users live-migration is already broken (they can't live-migrate to hosts with older CPUs or older kernels, already), I don't see how to avoid this problem. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
| * | pci: call object_unparent() before free_qdev()Amos Kong2012-05-292-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Start VM with 8 multiple-function block devs, hot-removing those block devs by 'device_del ...' would cause qemu abort. | (qemu) device_del virti0-0-0 | (qemu) ** |ERROR:qom/object.c:389:object_delete: assertion failed: (obj->ref == 0) It's a regression introduced by commit 57c9fafe The whole PCI slot should be removed once. Currently only one func is cleaned in pci_unplug_device(), if you try to remove a single func by monitor cmd. free_qdev() are called for all functions in slot, but unparent_delete() is only called for one function. Signed-off-by: XXXX Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
| * | fix multiboot loading if load_end_addr == 0Scott Moser2012-05-291-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous multiboot load code did not treat the case where load_end_addr was 0 specially. The multiboot specification says the following: * load_end_addr Contains the physical address of the end of the data segment. (load_end_addr - load_addr) specifies how much data to load. This implies that the text and data segments must be consecutive in the OS image; this is true for existing a.out executable formats. If this field is zero, the boot loader assumes that the text and data segments occupy the whole OS image file. Signed-off-by: Scott Moser <smoser@ubuntu.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
| * | vga: fix vram double-mapping with -vga std and -M pc-0.12Avi Kivity2012-05-292-1/+7
| |/ | | | | | | | | | | | | | | | | | | | | | | With pc-0.12, we map the video RAM both through the PCI BAR (the guest does this) and through a fixed mapping at 0xe0000000. The memory API doesn't allow this double map, and aborts. Fix by using an alias. Reported-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
| * Merge remote-tracking branch 'afaerber-or/cocoa-for-upstream' into stagingAnthony Liguori2012-05-292-1/+6
| |\ | | | | | | | | | | | | | | | * afaerber-or/cocoa-for-upstream: cocoa: Suppress Cocoa frontend for -qtest arch_init: Fix AltiVec build on Darwin/ppc
| | * cocoa: Suppress Cocoa frontend for -qtestAndreas Färber2012-05-291-1/+2
| | | | | | | | | | | | Signed-off-by: Andreas Färber <andreas.faerber@web.de>
| | * arch_init: Fix AltiVec build on Darwin/ppcAndreas Färber2012-05-291-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit f29a56147b66845914d0a645bf9b4c5bb9a6af57 (implement -no-user-config command-line option (v3)) introduced uses of bool in arch_init.c. Shortly before that usage is support code for AltiVec (conditional to __ALTIVEC__). GCC's altivec.h may in a !__APPLE_ALTIVEC__ code path redefine bool, leading to type mismatches. altivec.h recommends to #undef for C++ compatibility, but doing so in C leads to bool remaining undefined. Fix by redefining bool to _Bool as mandated for stdbool.h by POSIX. Signed-off-by: Andreas Färber <andreas.faerber@web.de> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
| * | Merge remote-tracking branch 'sstabellini/for_1.1_rc3' into stagingAnthony Liguori2012-05-294-33/+56
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sstabellini/for_1.1_rc3: Call xc_domain_shutdown with the reboot flag when the guest requests a reboot. xen: Fix PV-on-HVM xen_disk: properly update stats in ioreq_release() xen_disk: use bdrv_aio_flush instead of bdrv_flush xen_disk: remove syncwrite option xen: disable rtc_clock xen: do not initialize the interval timer and PCSPK emulator
| | * | Call xc_domain_shutdown with the reboot flag when the guest requests a reboot.John V. Baboval2012-05-172-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: John V. Baboval <john.baboval@virtualcomputer.com> Signed-off-by: Tom Goetz <tom.goetz@virtualcomputer.com> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
| | * | xen: Fix PV-on-HVMAnthony PERARD2012-05-171-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the context of PV-on-HVM under Xen, the emulated nics are supposed to be unplug before the guest drivers are initialized, when the guest write to a specific IO port. Without this patch, the guest end up with two nics with the same MAC, the emulated nic and the PV nic. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com>
| | * | xen_disk: properly update stats in ioreq_release()Jan Beulich2012-05-171-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While for the "normal" case (called from blk_send_response_all()) decrementing requests_finished is correct, doing so in the parse error case is wrong; requests_inflight needs to be decremented instead. Signed-off-by: Jan Beulich <jbeulich@suse.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com>
| | * | xen_disk: use bdrv_aio_flush instead of bdrv_flushStefano Stabellini2012-05-171-4/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use bdrv_aio_flush instead of bdrv_flush. Make sure to call bdrv_aio_writev/readv after the presync bdrv_aio_flush is fully completed and make sure to call the postsync bdrv_aio_flush after bdrv_aio_writev/readv is fully completed. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
| | * | xen_disk: remove syncwrite optionStefano Stabellini2012-05-171-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes a dead option. The same can be achieved removing BDRV_O_NOCACHE and BDRV_O_CACHE_WB from the flags passed to bdrv_open. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
| | * | xen: disable rtc_clockStefano Stabellini2012-05-171-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | rtc_clock is only used by the RTC emulator (mc146818rtc.c), however Xen has its own RTC emulator in the hypervisor so we can disable it. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
| | * | xen: do not initialize the interval timer and PCSPK emulatorStefano Stabellini2012-05-171-10/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PIT and PCSPK are emulated by the hypervisor so we don't need to emulate them in Qemu: this patch prevents Qemu from waking up needlessly at PIT_FREQ on Xen. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
| * | | Merge remote-tracking branch 'mdroth/qga-pull-5-24-12' into stagingAnthony Liguori2012-05-292-1/+24
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | * mdroth/qga-pull-5-24-12: qemu-ga: Fix missing environ declaration configure: check if environ is declared
| | * | | qemu-ga: Fix missing environ declarationLuiz Capitulino2012-05-241-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 3674838cd05268954bb6473239cd7f700a79bf0f uses the environ global variable, but is relying on environ to be declared somewhere else. This worked for me because on F16 environ is declared in <unistd.h>, but that doesn't happen in OpenBSD for example, causing a build failure. This commit fixes the build error by declaring environ if it hasn't being declared yet. Also fixes a build warning due to a missing <sys/wait.h> include. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
| | * | | configure: check if environ is declaredLuiz Capitulino2012-05-241-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some systems may declare environ automatically, others don't. Check for it. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
| * | | | Merge remote-tracking branch 'kwolf/for-anthony' into stagingAnthony Liguori2012-05-298-81/+159
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * kwolf/for-anthony: fdc-test: introduced qtest no_media_on_start and cmos qtest for floppy fdc: fix media detection fdc: floppy drive should be visible after start without media qemu-iotests: mark 035 qcow2-only qcow2: Check qcow2_alloc_clusters_at() return value sheepdog: use heap instead of stack for BDRVSheepdogState sheepdog: return -errno on error sheepdog: mark image as snapshot when tag is specified qemu-img: Explain how rebase operation can be used to perform a 'diff' operation. qcow2: don't leak buffer for unexpected qcow_version in header
| | * | | | fdc-test: introduced qtest no_media_on_start and cmos qtest for floppyPavel Hrdina2012-05-251-17/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As default a guest has always one floppy drive so 0x10 byte in CMOS has to have 0x40 value. Higher 4 bits means that the first floppy drive is 1.44 Mb 3"5 drive and lower 4 bits means the second drive is not present. After the guest starts DSKCHG bit in DIR register should be set. If there is no media in drive, this bit should be set all the time. Because we start the guest without media in drive, we have to swap 'eject' and 'change' in 'test_media_change'. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| | * | | | fdc: fix media detectionPavel Hrdina2012-05-251-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have to set up 'media_changed' after guest start so floppy driver could detect that there is no media in drive. For this purpose we call 'fdctrl_change_cb' instead of 'fd_revalidate' in 'fdctrl_connect_drives'. 'fd_revalidate' is called inside 'fdctrl_change_cb'. We still have to set default drive geometry in 'fd_revalidate' even if there is no media in drive. When you try to open (windows) or mount (linux) floppy the driver tries to seek on track 1. Linux guest stuck in loop then kernel crashes and windows guest prints error message. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| | * | | | fdc: floppy drive should be visible after start without mediaPavel Hrdina2012-05-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you start guest with floppy drive but without media inserted, guest still should see floppy drive pressent. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| | * | | | qemu-iotests: mark 035 qcow2-onlyStefan Hajnoczi2012-05-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 035 parallel aio write test relies on knowledge of qcow2 metadata layout to stress parallel L2 table accesses. This only works for qcow2 unless we add additional calculations for qed or other formats. Mark this test as qcow2-only. Note that the test is strictly speaking non-deterministic although the output produced is reliable with qcow2. This is because the aio_write command returns before the aio write request has completed. Completions can occur at any time afterwards and cause a message to be printed. Therefore the exact output of this test is not deterministic but we seem to get away with it for qcow2 (maybe due to coroutine and main loop scheduling). Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| | * | | | qcow2: Check qcow2_alloc_clusters_at() return valueKevin Wolf2012-05-251-10/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using qcow2_alloc_clusters_at(), the cluster allocation code checked the wrong variable for an error code. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| | * | | | sheepdog: use heap instead of stack for BDRVSheepdogStateMORITA Kazutaka2012-05-251-13/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bdrv_create() is called in coroutine context now, so we cannot use more stack than 1 MB in the function if we use ucontext coroutine. This patch allocates BDRVSheepdogState, whose size is 4 MB, on the heap in sd_create(). Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| | * | | | sheepdog: return -errno on errorMORITA Kazutaka2012-05-251-32/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On error, BlockDriver APIs should return -errno instead of -1. Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| | * | | | sheepdog: mark image as snapshot when tag is specifiedMORITA Kazutaka2012-05-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a snapshot tag is specified in the filename, the opened image is a snapshot. Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp> Signed-off-by: Kevin Wolf <kwolf@redhat.com>