[libvirt] [PATCH 6/8] hostdev: Introduce virDomainHostdevSubsysSCSIiSCSI

Eric Blake eblake at redhat.com
Mon Jul 21 20:19:33 UTC 2014


On 07/11/2014 06:35 AM, John Ferlan wrote:
> Create the structures and API's to hold and manage the iSCSI host device.
> This extends the 'scsi_host' definitions added in commit id '5c811dce'.
> A future patch will add the XML parsing, but that code requires some
> infrastructure to be in place first in order to handle the differences
> between a 'scsi_host' and an 'iSCSI host' device.
> 
> Signed-off-by: John Ferlan <jferlan at redhat.com>
> ---
>  src/conf/domain_audit.c          |  20 +++-
>  src/conf/domain_conf.c           |  47 ++++++++-
>  src/conf/domain_conf.h           |  20 ++++
>  src/qemu/qemu_cgroup.c           |  35 ++++---
>  src/qemu/qemu_command.c          |  74 ++++++++++++---
>  src/qemu/qemu_hotplug.c          |  36 +++++--
>  src/security/security_apparmor.c |   6 ++
>  src/security/security_dac.c      |  12 +++
>  src/security/security_selinux.c  |  12 +++
>  src/util/virhostdev.c            | 200 +++++++++++++++++++++++++--------------
>  10 files changed, 349 insertions(+), 113 deletions(-)

At this point, it's big enough that I'll wait for a respin to make sure
I'm reviewing it correctly on the latest tree.  But quick comments:

>  
> +static void
> +virDomainHostdevSubsysSCSIiSCSIFree(virDomainHostdevSubsysSCSIiSCSIPtr iscsisrc)
> +{
> +    if (!iscsisrc)
> +        return;
> +    VIR_FREE(iscsisrc->path);
> +    virStorageNetHostDefFree(iscsisrc->nhosts, iscsisrc->hosts);
> +    virStorageAuthDefFree(iscsisrc->auth);
> +    iscsisrc->auth = NULL;
> +}

This function doesn't free iscsisrc; typically, we name this type of
function Clear instead of Free.


>  static int
> +virDomainHostdevMatchSubsysSCSIiSCSI(virDomainHostdevDefPtr a,
> +                                     virDomainHostdevDefPtr b)
> +{
> +    virDomainHostdevSubsysSCSIiSCSIPtr aiscsisrc =
> +        &a->source.subsys.u.scsi.u.iscsi;
> +    virDomainHostdevSubsysSCSIiSCSIPtr biscsisrc =
> +        &b->source.subsys.u.scsi.u.iscsi;
> +
> +    if (STREQ(aiscsisrc->hosts[0].name, biscsisrc->hosts[0].name) &&
> +        STREQ(aiscsisrc->hosts[0].port, biscsisrc->hosts[0].port) &&
> +        STREQ(aiscsisrc->path, biscsisrc->path))

'first' and 'second' naming, as in 1/8.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140721/e226930f/attachment-0001.sig>


More information about the libvir-list mailing list