aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2010-12-14Make error handling more consistent in img_create() and img_resize()Jes Sorensen1-6/+12
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-12-14Fail if detecting an unknown optionJes Sorensen1-0/+8
This patch changes qemu-img to exit if an unknown option is detected, instead of trying to continue with a set of arguments which may be incorrect. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-12-14Fix formatting and missing braces in qemu-img.cJes Sorensen1-26/+51
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-12-14Consolidate printing of block driver optionsJes Sorensen1-9/+37
This consolidates the printing of block driver options in print_block_option_help() which is called from both img_create() and img_convert(). This allows for the "?" detection to be done just after the parsing of options and the filename, instead of half way down the codepath of these functions. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-12-14img_convert(): Only try to free bs[] entries if bs is valid.Jes Sorensen1-5/+8
This allows for jumping to 'out:' consistently for error exit. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-12-14Use qemu_mallocz() instead of calloc() in img_convert()Jes Sorensen1-6/+2
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-12-14Add missing tracing to qemu_mallocz()Jes Sorensen1-1/+4
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-12-14block: Make bdrv_create_file() ':' handling consistentStefan Hajnoczi1-1/+1
Filenames may start with "<protocol>:" to explicitly use a protocol like nbd. Filenames with unknown protocols are rejected in most of QEMU except for bdrv_create_file(). Even if a file with an invalid filename can be created, QEMU cannot use it since all the other relevant functions reject such paths. Make bdrv_create_file() consistent. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-12-12Watchdog: disable watchdog timer when hard-rebooting a guest.Richard W.M. Jones2-5/+20
This commit causes the watchdog timer to be reset when a guest is hard-rebooted. The failure case previously was as follows: (a) guest boots, watchdog is enabled (b) guest does a reset eg: echo 'b' > /proc/sysrq-trigger (note that an ordinary /sbin/reboot wouldn't hit this case since as the watchdog daemon is shut down, the daemon would properly disable the watchdog device) (c) the reboot takes longer than the remaining time on the watchdog (d) the watchdog therefore fires during the reboot (e) probably the VM would just reboot again at this point which is pretty benign, but it could depend on the action that the user had selected for the watchdog Now we use the qdev reset function to register a reset handler which disables the timer. Note the handler is called _either_ just after init _or_ when the guest reboots. In the i6300esb case there is a small refactoring of the code so that the device's internal state is now fully restored to defaults on a reboot. Signed-off-by: Richard W.M. Jones <rjones@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-11Pass boot device list to firmware.Gleb Natapov3-0/+63
Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-11Add notifier that will be called when machine is fully created.Gleb Natapov2-0/+17
Action that depends on fully initialized device model should register with this notifier chain. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-11Add bootindex for option roms.Gleb Natapov12-24/+60
Extend -option-rom command to have additional parameter ,bootindex=. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-11Change fw_cfg_add_file() to get full file path as a parameter.Gleb Natapov3-16/+20
Change fw_cfg_add_file() to get full file path as a parameter instead of building one internally. Two reasons for that. First caller may need to know how file is named. Second this moves policy of file naming out from fw_cfg. Platform may want to use more then two levels of directories for instance. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-11Add bootindex parameter to net/block/fd deviceGleb Natapov17-2/+119
If bootindex is specified on command line a string that describes device in firmware readable way is added into sorted list. Later this list will be passed into firmware to control boot order. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-11Add get_fw_dev_path callback to scsi bus.Gleb Natapov1-0/+23
Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-11Add get_fw_dev_path callback for usb bus.Gleb Natapov1-0/+42
Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-11Record which USBDevice USBPort belongs too.Gleb Natapov6-6/+8
Ports on root hub will have NULL here. This is needed to reconstruct path from device to its root hub to build device path. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-11Add get_fw_dev_path callback for pci bus.Gleb Natapov1-23/+85
Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-11Add get_fw_dev_path callback for system bus.Gleb Natapov3-0/+36
Prints out mmio or pio used to access child device. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-11Add get_fw_dev_path callback to IDE bus.Gleb Natapov1-0/+13
Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-11Store IDE bus id in IDEBus structure for easy access.Gleb Natapov6-9/+11
Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-11Add get_fw_dev_path callback to ISA bus in qdev.Gleb Natapov1-0/+16
Use device ioports to create unique device path. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-11Keep track of ISA ports ISA device is using in qdev.Gleb Natapov13-0/+57
Store all io ports used by device in ISADevice structure. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-11Introduce new BusInfo callback get_fw_dev_path.Gleb Natapov1-0/+7
New get_fw_dev_path callback will be used for build device path usable by firmware in contrast to qdev qemu internal device path. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-11Introduce fw_name field to DeviceInfo structure.Gleb Natapov11-0/+16
Add "fw_name" to DeviceInfo to use in device path building. In contrast to "name" "fw_name" should refer to functionality device provides instead of particular device model like "name" does. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-11monitor: implement x86 info mem for PAE and long modesBlue Swirl1-12/+164
'info mem' didn't show correct information for PAE mode and x86_64 long mode. Fix by implementing the output for missing modes. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-11monitor: implement x86 info tlb for PAE and long modesBlue Swirl1-11/+140
'info tlb' didn't show correct information for PAE mode and x86_64 long mode. Implement the missing modes. Also print NX bit for PAE and long modes. Fix off-by-one error in 32 bit mode mask. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-11wdt_i6300esb: register a reset functionBernhard Kohl1-18/+21
The device shall set its default hardware state after each reset. This includes that the timer is stopped which is especially important if the guest does a reboot independantly of a watchdog bite. I moved the initialization of the state variables completely from the init to the reset function which is called right after init during the first boot and afterwards during each reboot. Signed-off-by: Bernhard Kohl <bernhard.kohl@nsn.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-11isa-bus.c: use hw_error instead of fprintfTristan Gingold1-7/+4
Minor clean-up in isa-bus.c. Using hw_error is more consistent. There is a difference however: hw_error dumps the cpu state. Signed-off-by: Tristan Gingold <gingold@adacore.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-11usb_ohci: Always use little endianAlexander Graf3-11/+2
This patch replaces explicit bswaps with endianness hints to the mmio layer. Because we don't depend on the target endianness anymore, we can also move the driver over to Makefile.objs. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-11isa_mmio: Always use little endianAlexander Graf14-119/+36
This patch converts the ISA MMIO bridge code to always use little endian mmio. All bswap code that existed was only there to convert from native cpu endianness to little endian ISA devices. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-11heathrow_pic: Declare as little endianAlexander Graf1-3/+1
This patch replaces explicit bswaps with endianness hints to the mmio layer. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-11rtl8139: Declare as little endianAlexander Graf3-16/+2
This patch replaces explicit bswaps with endianness hints to the mmio layer. Because we don't depend on the target endianness anymore, we can also move the driver over to Makefile.objs. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-11openpic: Replace explicit byte swap with endian hintsAlexander Graf1-21/+2
This patch replaces explicit bswaps with endianness hints to the mmio layer. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-11ppc4xx_pci: Declare as little endianAlexander Graf1-15/+2
This patch replaces explicit bswaps with endianness hints to the mmio layer. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-11versatile_pci: Declare as little endianAlexander Graf1-13/+1
This patch replaces explicit bswaps with endianness hints to the mmio layer. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-11prep: Declare as little endianAlexander Graf1-35/+3
This patch replaces explicit bswaps with endianness hints to the mmio layer. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-11e1000: Make little endianAlexander Graf3-10/+3
The e1000 has compatibility code to handle big endianness which makes it mandatory to be recompiled on different targets. With the generic mmio endianness solution, there's no need for that anymore. We just declare all mmio to be little endian and call it a day. Because we don't depend on the target endianness anymore, we can also move the driver over to Makefile.objs. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-11uninorth: Get rid of bswapAlexander Graf1-4/+2
There's no need to bswap once we correctly set the mmio to be little endian. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-11pci-host: Delegate bswap to mmio layerAlexander Graf6-101/+46
The only reason we have bswap versions of the pci host code is that most pci host devices are little endian. The ppc e500 is the only odd one here, being big endian. So let's directly pass the endianness down to the mmio layer and not worry about it on the pci host layer. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-11dbdma: Make little endianAlexander Graf1-4/+1
The device is only used on big endian systems, but always byte swaps. That's a very good indicator that it's actually a little endian device ;-). Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-11Make simple io mem handler endian awareAlexander Graf5-10/+17
As an alternative to the 3 individual handlers, there is also a simplified io mem hook function. To be consistent, let's add an endianness parameter there too. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-11Add endianness as io mem parameterAlexander Graf154-262/+446
As stated before, devices can be little, big or native endian. The target endianness is not of their concern, so we need to push things down a level. This patch adds a parameter to cpu_register_io_memory that allows a device to choose its endianness. For now, all devices simply choose native endian, because that's the same behavior as before. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-11exec: introduce endianness swapped mmioAlexander Graf2-3/+128
The way we're currently modeling mmio is too simplified. We assume that every device has the same endianness as the target CPU. In reality, most devices are little endian (all PCI and ISA ones I'm aware of). Some are big endian (special system devices) and a very little fraction is target native endian (fw_cfg). So instead of assuming every device to be native endianness, let's move to a model where the device tells us which endianness it's in. That way we can compile the devices only once and get rid of all the ugly swap will be done by the underlying layer. For the same of readability, this patch only introduces the helper framework but doesn't allow the registering code to set its endianness yet. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-10noaudio: fix return value for read()Michael Walle1-1/+1
Read should return bytes instead of samples. Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: malc <av1474@comtv.ru>
2010-12-08ppc: kvm: fix signedness warningAlexander Graf1-1/+1
I get a warning on a signed comparison with an unsigned variable, so let's make the variable signed and be happy. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
2010-12-05Speedup 'tb_find_slow' by using the same heuristic as during memory page lookupKirill Batuzov1-0/+6
Move the last found TB to the head of the list so it will be found more quickly next time it will be looked for. Signed-off-by: Kirill Batuzov <batuzovk@ispras.ru> Signed-off-by: Pavel Yushchenko <pau@ispras.ru> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-04Remove unused spin_trylock() functionPeter Maydell1-10/+0
Remove the spin_trylock() function, as it is not used anywhere, and is not even implemented if CONFIG_USE_NPTL is defined. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-04darwin-user: Use GCC_FMT_ATTR (format checking)Stefan Weil2-2/+2
The redundant forward declaration of qerror in machload.c is removed because it should be taken from qemu.h. Please note that this patch is untested because I have no matching environment to compile it. Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-04audio: Use GCC_FMT_ATTR (format checking)Stefan Weil1-1/+2
Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>