[PATCH v2 7/9] qemu: Move <hostdev> SCSI path generation into qemuDomainPrepareHostdev()

Martin Kletzander mkletzan at redhat.com
Mon Apr 24 11:19:37 UTC 2023


On Mon, Apr 24, 2023 at 12:41:46PM +0200, Michal Privoznik wrote:
>When preparing a SCSI <hostdev/> with passthrough of a host SCSI
>adapter (i.e. no protocol), a virStorageSource structure is
>initialized and stored inside virDomainHostdevDef. But the source
>structure is filled in many places, with almost the same code.
>
>Firstly, qemuProcessPrepareHostHostdev() and
>qemuConnectDomainXMLToNativePrepareHostHostdev() are the same.
>
>Secondly, qemuDomainPrepareHostdev() allocates the src structure,
>only to let qemuProcessPrepareHostHostdev() fill src->path later.
>
>Well, src->path can be filled at the same place where the src
>structure is allocated (qemuDomainPrepareHostdev()) which renders
>the other two functions needless.
>
>Signed-off-by: Michal Privoznik <mprivozn at redhat.com>

Reviewed-by: Martin Kletzander <mkletzan at redhat.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20230424/74b955e5/attachment.sig>


More information about the libvir-list mailing list