From 6f338c3469297d748be33aea864161e36e068436 Mon Sep 17 00:00:00 2001 From: aliguori Date: Wed, 11 Feb 2009 15:21:54 +0000 Subject: 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=[[:]:] 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 Signed-off-by: Anthony Liguori git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6610 c046a42c-6fe2-441c-8c8c-71466251a162 --- vl.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'vl.c') diff --git a/vl.c b/vl.c index cdb91591c5..5f237d0a06 100644 --- a/vl.c +++ b/vl.c @@ -3405,6 +3405,7 @@ static void qemu_bh_update_timeout(int *timeout) /* machine registration */ static QEMUMachine *first_machine = NULL; +QEMUMachine *current_machine = NULL; int qemu_register_machine(QEMUMachine *m) { @@ -5587,6 +5588,8 @@ int main(int argc, char **argv, char **envp) machine->init(ram_size, vga_ram_size, boot_devices, kernel_filename, kernel_cmdline, initrd_filename, cpu_model); + current_machine = machine; + /* Set KVM's vcpu state to qemu's initial CPUState. */ if (kvm_enabled()) { int ret; -- cgit v1.2.3