qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH V2 4/7] virtio-pci-bus: introduce virtio-pci-bus


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH V2 4/7] virtio-pci-bus: introduce virtio-pci-bus.
Date: Mon, 14 Jan 2013 22:39:49 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130105 Thunderbird/17.0.2

Am 14.01.2013 21:36, schrieb KONRAD Frédéric:
> On 14/01/2013 20:08, Anthony Liguori wrote:
>> address@hidden writes:
>>
>>> +VirtioBusState *virtio_pci_bus_new(VirtIOPCIProxy *dev)
>>> +{
>>> +    DeviceState *qdev = DEVICE(dev);
>>> +    BusState *qbus = qbus_create(TYPE_VIRTIO_PCI_BUS, qdev, NULL);
>>> +    VirtioBusState *bus = VIRTIO_BUS(qbus);
>>> +    qbus->allow_hotplug = 0;
>> Any reason to not use a qbus_create_inplace()?
>>
>> Regards,
>>
>> Anthony Liguori
> If I change the bus field of VirtIOPCIProxy from VirtioBus* to VirtioBus
> and I use qbus_create_inplace
> I can't use qbus_create_inplace(BUS(&dev->bus),...) as the object is not
> initialised yet right?

Correct, you need to use qbus_create_inplace((BusState *)&dev->bus,...).
I ran into the same trap for ADB last night. ;)

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

[Prev in Thread] Current Thread [Next in Thread]