summaryrefslogtreecommitdiff
path: root/hw
AgeCommit message (Collapse)AuthorFilesLines
2009-10-15net: allow NICs to be connected to netdevsMark McLoughlin7-9/+16
Introduce a 'peer' member to VLANClientState as an alternative to a vlan. The idea being that packets are transfered directly from peer clients rather than going through a vlan. Patchworks-ID: 35516 Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-15net: handle -netdevice optionsMark McLoughlin1-1/+1
Same as for -net except for: - only tap, user, vde and socket types are supported - the vlan parameter is not allowed - the name parameter is not allowed but the id parameter is required Patchworks-ID: 35517 Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-15net: remove id field from NICInfoMark McLoughlin1-2/+2
Just use the name field instead since we now use the id paramater as the name, if supplied. Only implication with this change is that if id is not supplied, the value of the name paramater is used as an id. Patchworks-ID: 35512 Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-15hotplug: safely iterate bus's sibling list while removing a deviceMark McLoughlin1-2/+2
Without this, I'm seeing a segfault when unpluging a NIC. Cc: Gerd Hoffmann <kraxel@redhat.com> Patchworks-ID: 35519 Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-15eepro100: Remove unused device status entriesStefan Weil1-74/+20
Once upon the time when QEMU hacking was fun there was a brave knight who wanted to have a driver for a special intel nic. So he started by cloning ne2000.c which also meant that the new born eepro100.c was immediately three years old. Other knights who also wanted to have fun and take their part in the battle thought that it would be a good idea to remove stupid code which says "missing nic load, missing nic save". They saved everything they saw, man and women, ne2000 code and runtime address offsets, and put all saved elements in a prison called vm data. When the first knight came back and noticed the unhappy prisoners, he wanted to set them free. But the keepers of the keys told him that they would have to stay there forever for compatibility reasons. So our brave knight now takes a new effort to save the souls of the poor prisoners by removing their names. Their bodies will have to rot in the dungeons of compatibility forever, watched by the keepers of the keys. Patchworks-ID: 35635 Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-14scsi disk block descriptor v2Artyom Tarasenko1-1/+21
The SCSI-2 documentation suggests, that although the block descriptor is optional for an arbitrary SCSI-2 device (chapter 8.2.10, http://ldkelley.com/SCSI2/SCSI2/SCSI2/SCSI2/SCSI2-08.html ) it is mandatory for a disk: chapters 9.1.2, 9.3.3 ( http://ldkelley.com/SCSI2/SCSI2/SCSI2/SCSI2-09.html ) don't say "optional" any more, just "The block descriptor in the MODE SENSE data describes the block lengths that are used on the medium." v2: limit the number of sectors reported in the block descriptor to 24 bits. Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-10-13Add some chipset doc linksBlue Swirl2-0/+17
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-10-12Fixed wacom emulationFrançois Revol1-14/+24
- for absolute mode, scale coordinates to the real device maximum values, since some drivers (on Haiku and Linux at least) need them as such, and the HID descriptor is boggus on some models anyway, - keep the coordinates even when no button is pressed, on real tablet the pen is sensed on the surface even without direct contact, and drivers expect this, - map left button to pressure according to what the Haiku driver wants, - map the right button to the pen button, - map the middle button to the eraser, - use asynchronous reporting as the hid code does, stops the Haiku driver (and probably others) from spending 50% cpu polling for changes. Signed-off-by: François Revol <revol@free.fr> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-12rom loader: also try filename as-is.Gerd Hoffmann1-2/+1
In case qemu_find_file fails try to open the file as-is. Patchworks-ID: 35263 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-12rom loader: fix sparc -kernel boot.Gerd Hoffmann14-24/+54
Changes: (1) register pstrcpy_targphys() in rom list, it is used for kernel command lines by a number of architectures. (2) add rom_ptr() function to get a pointer for applying changes to loaded images. Needed for example to tell the linux kernel where it finds the initrd image by updating the header. (3) make sparc use rom_ptr for initrd setup. booting sparc-test works now, and 'info roms' shows this: (qemu) info roms addr=0000000000000000 size=0x2a3828 mem=ram name="phdr #0: vmlinux-2.6.11+tcx" addr=00000000007ff000 size=0x00000e mem=ram name="cmdline" addr=0000000000800000 size=0x400000 mem=ram name="/root/qemu-test/sparc-test/linux.img" addr=0000000070000000 size=0x0e4000 mem=rom name="phdr #0: /home/kraxel/projects/qemu/build-zfull/pc-bios/openbios-sparc32" reboot via 'system_reset' works too. Patchworks-ID: 35262 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-12TARGET_I386 is always defined if TARGET_X86_64 is definedJuan Quintela3-4/+4
Patchworks-ID: 35378 Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-12ide: BMDMAState don't need a pci_dev field anymoreJuan Quintela3-3/+0
Patchworks-ID: 35306 Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-12ide: cmd646 ->unit has just the value that we wantJuan Quintela1-2/+2
Patchworks-ID: 35307 Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-12ide: cmd646 we can get the pci device with container_ofJuan Quintela1-6/+11
Patchworks-ID: 35305 Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-12ide: 'secondary' field is only used by cmd646Juan Quintela1-1/+1
Patchworks-ID: 35303 Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-12ide: PCIIDEState type field is not needed anymoreJuan Quintela3-30/+11
We have split the functions that needed it for cmd646 Patchworks-ID: 35302 Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-12ide: split cmd646 and piix from pci.cJuan Quintela3-338/+478
This patch splits cmd646 specific code from pci.c. This patch splits piix4 specific code from pci.c. And compile new piix.o and cmd646.o when they are needed. The only change that is not code movemet is removal of cmd646 specific parts in bmdma_readb/writeb for piix. Patchworks-ID: 35301 Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-12ide: export needed ide-pci functions for splitJuan Quintela2-10/+20
Patchworks-ID: 35300 Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-12ide: create ide/pci.h for common ide pci definitionsJuan Quintela2-13/+19
Patchworks-ID: 35299 Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-12ide: remove uselsess casts from void *Juan Quintela2-13/+13
Patchworks-ID: 35298 Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-12ide: Remove duplicated definitionsJuan Quintela1-6/+0
Patchworks-ID: 35297 Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-12ide: Remove cast in pci_register_barJuan Quintela1-12/+6
We already have a PCIDevice at that point Patchworks-ID: 35296 Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-12ide: change cast to DO_UPCASTJuan Quintela1-2/+2
Patchworks-ID: 35293 Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-10Fix Windows host breakage by 45a50b1668822c23afc2a89f724654e176518bc4 (TeLeMan)malc1-1/+1
Signed-off-by: malc <av1474@comtv.ru>
2009-10-08pcnet: Restart poll timer on pcnet_startJan Kiszka1-0/+1
Just like we call into pcnet_poll_timer on stop, we need to call it on start to trigger the setup of the poll timer. Patchworks-ID: 35313 Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-08pcnet: Drop unused recv_pos fieldJan Kiszka1-13/+8
This state field was never used, simply remained 0. Drop it from the PCNetState and update the save/restore code accordingly, keeping backward compatibility. Patchworks-ID: 35314 Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-07Clean up test for qdev_init() failureMarkus Armbruster6-6/+6
Some callers test for != 0, some for < 0. Normalize to < 0. Patchworks-ID: 35171 Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-07Warn if value of qdev_init() isn't checkedMarkus Armbruster1-1/+1
After qdev_init() fails, the device is gone. Failure to check runs a high risk of use-after-free. Patchworks-ID: 35166 Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-07Make isa_create() terminate program on failureMarkus Armbruster1-5/+3
Callers don't check the return value anyway. Patchworks-ID: 35172 Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-07New qdev_init_nofail()Markus Armbruster34-58/+72
Like qdev_init(), but terminate program via hw_error() instead of returning an error value. Use it instead of qdev_init() where terminating the program on failure is okay, either because it's during machine construction, or because we know that failure can't happen. Because relying in the latter is somewhat unclean, and the former is not always obvious, it would be nice to go back to qdev_init() in the not-so-obvious cases, only with proper error handling. I'm leaving that for another day, because it involves making sure that error values are properly checked by all callers. Patchworks-ID: 35168 Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-07Check return value of qdev_init()Markus Armbruster4-4/+8
But do so only where it may actually fail. Leave the rest for the next commit. Patchworks-ID: 35167 Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-07Make qdev_init() destroy the device on failureMarkus Armbruster2-4/+6
Before, every caller had to do this. Only two actually did. Patchworks-ID: 35170 Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-06qdev: move commentGerd Hoffmann1-1/+1
Move comment back next to main_system_bus to avoid confusion. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-06qemu/pci: make pci not depend on msixMichael S. Tsirkin2-3/+9
Making pci device cleanup msix automatically makes pci.c depend on msix.c, which is IMO messy. Since devices do msix_init it's easy and natural for them to also do msix_uninit. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-06qemu/pci: clarify pci config load routineMichael S. Tsirkin1-4/+5
PCI load routine has to be called with size equal to 256 (otherwise it will crash in weird ways). So assert this, making code clearer. Also avoid dynamically sized array on stack - good for portability. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Cc: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-06Final net cleanup after conversion to QemuOptsMark McLoughlin1-1/+1
Now that net_client_init() has no users, kill it off and rename net_client_init_from_opts(). There is no further need for the old code in net_client_parse() either. We use qemu_opts_parse() 'firstname' facitity for that. Instead, move the special handling of the 'vmchannel' type there. Simplify the vl.c code into merely call net_client_parse() for each -net command line option and then calling net_init_clients() later to iterate over the options and create the clients. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-06Port PCI NIC hotplug to QemuOptsMark McLoughlin1-2/+14
Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-06Make NICInfo string fields non-constMark McLoughlin2-2/+2
We now only assign strdup()ed strings to these fields, never static strings. aliguori: fix build for ppc_prep and mips_jazz Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-06Revert "Fix exit on 'pci_add' Monitor command"Anthony Liguori3-16/+0
This reverts commit 0148fde54c2478ea8a47c8dbfe4c0fb8bda4d996. As requested by Luiz. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-06Reorganize option rom (+linux kernel) loading.Gerd Hoffmann4-248/+312
This patch adds infrastructure to maintain memory regions which must be restored on reset. That includes roms (vga bios and option roms on pc), but is also used when loading linux kernels directly. Features: - loading files is supported. - passing blobs is supported. - target address range is supported (for optionrom area). - fixed target memory address is supported (linux kernel). New in v2: - writes to ROM are done only at initial boot. - also handle aout and uimage loaders. - drop unused fread_targphys() function. The final memory layout is created once all memory regions are registered. The option roms get addresses assigned and the registered regions are checked against overlaps. Finally all data is copyed to the guest memory. Advantages: (1) Filling memory on initial boot and on reset takes the same code path, making reset more robust. (2) The need to keep track of the option rom load address is gone. (3) Due to (2) option roms can be loaded outside pc_init(). This allows to move the pxe rom loading into the nic drivers for example. Additional bonus: There is a 'info roms' monitor command now. The patch also switches over pc.c and removes the option_rom_setup_reset() and load_option_rom() functions. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-06eepro100: support 16 bit read from SCBCmd (== 2)=?UTF-8?q?Reimar=20D=C3=B6ffinger?=1-0/+1
This is necessary to support OpenBSD 4.2 install, without this change it triggers an assert. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-05Improve error reporting on file accessJustin M. Forbes1-6/+6
By making the error reporting include strerror(errno), it gives the user a bit more indication as to why qemu failed. This is particularly important for people running qemu as a non root user. Signed-off-by: Justin M. Forbes <jforbes@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-05Rename pci_create_noinit() to pci_create()Markus Armbruster5-9/+9
It's qdev_create() specialized for PCI, so name it accordingly. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-05pci_create() is now unused, remove itMarkus Armbruster2-19/+0
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-05Fix pci_add nic not to exit on bad modelMarkus Armbruster13-14/+43
Monitor command "pci_add ADDR nic model=MODEL" uses pci_nic_init() to create the NIC. When MODEL is unknown or "?", this prints to stderr and terminates the program. Change pci_nic_init() not to treat "?" specially, and to return NULL on failure. Switch uses during startup to new convenience wrapper pci_nic_init_nofail(), which behaves just like pci_nic_init() used to do. Bonus bug fix: we now check for qdev_init() failing there. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-05Make it obvious that pci_nic_init() can't failMarkus Armbruster1-16/+9
Before this patch, pci_nic_init() returns NULL when it can't find the model in pci_nic_models[]. Except this can't happen, because qemu_check_nic_model_list() just searched for model in pci_nic_models[], and terminated the program on failure. Repeating the search here is pointless. Instead, change qemu_check_nic_model_list() to return the model's array index. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-05Fix pci_add storage not to exit on bad first argumentMarkus Armbruster3-3/+12
Monitor command "pci_add ADDR storage ..." does its work in qemu_pci_hot_add_nic(). It called pci_create(..., ADDR) to create the device. That's wrong, because pci_create() terminates the program when ADDR is invalid. Use pci_get_bus_devfn() and pci_create_noinit() instead. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-05Fix pci_vga_init() not to ignore bus argumentMarkus Armbruster1-1/+1
Commit a414c306 converted all VGA devices to qdev. It used pci_create_simple() for all devices, except for this one it used pci_create(). That's wrong, because it uses PCI bus#0 regardless of the bus argument. Fix by switching to pci_create_noinit(). Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-05set correct CS seg limit and flags on sipiGleb Natapov1-1/+1
TCG works with incorrect values somehow. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-05Set revision in eeprom correctly for 82557 versions.=?UTF-8?q?Reimar=20D=C3=B6ffinger?=1-0/+2
This is necessary to make FreeBSD recognize the device as 82557 - otherwise its driver will use unsupported features and fail to work. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>