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

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

 



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@xxxxxxxxxx>
> ---
>  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

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]