Commit 1f0711e298ad9fc9c36a4d1c61d36d0dc4433f09

Authored by aliguori
1 parent 6eb011b0

Generate PCI hotplug interrupt only if corespondent EN bit is set. (Gleb Natapov)

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6625 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 4 additions and 4 deletions
hw/acpi.c
... ... @@ -724,25 +724,25 @@ void qemu_system_hot_add_init(void)
724 724 static void enable_device(struct pci_status *p, struct gpe_regs *g, int slot)
725 725 {
726 726 g->sts |= 2;
727   - g->en |= 2;
728 727 p->up |= (1 << slot);
729 728 }
730 729  
731 730 static void disable_device(struct pci_status *p, struct gpe_regs *g, int slot)
732 731 {
733 732 g->sts |= 2;
734   - g->en |= 2;
735 733 p->down |= (1 << slot);
736 734 }
737 735  
738 736 void qemu_system_device_hot_add(int bus, int slot, int state)
739 737 {
740   - qemu_set_irq(pm_state->irq, 1);
741 738 pci0_status.up = 0;
742 739 pci0_status.down = 0;
743 740 if (state)
744 741 enable_device(&pci0_status, &gpe, slot);
745 742 else
746 743 disable_device(&pci0_status, &gpe, slot);
747   - qemu_set_irq(pm_state->irq, 0);
  744 + if (gpe.en & 2) {
  745 + qemu_set_irq(pm_state->irq, 1);
  746 + qemu_set_irq(pm_state->irq, 0);
  747 + }
748 748 }
... ...