qemu: PCI device, disk and host network hot-add / hot-remove (Marcelo Tosatti)

Add monitor command to hot-add PCI devices (nic and storage).
    
Syntax is:
    
pci_add pci_addr=[[<domain>:]<bus>:]<slot> nic|storage params
    
It returns the domain, bus and slot for the newly added device on success.
    
It is possible to attach a disk to a device after PCI initialization via
the drive_add command. If so, a manual scan of the SCSI bus on the guest
is necessary.
    
Save QEMUMachine necessary for drive_init.
    
Add monitor command to hot-remove devices, remove device data on _EJ0 notification.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6610 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
aliguori 2009-02-11 15:21:54 +00:00
parent 880345c484
commit 6f338c3469
11 changed files with 403 additions and 0 deletions

View file

@ -679,8 +679,12 @@ static uint32_t pciej_read(void *opaque, uint32_t addr)
static void pciej_write(void *opaque, uint32_t addr, uint32_t val)
{
#if defined (TARGET_I386)
int slot = ffs(val) - 1;
pci_device_hot_remove_success(0, slot);
#endif
#if defined(DEBUG)
printf("pciej write %lx <== %d\n", addr, val);
#endif