summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2010-07-02blockdev: Clean up automatic drive deletionMarkus Armbruster7-7/+56
We automatically delete blockdev host parts on unplug of the guest device. Too much magic, but we can't change that now. The delete happens early in the guest device teardown, before the connection to the host part is severed. Thus, the guest part's pointer to the host part dangles for a brief time. No actual harm comes from this, but we'll catch such dangling pointers a few commits down the road. Clean up the dangling pointers by delaying the automatic deletion until the guest part's pointer is gone. Device usb-storage deliberately makes two qdev properties refer to the same drive, because it automatically creates a second device. Again, too much magic we can't change now. Multiple references worked okay before, but now free_drive() dies for the second one. Zap the extra reference. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-07-02blockdev: New drive_get_by_blockdev()Markus Armbruster2-0/+13
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-07-02Don't reset bs->is_temporary in bdrv_open_commonRyan Harper1-1/+0
To fix https://bugs.launchpad.net/qemu/+bug/597402 where qemu fails to call unlink() on temporary snapshots due to bs->is_temporary getting clobbered in bdrv_open_common() after being set in bdrv_open() which calls the former. We don't need to initialize bs->is_temporary in bdrv_open_common(). Signed-off-by: Ryan Harper <ryanh@us.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-07-02blockdev: Remove drive_get_serial()Markus Armbruster2-13/+0
Unused since commit 6ced55a5. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-07-02ide: Make it explicit that ide_create_drive() can't failMarkus Armbruster1-2/+1
All callers of ide_create_drive() ignore its value. Currently harmless, because it fails only when qdev_init() fails, which fails only when ide_drive_initfn() fails, which never fails. Brittle. Change it to die instead of silently ignoring failure. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-07-02scsi: scsi_bus_legacy_handle_cmdline() can fail, fix callersMarkus Armbruster6-8/+16
None of its callers checks for failure. scsi_hot_add() can crash because of that: (qemu) drive_add 4 if=scsi,format=host_device,file=/dev/sg1 scsi-generic: scsi generic interface too old Segmentation fault (core dumped) Fix all callers, not just scsi_hot_add(). Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-07-02block: allow filenames with colons again for host devicesChristoph Hellwig1-11/+18
Before the raw/file split we used to allow filenames with colons for host device only. While this was more by accident than by design people rely on it, so we need to bring it back. So move the host device probing to be before the protocol detection again. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-07-02qcow2: Fix error handling during metadata preallocationKevin Wolf1-6/+9
People were wondering why qemu-img check failed after they tried to preallocate a large qcow2 file and ran out of disk space. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-07-02Don't declare XSAVE as supportedAndi Kleen1-2/+2
i386 cpuid.c currently claims XSAVE is supported in the CPUID filter, but that's not true: Only FXSAVE is supported. Remove that bit from the filter. Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-07-02Add more boundary checking to sse3/4 parsingAndi Kleen1-0/+9
ssse3 uses tables with only two entries per op, but it is indexed with b1 which can contain variables upto 3. This happens when ssse3 or sse4 are used with REP* prefixes. Add boundary checking for this case. Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-07-01target-arm : fix parallel saturated subtraction implementationChih-Min Chao1-2/+2
Signed-off-by: Chih-Min Chao <cmchao@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-07-01target-arm : fix thumb2 parallel add/sub opcode decodingChih-Min Chao1-2/+2
Signed-off-by: Chih-Min Chao <cmchao@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-07-01target-arm: fix addsub/subadd implementationChih-Min Chao1-4/+4
Signed-off-by: Chih-Min Chao <cmchao@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-07-01Makefile: add qemu-options.def to distcleanHidetoshi Seto1-0/+1
Remove generated qemu-options.def at "make distclean". Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-07-01Add QMP/qmp-commands.txt to .gitignoreHidetoshi Seto1-0/+1
QMP/qmp-commands.txt is a generated file. Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-07-01target-i386: fix xchg rax,r8Richard Henderson1-2/+7
We were ignoring REX_B while special-casing NOP, i.e. xchg eax,eax. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-07-01target-mips: add Loongson support prefetchAurelien Jarno1-35/+43
Loongson CPU uses a load to zero register for prefetch. Emulate it as a NOP. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-07-01target-mips: split load and storeAurelien Jarno1-155/+183
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-06-30qdev-properties: Fix (u)intXX parsersKevin Wolf1-15/+35
scanf calls must not use PRI constants, they have probably the wrong size and corrupt memory. We could replace them by SCN ones, but strtol is simpler than scanf here anyway. While at it, also fix the parsers to reject garbage after the number ("4096xyz" was accepted before). Signed-off-by: Kevin Wolf <kwolf@redhat.com> Richard Henderson <rth@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-06-30Return usb device to host on exitShahar Havivi1-0/+14
Signed-off-by: Shahar Havivi <shaharh@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-06-30Return usb device to host on usb_del commandShahar Havivi1-0/+1
Signed-off-by: Shahar Havivi <shaharh@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-06-30net: Fix VM start with '-net none'Amit Shah1-1/+1
Commit 50e32ea8f31035877decc10f1075aa0e619e09cb changed the behaviour for the return type of net_client_init() when a nic type with no init method was specified. 'none' is one such nic type. Instead of returning 0, which gets interpreted as an index into the nd_table[] array, we switched to returning -1, which signifies an error as well. That broke VM start with '-net none'. Testing was only done with the monitor command 'pci_add', which doesn't fail. The correct fix would still be to return 0+ values from net_client_init() only when the return value can be used as an index to refer to an entry in nd_table[]. With the current code, callers can erroneously poke into nd_table[0] when -net nic is used, which can lead to badness. However, this commit just returns to the previous behaviour before the offending commit. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-06-30x86: svm: Always clear event_inj on vmexitJan Kiszka1-0/+1
We currently only clear SVM_EVTINJ_VALID after successful interrupt delivery. This apparently does not match real hardware which clears the whole event_inj field on every vmexit, including unsuccessful interrupt delivery. Reported-by: Erik van der Kouwe <vdkouwe@cs.vu.nl> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-06-30usb-uhci: fix commit 8e65b7c04965c8355e4ce43211582b6b83054e3d for vmstateTeLeMan1-1/+2
The commit 8e65b7c04965c8355e4ce43211582b6b83054e3d introduced expire_time of UHCIState. But expire_time is not in vmstate, the second uhci_frame_timer will not be fired immediately after loadvm. Signed-off-by: TeLeMan <geleman@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-06-30hw/omap : make local function static and remove declaration from headercmchao3-45/+9
Signed-off-by: cmchao <cmchao@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-06-30hw/omap1.c : separate uart modulecmchao3-171/+196
Signed-off-by: cmchao <cmchao@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-06-30hw/omwp2.c : separate l4 interconnect modulecmchao4-273/+307
Signed-off-by: cmchao <cmchao@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-06-30hw/omap2.c : separate tap module(Test-Chip-level)cmchao3-91/+113
Signed-off-by: cmchao <cmchao@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-06-30hw/omap2.c : separate spi modulecmchao4-324/+349
Signed-off-by: cmchao <cmchao@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-06-30hw/omap1.c : separate interrupt controller modulecmchao4-575/+603
Signed-off-by: cmchao <cmchao@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-06-30hw/omap2.c : separate sdrc (sdram controller)cmchao4-145/+168
Signed-off-by: cmchao <cmchao@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-06-30hw/omap2.c : separate gpmc(general purpose memory controller)cmchao4-397/+422
Signed-off-by: cmchao <cmchao@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-06-30hw/omap2.c : separate synctimer modulecmchao4-77/+104
Signed-off-by: cmchao <cmchao@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-06-30hw/omap2.c : separate gptimer modulecmchao4-463/+487
Signed-off-by: cmchao <cmchao@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-06-30hw/omap2.c : separate gpio modulecmchao3-523/+526
Signed-off-by: cmchao <cmchao@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-06-30hw/omap1.c : separate gpio modulecmchao4-182/+204
Signed-off-by: cmchao <cmchao@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-06-30virtio-serial: Simplify virtio_serial_load()Markus Armbruster1-9/+3
For all i, ports_map[i] is used in and only in the i-th iteration. Replace the dynamic array by a scalar variable. Signed-off-by: Markus Armbruster <armbru@redhat.com> Acked-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-06-30usb-serial: Fail instead of crash when chardev is missingMarkus Armbruster1-0/+5
Signed-off-by: Markus Armbruster <armbru@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-06-30A bit optimization for tlb_set_page()Jun Koi1-4/+6
This patch avoids handling write watchpoints on read-only memory access. It also breaks the searching loop for watchpoint once the setup for handling watchpoint later is done. Signed-off-by: Jun Koi <junkoi2004@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-06-30target-mips: fix DINSU instructionAurelien Jarno1-1/+1
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-06-30MIPS: fix fulong bios loadingAurelien Jarno1-6/+5
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-06-29target-mips: enable movn/movz on loongson 2E & 2FAurelien Jarno1-1/+2
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-06-29mips-dis: add support for Godson integer instructionsAurelien Jarno1-0/+33
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-06-29r2d: fix pflash mappingAurelien Jarno1-0/+1
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-06-29lsi53c895a: fix Phase Mismatch JumpPaolo Bonzini1-3/+3
lsi_bad_phase has a bug in the choice of pmjad1/pmjad2. This does not matter with Linux guests because it uses just one routine for both, but it breaks Windows 64-bit guests. This is the text from the spec: "[The PMJCTL] bit controls which decision mechanism is used when jumping on phase mismatch. When this bit is cleared the LSI53C895A will use Phase Mismatch Jump Address 1 (PMJAD1) when the WSR bit is cleared and Phase Mismatch Jump Address 2 (PMJAD2) when the WSR bit is set. When this bit is set the LSI53C895A will use jump address one (PMJAD1) on data out (data out, command, message out) transfers and jump address two (PMJAD2) on data in (data in, status, message in) transfers." Which means: CCNTL0.PMJCTL 0 SCNTL2.WSR = 0 PMJAD1 0 SCNTL2.WSR = 1 PMJAD2 1 out PMJAD1 1 in PMJAD2 In qemu, what you get instead is: CCNTL0.PMJCTL 0 out PMJAD1 0 in PMJAD2 <<<<< 1 out PMJAD1 1 in PMJAD1 <<<<< Considering that qemu always has SCNTL2.WSR cleared, the two marked cases (corresponding to phase mismatch on input) are always jumping to the wrong PMJAD register. The patch implements the correct semantics. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-06-29MIPS: Initial support of fulong mini pc (machine construction)Huacai Chen2-1/+414
Signed-off-by: Huacai Chen <zltjiangshi@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-06-29MIPS: Initial support of fulong mini pc (CPU definition)Huacai Chen2-0/+39
Signed-off-by: Huacai Chen <zltjiangshi@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-06-29MIPS: Initial support of VIA USB controller used by fulong mini pcHuacai Chen2-0/+29
Signed-off-by: Huacai Chen <zltjiangshi@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-06-29MIPS: Initial support of VIA IDE controller used by fulong mini pcHuacai Chen4-0/+194
Signed-off-by: Huacai Chen <zltjiangshi@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-06-29Initial support of vt82686b south bridge used by fulong mini pcHuacai Chen4-1/+617
Signed-off-by: Huacai Chen <zltjiangshi@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>