Patchwork use PCI MACRO in virtio-pci

login
register
mail settings
Submitter hkran
Date Dec. 7, 2011, 9:39 a.m.
Message ID <4EDF345C.5060304@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/129924/
State New
Headers show

Comments

hkran - Dec. 7, 2011, 9:39 a.m.
Signed-off-by: hkran <hkran@linux.vnet.ibm.com>
---
  hw/virtio-pci.c |    6 +++---
  1 files changed, 3 insertions(+), 3 deletions(-)

      if (vdev->nvectors && !msix_init(&proxy->pci_dev, vdev->nvectors,
Stefan Hajnoczi - Dec. 7, 2011, 10:18 a.m.
On Wed, Dec 7, 2011 at 9:39 AM, hkran <hkran@linux.vnet.ibm.com> wrote:
> Signed-off-by: hkran <hkran@linux.vnet.ibm.com>
> ---
>  hw/virtio-pci.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)

This patch is line-wrapped and git-am refuses to apply it.

Are you using git-send-email(1)?  It normally sends patches correctly
so I recommend it if you are not yet using it.

Otherwise this looks good and we can take it into the trivial-patches
tree.  Please resend without line wrap.

Stefan
hkran - Dec. 8, 2011, 2:28 a.m.
On 12/07/2011 06:18 PM, Stefan Hajnoczi wrote:
> On Wed, Dec 7, 2011 at 9:39 AM, hkran<hkran@linux.vnet.ibm.com>  wrote:
>> Signed-off-by: hkran<hkran@linux.vnet.ibm.com>
>> ---
>>   hw/virtio-pci.c |    6 +++---
>>   1 files changed, 3 insertions(+), 3 deletions(-)
> This patch is line-wrapped and git-am refuses to apply it.
>
> Are you using git-send-email(1)?  It normally sends patches correctly
> so I recommend it if you are not yet using it.
>
> Otherwise this looks good and we can take it into the trivial-patches
> tree.  Please resend without line wrap.
>
> Stefan
>
ok,thanks for reviewing. I will resend it with git-publish:)
Anthony Liguori - Dec. 8, 2011, 2:30 a.m.
On 12/07/2011 03:39 AM, hkran wrote:
> Signed-off-by: hkran <hkran@linux.vnet.ibm.com>

A Signed-off-by line needs to use your full name.

Regards,

Anthony Liguori

> ---
> hw/virtio-pci.c | 6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
> index c665f5c..f8ee772 100644
> --- a/hw/virtio-pci.c
> +++ b/hw/virtio-pci.c
> @@ -627,9 +627,9 @@ void virtio_init_pci(VirtIOPCIProxy *proxy, VirtIODevice *vdev)
> if (proxy->class_code) {
> pci_config_set_class(config, proxy->class_code);
> }
> - pci_set_word(config + 0x2c, pci_get_word(config + PCI_VENDOR_ID));
> - pci_set_word(config + 0x2e, vdev->device_id);
> - config[0x3d] = 1;
> + pci_set_word(config + PCI_SUBSYSTEM_VENDOR_ID, pci_get_word(config +
> PCI_VENDOR_ID));
> + pci_set_word(config + PCI_SUBSYSTEM_ID, vdev->device_id);
> + config[PCI_INTERRUPT_PIN] = 1;
>
> memory_region_init(&proxy->msix_bar, "virtio-msix", 4096);
> if (vdev->nvectors && !msix_init(&proxy->pci_dev, vdev->nvectors,
hkran - Dec. 9, 2011, 3:32 a.m.
On 12/08/2011 10:30 AM, Anthony Liguori wrote:
> On 12/07/2011 03:39 AM, hkran wrote:
>> Signed-off-by: hkran <hkran@linux.vnet.ibm.com>
>
> A Signed-off-by line needs to use your full name.
>
> Regards,
>
> Anthony Liguori
>
>> ---
>> hw/virtio-pci.c | 6 +++---
>> 1 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
>> index c665f5c..f8ee772 100644
>> --- a/hw/virtio-pci.c
>> +++ b/hw/virtio-pci.c
>> @@ -627,9 +627,9 @@ void virtio_init_pci(VirtIOPCIProxy *proxy, 
>> VirtIODevice *vdev)
>> if (proxy->class_code) {
>> pci_config_set_class(config, proxy->class_code);
>> }
>> - pci_set_word(config + 0x2c, pci_get_word(config + PCI_VENDOR_ID));
>> - pci_set_word(config + 0x2e, vdev->device_id);
>> - config[0x3d] = 1;
>> + pci_set_word(config + PCI_SUBSYSTEM_VENDOR_ID, pci_get_word(config +
>> PCI_VENDOR_ID));
>> + pci_set_word(config + PCI_SUBSYSTEM_ID, vdev->device_id);
>> + config[PCI_INTERRUPT_PIN] = 1;
>>
>> memory_region_init(&proxy->msix_bar, "virtio-msix", 4096);
>> if (vdev->nvectors && !msix_init(&proxy->pci_dev, vdev->nvectors,
>
Signed-off-by: Hui Kai Ran <hkran@linux.vnet.ibm.com>

Patch

diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
index c665f5c..f8ee772 100644
--- a/hw/virtio-pci.c
+++ b/hw/virtio-pci.c
@@ -627,9 +627,9 @@  void virtio_init_pci(VirtIOPCIProxy *proxy, 
VirtIODevice *vdev)
      if (proxy->class_code) {
          pci_config_set_class(config, proxy->class_code);
      }
-    pci_set_word(config + 0x2c, pci_get_word(config + PCI_VENDOR_ID));
-    pci_set_word(config + 0x2e, vdev->device_id);
-    config[0x3d] = 1;
+    pci_set_word(config + PCI_SUBSYSTEM_VENDOR_ID, pci_get_word(config 
+ PCI_VENDOR_ID));
+    pci_set_word(config + PCI_SUBSYSTEM_ID, vdev->device_id);
+    config[PCI_INTERRUPT_PIN] = 1;

      memory_region_init(&proxy->msix_bar, "virtio-msix", 4096);