Lines Matching refs:dev
876 DeviceState *dev; member
886 static int failover_set_primary(DeviceState *dev, void *opaque) in failover_set_primary() argument
890 object_dynamic_cast(OBJECT(dev), TYPE_PCI_DEVICE); in failover_set_primary()
897 fdev->dev = dev; in failover_set_primary()
918 return fdev.dev; in failover_find_primary_device()
924 DeviceState *dev = failover_find_primary_device(n); in failover_add_primary() local
926 if (dev) { in failover_add_primary()
938 dev = qdev_device_add_from_qdict(n->primary_opts, in failover_add_primary()
945 object_unref(OBJECT(dev)); in failover_add_primary()
3450 static bool failover_unplug_primary(VirtIONet *n, DeviceState *dev) in failover_unplug_primary() argument
3456 hotplug_ctrl = qdev_get_hotplug_handler(dev); in failover_unplug_primary()
3458 pci_dev = PCI_DEVICE(dev); in failover_unplug_primary()
3460 hotplug_handler_unplug_request(hotplug_ctrl, dev, &err); in failover_unplug_primary()
3471 static bool failover_replug_primary(VirtIONet *n, DeviceState *dev, in failover_replug_primary() argument
3476 PCIDevice *pdev = PCI_DEVICE(dev); in failover_replug_primary()
3482 primary_bus = dev->parent_bus; in failover_replug_primary()
3487 qdev_set_parent_bus(dev, primary_bus, &error_abort); in failover_replug_primary()
3489 hotplug_ctrl = qdev_get_hotplug_handler(dev); in failover_replug_primary()
3491 hotplug_handler_pre_plug(hotplug_ctrl, dev, &err); in failover_replug_primary()
3495 hotplug_handler_plug(hotplug_ctrl, dev, &err); in failover_replug_primary()
3508 DeviceState *dev = failover_find_primary_device(n); in virtio_net_handle_migration_primary() local
3510 if (!dev) { in virtio_net_handle_migration_primary()
3517 if (failover_unplug_primary(n, dev)) { in virtio_net_handle_migration_primary()
3518 vmstate_unregister(VMSTATE_IF(dev), qdev_get_vmsd(dev), dev); in virtio_net_handle_migration_primary()
3519 qapi_event_send_unplug_primary(dev->id); in virtio_net_handle_migration_primary()
3526 if (!failover_replug_primary(n, dev, &err)) { in virtio_net_handle_migration_primary()
3593 static void virtio_net_device_realize(DeviceState *dev, Error **errp) in virtio_net_device_realize() argument
3595 VirtIODevice *vdev = VIRTIO_DEVICE(dev); in virtio_net_device_realize()
3596 VirtIONet *n = VIRTIO_NET(dev); in virtio_net_device_realize()
3719 &dev->mem_reentrancy_guard, n); in virtio_net_device_realize()
3722 object_get_typename(OBJECT(dev)), dev->id, in virtio_net_device_realize()
3723 &dev->mem_reentrancy_guard, n); in virtio_net_device_realize()
3758 n->qdev = dev; in virtio_net_device_realize()
3767 static void virtio_net_device_unrealize(DeviceState *dev) in virtio_net_device_unrealize() argument
3769 VirtIODevice *vdev = VIRTIO_DEVICE(dev); in virtio_net_device_unrealize()
3770 VirtIONet *n = VIRTIO_NET(dev); in virtio_net_device_unrealize()
3876 DeviceState *dev = opaque; in primary_unplug_pending() local
3878 VirtIODevice *vdev = VIRTIO_DEVICE(dev); in primary_unplug_pending()
3890 DeviceState *dev = opaque; in dev_unplug_pending() local
3891 VirtioDeviceClass *vdc = VIRTIO_DEVICE_GET_CLASS(dev); in dev_unplug_pending()
3893 return vdc->primary_unplug_pending(dev); in dev_unplug_pending()
3901 return &net->dev; in virtio_net_get_vhost()