Skip to content

Commit

Permalink
virtio: Drop broken and superfluous object_property_set_link()
Browse files Browse the repository at this point in the history
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>
Message-Id: <20200721121153.1128844-1-armbru@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
  • Loading branch information
Markus Armbruster authored and mstsirkin committed Jul 22, 2020
1 parent dba04c3 commit cf4e3d0
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 11 deletions.
3 changes: 0 additions & 3 deletions hw/s390x/virtio-ccw-crypto.c
Expand Up @@ -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)
Expand Down
3 changes: 0 additions & 3 deletions hw/s390x/virtio-ccw-rng.c
Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions hw/virtio/virtio-crypto-pci.c
Expand Up @@ -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)
Expand Down
3 changes: 0 additions & 3 deletions hw/virtio/virtio-rng-pci.c
Expand Up @@ -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)
Expand Down

0 comments on commit cf4e3d0

Please sign in to comment.