public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] [RESEND] kvm: qemu: remove the useless parameter
@ 2009-02-06  8:58 Han, Weidong
  2009-02-06 10:16 ` Mark McLoughlin
  0 siblings, 1 reply; 2+ messages in thread
From: Han, Weidong @ 2009-02-06  8:58 UTC (permalink / raw)
  To: 'Avi Kivity'; +Cc: 'kvm@vger.kernel.org'

[-- Attachment #1: Type: text/plain, Size: 2260 bytes --]

should pass &assigned_dev->dev to ipf_map_irq in while loop, the
parameter PCIDevice *d is useless. And rename assign_dev_update_irq
to assigned_dev_update_irqs() because it updates irq on all assigned devices.

Signed-off-by: Weidong Han <weidong.han@intel.com>
---
 qemu/hw/device-assignment.c |    4 ++--
 qemu/hw/device-assignment.h |    2 +-
 qemu/hw/pci.c               |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/qemu/hw/device-assignment.c b/qemu/hw/device-assignment.c
index 3fa8053..5003611 100644
--- a/qemu/hw/device-assignment.c
+++ b/qemu/hw/device-assignment.c
@@ -488,7 +488,7 @@ static uint32_t calc_assigned_dev_id(uint8_t bus, uint8_t devfn)
 /* The pci config space got updated. Check if irq numbers have changed
  * for our devices
  */
-void assigned_dev_update_irq(PCIDevice *d)
+void assigned_dev_update_irqs()
 {
     AssignedDevInfo *adev;
 
@@ -502,7 +502,7 @@ void assigned_dev_update_irq(PCIDevice *d)
         irq = piix_get_irq(irq);
 
 #ifdef TARGET_IA64
-	irq = ipf_map_irq(d, irq);
+	irq = ipf_map_irq(&assigned_dev->dev, irq);
 #endif
 
         if (irq != assigned_dev->girq) {
diff --git a/qemu/hw/device-assignment.h b/qemu/hw/device-assignment.h
index 8b3b105..f216bb0 100644
--- a/qemu/hw/device-assignment.h
+++ b/qemu/hw/device-assignment.h
@@ -99,7 +99,7 @@ PCIDevice *init_assigned_device(AssignedDevInfo *adev, PCIBus *bus);
 AssignedDevInfo *add_assigned_device(const char *arg);
 void add_assigned_devices(PCIBus *bus, const char **devices, int n_devices);
 ram_addr_t assigned_dev_load_option_roms(ram_addr_t rom_base_offset);
-void assigned_dev_update_irq(PCIDevice *d);
+void assigned_dev_update_irqs(void);
 
 #define MAX_DEV_ASSIGN_CMDLINE 8
 
diff --git a/qemu/hw/pci.c b/qemu/hw/pci.c
index a6d57e5..e207c7c 100644
--- a/qemu/hw/pci.c
+++ b/qemu/hw/pci.c
@@ -484,7 +484,7 @@ void pci_default_write_config(PCIDevice *d,
     if (kvm_enabled() && qemu_kvm_irqchip_in_kernel() &&
         address >= PIIX_CONFIG_IRQ_ROUTE &&
 	address < PIIX_CONFIG_IRQ_ROUTE + 4)
-        assigned_dev_update_irq(d);
+        assigned_dev_update_irqs();
 #endif /* USE_KVM_DEVICE_ASSIGNMENT */
 
     end = address + len;
-- 
1.6.0.4

[-- Attachment #2: 0001-kvm-qemu-remove-the-useless-parameter.patch --]
[-- Type: application/octet-stream, Size: 2408 bytes --]

From bebc471e0a628bd9a59020dc3cb17cc9544eb752 Mon Sep 17 00:00:00 2001
From: Weidong Han <weidong.han@intel.com>
Date: Fri, 6 Feb 2009 15:46:24 +0800
Subject: [PATCH] kvm: qemu: remove the useless parameter

should pass &assigned_dev->dev to ipf_map_irq in while loop, the
parameter PCIDevice *d is useless. And rename assign_dev_update_irq
to assigned_dev_update_irqs() because it updates irq on all assigned devices.

Signed-off-by: Weidong Han <weidong.han@intel.com>
---
 qemu/hw/device-assignment.c |    4 ++--
 qemu/hw/device-assignment.h |    2 +-
 qemu/hw/pci.c               |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/qemu/hw/device-assignment.c b/qemu/hw/device-assignment.c
index 3fa8053..5003611 100644
--- a/qemu/hw/device-assignment.c
+++ b/qemu/hw/device-assignment.c
@@ -488,7 +488,7 @@ static uint32_t calc_assigned_dev_id(uint8_t bus, uint8_t devfn)
 /* The pci config space got updated. Check if irq numbers have changed
  * for our devices
  */
-void assigned_dev_update_irq(PCIDevice *d)
+void assigned_dev_update_irqs()
 {
     AssignedDevInfo *adev;
 
@@ -502,7 +502,7 @@ void assigned_dev_update_irq(PCIDevice *d)
         irq = piix_get_irq(irq);
 
 #ifdef TARGET_IA64
-	irq = ipf_map_irq(d, irq);
+	irq = ipf_map_irq(&assigned_dev->dev, irq);
 #endif
 
         if (irq != assigned_dev->girq) {
diff --git a/qemu/hw/device-assignment.h b/qemu/hw/device-assignment.h
index 8b3b105..f216bb0 100644
--- a/qemu/hw/device-assignment.h
+++ b/qemu/hw/device-assignment.h
@@ -99,7 +99,7 @@ PCIDevice *init_assigned_device(AssignedDevInfo *adev, PCIBus *bus);
 AssignedDevInfo *add_assigned_device(const char *arg);
 void add_assigned_devices(PCIBus *bus, const char **devices, int n_devices);
 ram_addr_t assigned_dev_load_option_roms(ram_addr_t rom_base_offset);
-void assigned_dev_update_irq(PCIDevice *d);
+void assigned_dev_update_irqs(void);
 
 #define MAX_DEV_ASSIGN_CMDLINE 8
 
diff --git a/qemu/hw/pci.c b/qemu/hw/pci.c
index a6d57e5..e207c7c 100644
--- a/qemu/hw/pci.c
+++ b/qemu/hw/pci.c
@@ -484,7 +484,7 @@ void pci_default_write_config(PCIDevice *d,
     if (kvm_enabled() && qemu_kvm_irqchip_in_kernel() &&
         address >= PIIX_CONFIG_IRQ_ROUTE &&
 	address < PIIX_CONFIG_IRQ_ROUTE + 4)
-        assigned_dev_update_irq(d);
+        assigned_dev_update_irqs();
 #endif /* USE_KVM_DEVICE_ASSIGNMENT */
 
     end = address + len;
-- 
1.6.0.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/3] [RESEND] kvm: qemu: remove the useless parameter
  2009-02-06  8:58 [PATCH 1/3] [RESEND] kvm: qemu: remove the useless parameter Han, Weidong
@ 2009-02-06 10:16 ` Mark McLoughlin
  0 siblings, 0 replies; 2+ messages in thread
From: Mark McLoughlin @ 2009-02-06 10:16 UTC (permalink / raw)
  To: Han, Weidong; +Cc: 'Avi Kivity', 'kvm@vger.kernel.org'

On Fri, 2009-02-06 at 16:58 +0800, Han, Weidong wrote:
> should pass &assigned_dev->dev to ipf_map_irq in while loop, the
> parameter PCIDevice *d is useless. And rename assign_dev_update_irq
> to assigned_dev_update_irqs() because it updates irq on all assigned devices.
> 
> Signed-off-by: Weidong Han <weidong.han@intel.com>

Acked-by: Mark McLoughlin <markmc@redhat.com>

Cheers,
Mark.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-02-06 10:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-06  8:58 [PATCH 1/3] [RESEND] kvm: qemu: remove the useless parameter Han, Weidong
2009-02-06 10:16 ` Mark McLoughlin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox