diff mbox series

[v6,11/11] hw/pvrdma: Provide correct value to object_get_typename

Message ID 1552300155-25216-12-git-send-email-yuval.shaia@oracle.com (mailing list archive)
State New, archived
Headers show
Series Misc fixes to pvrdma device | expand

Commit Message

Yuval Shaia March 11, 2019, 10:29 a.m. UTC
Use base object of PCIDevice in call to object_get_typename().

Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
---
 hw/rdma/vmw/pvrdma_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kamal Heib March 12, 2019, 9:02 a.m. UTC | #1
On 3/11/19 12:29 PM, Yuval Shaia wrote:
> Use base object of PCIDevice in call to object_get_typename().
> 
> Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
> ---
>  hw/rdma/vmw/pvrdma_main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/rdma/vmw/pvrdma_main.c b/hw/rdma/vmw/pvrdma_main.c
> index 49bfbd6..0b46561 100644
> --- a/hw/rdma/vmw/pvrdma_main.c
> +++ b/hw/rdma/vmw/pvrdma_main.c
> @@ -593,7 +593,7 @@ static void pvrdma_realize(PCIDevice *pdev, Error **errp)
>  
>      func0 = pci_get_function_0(pdev);
>      /* Break if not vmxnet3 device in slot 0 */
> -    if (strcmp(object_get_typename(&func0->qdev.parent_obj), TYPE_VMXNET3)) {
> +    if (strcmp(object_get_typename(OBJECT(func0)), TYPE_VMXNET3)) {
>          error_setg(errp, "Device on %x.0 must be %s", PCI_SLOT(pdev->devfn),
>                     TYPE_VMXNET3);
>          return;
> 

Reviewed-by: Kamal Heib <kamalheib1@gmail.com>
Marcel Apfelbaum March 14, 2019, 9:24 a.m. UTC | #2
On 3/11/19 12:29 PM, Yuval Shaia wrote:
> Use base object of PCIDevice in call to object_get_typename().
>
> Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
> ---
>   hw/rdma/vmw/pvrdma_main.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/rdma/vmw/pvrdma_main.c b/hw/rdma/vmw/pvrdma_main.c
> index 49bfbd6..0b46561 100644
> --- a/hw/rdma/vmw/pvrdma_main.c
> +++ b/hw/rdma/vmw/pvrdma_main.c
> @@ -593,7 +593,7 @@ static void pvrdma_realize(PCIDevice *pdev, Error **errp)
>   
>       func0 = pci_get_function_0(pdev);
>       /* Break if not vmxnet3 device in slot 0 */
> -    if (strcmp(object_get_typename(&func0->qdev.parent_obj), TYPE_VMXNET3)) {
> +    if (strcmp(object_get_typename(OBJECT(func0)), TYPE_VMXNET3)) {
>           error_setg(errp, "Device on %x.0 must be %s", PCI_SLOT(pdev->devfn),
>                      TYPE_VMXNET3);
>           return;

Reviewed-by: Marcel Apfelbaum<marcel.apfelbaum@gmail.com>

Thanks,
Marcel
diff mbox series

Patch

diff --git a/hw/rdma/vmw/pvrdma_main.c b/hw/rdma/vmw/pvrdma_main.c
index 49bfbd6..0b46561 100644
--- a/hw/rdma/vmw/pvrdma_main.c
+++ b/hw/rdma/vmw/pvrdma_main.c
@@ -593,7 +593,7 @@  static void pvrdma_realize(PCIDevice *pdev, Error **errp)
 
     func0 = pci_get_function_0(pdev);
     /* Break if not vmxnet3 device in slot 0 */
-    if (strcmp(object_get_typename(&func0->qdev.parent_obj), TYPE_VMXNET3)) {
+    if (strcmp(object_get_typename(OBJECT(func0)), TYPE_VMXNET3)) {
         error_setg(errp, "Device on %x.0 must be %s", PCI_SLOT(pdev->devfn),
                    TYPE_VMXNET3);
         return;