aboutsummaryrefslogtreecommitdiff
path: root/sysemu.h
diff options
context:
space:
mode:
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-02-11 15:21:54 +0000
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-02-11 15:21:54 +0000
commit6f338c3469297d748be33aea864161e36e068436 (patch)
tree99f66dd4c49c9f6ded9b1d13f47e33900a96e47c /sysemu.h
parent880345c484df16a1ec91febb8751d43b5fb8fc77 (diff)
downloadqemu-6f338c3469297d748be33aea864161e36e068436.zip
qemu-6f338c3469297d748be33aea864161e36e068436.tar.gz
qemu-6f338c3469297d748be33aea864161e36e068436.tar.bz2
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
Diffstat (limited to 'sysemu.h')
-rw-r--r--sysemu.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/sysemu.h b/sysemu.h
index 40e3715..57217c1 100644
--- a/sysemu.h
+++ b/sysemu.h
@@ -170,6 +170,20 @@ extern int drive_init(struct drive_opt *arg, int snapshot, void *machine);
void qemu_system_hot_add_init(void);
void qemu_system_device_hot_add(int pcibus, int slot, int state);
+/* device-hotplug */
+
+typedef int (dev_match_fn)(void *dev_private, void *arg);
+
+int add_init_drive(const char *opts);
+void destroy_nic(dev_match_fn *match_fn, void *arg);
+void destroy_bdrvs(dev_match_fn *match_fn, void *arg);
+
+/* pci-hotplug */
+void pci_device_hot_add(const char *pci_addr, const char *type, const char *opts);
+void drive_hot_add(const char *pci_addr, const char *opts);
+void pci_device_hot_remove(const char *pci_addr);
+void pci_device_hot_remove_success(int pcibus, int slot);
+
/* serial ports */
#define MAX_SERIAL_PORTS 4