[libvirt] [PATCH 03/12] virhostdev: Unify virDomainHostdevDef to virPCIDevice translation

Ján Tomko jtomko at redhat.com
Wed Aug 21 12:22:49 UTC 2019


On Tue, Aug 20, 2019 at 04:30:23PM +0200, Michal Privoznik wrote:
>There are two places where we need to create virPCIDevice from
>given virDomainHostdevDef. In both places the code is duplicated.
>Move them into a single function and call it from those two
>places.
>
>Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
>---
> src/util/virhostdev.c | 93 +++++++++++++++++++++++++------------------
> 1 file changed, 54 insertions(+), 39 deletions(-)
>
>diff --git a/src/util/virhostdev.c b/src/util/virhostdev.c
>index 6861b8a84e..e3f48a9a2e 100644
>--- a/src/util/virhostdev.c
>+++ b/src/util/virhostdev.c
>@@ -212,6 +212,51 @@ virHostdevManagerGetDefault(void)
>     return virObjectRef(manager);
> }
>
>+/**
>+ * virHostdevGetPCIHostDevice:
>+ * @hostdev: domain hostdev definition
>+ * @pci: returned PCI device
>+ *
>+ * For given @hostdev which represents a PCI device construct its
>+ * virPCIDevice representation and returned it in @pci. If

s/returned/return/

>+ * @hostdev does not represent a PCI device then @pci is set to
>+ * NULL and 0 is returned.
>+ *
>+ * Returns: 0 on success (@pci might be NULL though),
>+ *         -1 otherwise (with error reported).
>+ */

Reviewed-by: Ján Tomko <jtomko at redhat.com>

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20190821/1867af75/attachment-0001.sig>


More information about the libvir-list mailing list