qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] virtio: Drop broken and superfluous object_property_set_link()
@ 2020-07-21 12:11 Markus Armbruster
  2020-07-21 12:21 ` Philippe Mathieu-Daudé
  2020-07-23  7:06 ` Cornelia Huck
  0 siblings, 2 replies; 4+ messages in thread
From: Markus Armbruster @ 2020-07-21 12:11 UTC (permalink / raw)
  To: qemu-devel
  Cc: thuth, mst, cohuck, pasic, borntraeger, frederic.konrad,
	arei.gonglei

virtio_crypto_pci_realize() and copies the value of vcrypto->vdev's
property "cryptodev" to vcrypto's property:

    object_property_set_link(OBJECT(vrng), "rng", OBJECT(vrng->vdev.conf.rng),
                             NULL);

Since it does so only after realize, this always fails, but the error
is ignored.

It's actually superfluous: vcrypto's property is an alias of
vcrypto->vdev's property, created by virtio_instance_init_common().

Drop the call.

Same for virtio_ccw_crypto_realize(), virtio_rng_pci_realize(),
virtio_ccw_rng_realize().

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 hw/s390x/virtio-ccw-crypto.c  | 3 ---
 hw/s390x/virtio-ccw-rng.c     | 3 ---
 hw/virtio/virtio-crypto-pci.c | 2 --
 hw/virtio/virtio-rng-pci.c    | 3 ---
 4 files changed, 11 deletions(-)

diff --git a/hw/s390x/virtio-ccw-crypto.c b/hw/s390x/virtio-ccw-crypto.c
index 570c0333fc..358c74fb4b 100644
--- a/hw/s390x/virtio-ccw-crypto.c
+++ b/hw/s390x/virtio-ccw-crypto.c
@@ -23,9 +23,6 @@ static void virtio_ccw_crypto_realize(VirtioCcwDevice *ccw_dev, Error **errp)
     if (!qdev_realize(vdev, BUS(&ccw_dev->bus), errp)) {
         return;
     }
-
-    object_property_set_link(OBJECT(vdev), "cryptodev",
-                             OBJECT(dev->vdev.conf.cryptodev), NULL);
 }
 
 static void virtio_ccw_crypto_instance_init(Object *obj)
diff --git a/hw/s390x/virtio-ccw-rng.c b/hw/s390x/virtio-ccw-rng.c
index 4bb8c16d79..2e3a9da5e8 100644
--- a/hw/s390x/virtio-ccw-rng.c
+++ b/hw/s390x/virtio-ccw-rng.c
@@ -24,9 +24,6 @@ static void virtio_ccw_rng_realize(VirtioCcwDevice *ccw_dev, Error **errp)
     if (!qdev_realize(vdev, BUS(&ccw_dev->bus), errp)) {
         return;
     }
-
-    object_property_set_link(OBJECT(dev), "rng", OBJECT(dev->vdev.conf.rng),
-                             NULL);
 }
 
 static void virtio_ccw_rng_instance_init(Object *obj)
diff --git a/hw/virtio/virtio-crypto-pci.c b/hw/virtio/virtio-crypto-pci.c
index f1cc979d33..198f86e08c 100644
--- a/hw/virtio/virtio-crypto-pci.c
+++ b/hw/virtio/virtio-crypto-pci.c
@@ -57,8 +57,6 @@ static void virtio_crypto_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
     if (!qdev_realize(vdev, BUS(&vpci_dev->bus), errp)) {
         return;
     }
-    object_property_set_link(OBJECT(vcrypto), "cryptodev",
-                             OBJECT(vcrypto->vdev.conf.cryptodev), NULL);
 }
 
 static void virtio_crypto_pci_class_init(ObjectClass *klass, void *data)
diff --git a/hw/virtio/virtio-rng-pci.c b/hw/virtio/virtio-rng-pci.c
index 2f0b529b62..8afbb4c209 100644
--- a/hw/virtio/virtio-rng-pci.c
+++ b/hw/virtio/virtio-rng-pci.c
@@ -38,9 +38,6 @@ static void virtio_rng_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
     if (!qdev_realize(vdev, BUS(&vpci_dev->bus), errp)) {
         return;
     }
-
-    object_property_set_link(OBJECT(vrng), "rng", OBJECT(vrng->vdev.conf.rng),
-                             NULL);
 }
 
 static void virtio_rng_pci_class_init(ObjectClass *klass, void *data)
-- 
2.26.2



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

* Re: [PATCH] virtio: Drop broken and superfluous object_property_set_link()
  2020-07-21 12:11 [PATCH] virtio: Drop broken and superfluous object_property_set_link() Markus Armbruster
@ 2020-07-21 12:21 ` Philippe Mathieu-Daudé
  2020-07-21 14:15   ` Markus Armbruster
  2020-07-23  7:06 ` Cornelia Huck
  1 sibling, 1 reply; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-21 12:21 UTC (permalink / raw)
  To: Markus Armbruster, qemu-devel
  Cc: thuth, mst, cohuck, pasic, borntraeger, frederic.konrad,
	arei.gonglei

On 7/21/20 2:11 PM, Markus Armbruster wrote:

Is there a line missing here?

> virtio_crypto_pci_realize() and copies the value of vcrypto->vdev's

                              ^^^

> property "cryptodev" to vcrypto's property:
> 
>     object_property_set_link(OBJECT(vrng), "rng", OBJECT(vrng->vdev.conf.rng),
>                              NULL);
> 
> Since it does so only after realize, this always fails, but the error
> is ignored.
> 
> It's actually superfluous: vcrypto's property is an alias of
> vcrypto->vdev's property, created by virtio_instance_init_common().
> 
> Drop the call.
> 
> Same for virtio_ccw_crypto_realize(), virtio_rng_pci_realize(),
> virtio_ccw_rng_realize().
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  hw/s390x/virtio-ccw-crypto.c  | 3 ---
>  hw/s390x/virtio-ccw-rng.c     | 3 ---
>  hw/virtio/virtio-crypto-pci.c | 2 --
>  hw/virtio/virtio-rng-pci.c    | 3 ---
>  4 files changed, 11 deletions(-)
> 
> diff --git a/hw/s390x/virtio-ccw-crypto.c b/hw/s390x/virtio-ccw-crypto.c
> index 570c0333fc..358c74fb4b 100644
> --- a/hw/s390x/virtio-ccw-crypto.c
> +++ b/hw/s390x/virtio-ccw-crypto.c
> @@ -23,9 +23,6 @@ static void virtio_ccw_crypto_realize(VirtioCcwDevice *ccw_dev, Error **errp)
>      if (!qdev_realize(vdev, BUS(&ccw_dev->bus), errp)) {
>          return;
>      }
> -
> -    object_property_set_link(OBJECT(vdev), "cryptodev",
> -                             OBJECT(dev->vdev.conf.cryptodev), NULL);
>  }
>  
>  static void virtio_ccw_crypto_instance_init(Object *obj)
> diff --git a/hw/s390x/virtio-ccw-rng.c b/hw/s390x/virtio-ccw-rng.c
> index 4bb8c16d79..2e3a9da5e8 100644
> --- a/hw/s390x/virtio-ccw-rng.c
> +++ b/hw/s390x/virtio-ccw-rng.c
> @@ -24,9 +24,6 @@ static void virtio_ccw_rng_realize(VirtioCcwDevice *ccw_dev, Error **errp)
>      if (!qdev_realize(vdev, BUS(&ccw_dev->bus), errp)) {
>          return;
>      }
> -
> -    object_property_set_link(OBJECT(dev), "rng", OBJECT(dev->vdev.conf.rng),
> -                             NULL);
>  }
>  
>  static void virtio_ccw_rng_instance_init(Object *obj)
> diff --git a/hw/virtio/virtio-crypto-pci.c b/hw/virtio/virtio-crypto-pci.c
> index f1cc979d33..198f86e08c 100644
> --- a/hw/virtio/virtio-crypto-pci.c
> +++ b/hw/virtio/virtio-crypto-pci.c
> @@ -57,8 +57,6 @@ static void virtio_crypto_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
>      if (!qdev_realize(vdev, BUS(&vpci_dev->bus), errp)) {
>          return;
>      }
> -    object_property_set_link(OBJECT(vcrypto), "cryptodev",
> -                             OBJECT(vcrypto->vdev.conf.cryptodev), NULL);
>  }
>  
>  static void virtio_crypto_pci_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/virtio/virtio-rng-pci.c b/hw/virtio/virtio-rng-pci.c
> index 2f0b529b62..8afbb4c209 100644
> --- a/hw/virtio/virtio-rng-pci.c
> +++ b/hw/virtio/virtio-rng-pci.c
> @@ -38,9 +38,6 @@ static void virtio_rng_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
>      if (!qdev_realize(vdev, BUS(&vpci_dev->bus), errp)) {
>          return;
>      }
> -
> -    object_property_set_link(OBJECT(vrng), "rng", OBJECT(vrng->vdev.conf.rng),
> -                             NULL);
>  }
>  
>  static void virtio_rng_pci_class_init(ObjectClass *klass, void *data)
> 



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

* Re: [PATCH] virtio: Drop broken and superfluous object_property_set_link()
  2020-07-21 12:21 ` Philippe Mathieu-Daudé
@ 2020-07-21 14:15   ` Markus Armbruster
  0 siblings, 0 replies; 4+ messages in thread
From: Markus Armbruster @ 2020-07-21 14:15 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: thuth, mst, cohuck, qemu-devel, pasic, borntraeger,
	frederic.konrad, arei.gonglei

Philippe Mathieu-Daudé <philmd@redhat.com> writes:

> On 7/21/20 2:11 PM, Markus Armbruster wrote:
>
> Is there a line missing here?
>
>> virtio_crypto_pci_realize() and copies the value of vcrypto->vdev's
>
>                               ^^^
>

Scratch "and".  I started describing two of the four cases together,
then changed my mind and described just one, keeping other three under
"Same for" below.  I accidentally left the "and" behind.

>> property "cryptodev" to vcrypto's property:
>> 
>>     object_property_set_link(OBJECT(vrng), "rng", OBJECT(vrng->vdev.conf.rng),
>>                              NULL);
>> 
>> Since it does so only after realize, this always fails, but the error
>> is ignored.
>> 
>> It's actually superfluous: vcrypto's property is an alias of
>> vcrypto->vdev's property, created by virtio_instance_init_common().
>> 
>> Drop the call.
>> 
>> Same for virtio_ccw_crypto_realize(), virtio_rng_pci_realize(),
>> virtio_ccw_rng_realize().
>> 
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>



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

* Re: [PATCH] virtio: Drop broken and superfluous object_property_set_link()
  2020-07-21 12:11 [PATCH] virtio: Drop broken and superfluous object_property_set_link() Markus Armbruster
  2020-07-21 12:21 ` Philippe Mathieu-Daudé
@ 2020-07-23  7:06 ` Cornelia Huck
  1 sibling, 0 replies; 4+ messages in thread
From: Cornelia Huck @ 2020-07-23  7:06 UTC (permalink / raw)
  To: Markus Armbruster
  Cc: thuth, mst, qemu-devel, pasic, borntraeger, frederic.konrad,
	arei.gonglei

On Tue, 21 Jul 2020 14:11:53 +0200
Markus Armbruster <armbru@redhat.com> wrote:

> virtio_crypto_pci_realize() and copies the value of vcrypto->vdev's
> property "cryptodev" to vcrypto's property:
> 
>     object_property_set_link(OBJECT(vrng), "rng", OBJECT(vrng->vdev.conf.rng),
>                              NULL);
> 
> Since it does so only after realize, this always fails, but the error
> is ignored.
> 
> It's actually superfluous: vcrypto's property is an alias of
> vcrypto->vdev's property, created by virtio_instance_init_common().
> 
> Drop the call.
> 
> Same for virtio_ccw_crypto_realize(), virtio_rng_pci_realize(),
> virtio_ccw_rng_realize().
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  hw/s390x/virtio-ccw-crypto.c  | 3 ---
>  hw/s390x/virtio-ccw-rng.c     | 3 ---
>  hw/virtio/virtio-crypto-pci.c | 2 --
>  hw/virtio/virtio-rng-pci.c    | 3 ---
>  4 files changed, 11 deletions(-)

Reviewed-by: Cornelia Huck <cohuck@redhat.com>



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

end of thread, other threads:[~2020-07-23  7:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-21 12:11 [PATCH] virtio: Drop broken and superfluous object_property_set_link() Markus Armbruster
2020-07-21 12:21 ` Philippe Mathieu-Daudé
2020-07-21 14:15   ` Markus Armbruster
2020-07-23  7:06 ` Cornelia Huck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).