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

Eric Blake eblake at redhat.com
Thu Jul 24 02:08:07 UTC 2014


On 07/21/2014 02:47 PM, 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(-)
> 

>  static int
> +virDomainHostdevMatchSubsysSCSIiSCSI(virDomainHostdevDefPtr first,
> +                                     virDomainHostdevDefPtr second)
> +{
> +    virDomainHostdevSubsysSCSIiSCSIPtr first_iscsisrc =
> +        &first->source.subsys.u.scsi.u.iscsi;
> +    virDomainHostdevSubsysSCSIiSCSIPtr second_iscsisrc =
> +        &second->source.subsys.u.scsi.u.iscsi;
> +
> +    if (STREQ(first_iscsisrc->hosts[0].name, second_iscsisrc->hosts[0].name) &&

Do you need to match nhosts, or is nhosts always 1?


> +
> +    /* Only delete the devices which are marked as being used by @name,
> +     * because qemuProcessStart could fail on the half way. */

Sounds funny; maybe "could fail half way through"


> -
> -        /* Only delete the devices which are marked as being used by @name,
> -         * because qemuProcessStart could fail on the half way. */

Then again, it's just code motion.

Conditional ACK, if the match function doesn't need to track nhosts.


-- 
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/20140723/585b1162/attachment-0001.sig>


More information about the libvir-list mailing list