[libvirt] [PATCH v2 03/10] conf: Introduce scsi hostdev
Han Cheng
hanc.fnst at cn.fujitsu.com
Wed Apr 3 09:03:17 UTC 2013
On 04/03/2013 04:29 PM, Osier Yang wrote:
> On 01/04/13 20:00, Han Cheng wrote:
>> @@ -10773,6 +10911,16 @@ virDomainDefParseXML(virCapsPtr caps,
>> goto error;
>> }
>> + if (hostdev->source.subsys.type ==
>> VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI &&
>> + hostdev->info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) {
>> + /* reverse first 16 unit for disk usage */
s/reverse/reserve/
>> + hostdev->info->type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE;
>> + hostdev->info->addr.drive.controller = 0;
>> + hostdev->info->addr.drive.bus = 0;
>> + hostdev->info->addr.drive.target = 0;
>
> Why this defdaults to 0? Can you explain it either in the commit log or
> by comments?
OK.
/* We define default mapping to be 1 controller, 1 bus, 1 target and
many units. */
>> + hostdev->info->addr.drive.unit = 16 + i;
>
> And why the "16".
In virDomainDiskDefAssignAddress, we assgined first 16 unit for scsi
disk. We reserve these address to avoid conflict.
>> + }
>> +
>> def->hostdevs[def->nhostdevs++] = hostdev;
>> }
>> VIR_FREE(nodes);
More information about the libvir-list
mailing list