} else {
virDomainHostdevSubsysSCSIHostPtr scsihostsrc =
&scsisrc->u.host;
- if (virAsprintfQuiet(&address, "%s:%u:%u:%u",
+ if (virAsprintfQuiet(&address, "%s:%u:%u:%llu",
scsihostsrc->adapter, scsihostsrc->bus,
scsihostsrc->target,
scsihostsrc->unit) < 0) {
goto cleanup;
}
- if (virStrToLong_uip(unit, NULL, 0, &scsihostsrc->unit) < 0) {
+ if (virStrToLong_ullp(unit, NULL, 0, &scsihostsrc->unit) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot parse unit '%s'"), unit);
goto cleanup;
virBufferAsprintf(buf, "<adapter name='%s'/>\n",
scsihostsrc->adapter);
virBufferAsprintf(buf,
- "<address %sbus='%u' target='%u' unit='%u'/>\n",
+ "<address %sbus='%u' target='%u' unit='%llu'/>\n",
includeTypeInAddr ? "type='scsi' " : "",
scsihostsrc->bus, scsihostsrc->target,
scsihostsrc->unit);
char *adapter;
unsigned bus;
unsigned target;
- unsigned unit;
+ unsigned long long unit;
};
typedef struct _virDomainHostdevSubsysSCSIiSCSI virDomainHostdevSubsysSCSIiSCSI;
const char *adapter,
unsigned int bus,
unsigned int target,
- unsigned int unit);
+ unsigned long long unit);
};
extern qemuBuildCommandLineCallbacks buildCommandLineCallbacks;
} else {
virDomainHostdevSubsysSCSIHostPtr scsihostsrc = &scsisrc->u.host;
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to prepare scsi hostdev: %s:%u:%u:%u"),
+ _("Unable to prepare scsi hostdev: %s:%u:%u:%llu"),
scsihostsrc->adapter, scsihostsrc->bus,
scsihostsrc->target, scsihostsrc->unit);
}
virDomainHostdevSubsysSCSIHostPtr scsihostsrc =
&scsisrc->u.host;
virReportError(VIR_ERR_OPERATION_FAILED,
- _("host scsi device %s:%u:%u.%u not found"),
+ _("host scsi device %s:%u:%u.%llu not found"),
scsihostsrc->adapter, scsihostsrc->bus,
scsihostsrc->target, scsihostsrc->unit);
}
scsihostsrc->adapter, scsihostsrc->bus,
scsihostsrc->target, scsihostsrc->unit,
hostdev->readonly, hostdev->shareable))) {
- VIR_WARN("Unable to reattach SCSI device %s:%u:%u:%u on domain %s",
+ VIR_WARN("Unable to reattach SCSI device %s:%u:%u:%llu on domain %s",
scsihostsrc->adapter, scsihostsrc->bus, scsihostsrc->target,
scsihostsrc->unit, dom_name);
return;
* because qemuProcessStart could fail half way through. */
if (!(tmp = virSCSIDeviceListFind(hostdev_mgr->activeSCSIHostdevs, scsi))) {
- VIR_WARN("Unable to find device %s:%u:%u:%u "
+ VIR_WARN("Unable to find device %s:%u:%u:%llu "
"in list of active SCSI devices",
scsihostsrc->adapter, scsihostsrc->bus,
scsihostsrc->target, scsihostsrc->unit);
return;
}
- VIR_DEBUG("Removing %s:%u:%u:%u dom=%s from activeSCSIHostdevs",
+ VIR_DEBUG("Removing %s:%u:%u:%llu dom=%s from activeSCSIHostdevs",
scsihostsrc->adapter, scsihostsrc->bus, scsihostsrc->target,
scsihostsrc->unit, dom_name);
unsigned int adapter;
unsigned int bus;
unsigned int target;
- unsigned int unit;
+ unsigned long long unit;
char *name; /* adapter:bus:target:unit */
char *id; /* model:vendor */
const char *adapter,
unsigned int bus,
unsigned int target,
- unsigned int unit)
+ unsigned long long unit)
{
DIR *dir = NULL;
struct dirent *entry;
return NULL;
if (virAsprintf(&path,
- "%s/%d:%u:%u:%u/scsi_generic",
+ "%s/%d:%u:%u:%llu/scsi_generic",
prefix, adapter_id, bus, target, unit) < 0)
return NULL;
const char *adapter,
unsigned int bus,
unsigned int target,
- unsigned int unit)
+ unsigned long long unit)
{
DIR *dir = NULL;
struct dirent *entry;
return NULL;
if (virAsprintf(&path,
- "%s/%d:%u:%u:%u/block",
+ "%s/%d:%u:%u:%llu/block",
prefix, adapter_id, bus, target, unit) < 0)
return NULL;
const char *adapter,
unsigned int bus,
unsigned int target,
- unsigned int unit,
+ unsigned long long unit,
bool readonly,
bool shareable)
{
if (virSCSIDeviceGetAdapterId(adapter, &dev->adapter) < 0)
goto cleanup;
- if (virAsprintf(&dev->name, "%d:%u:%u:%u", dev->adapter,
+ if (virAsprintf(&dev->name, "%d:%u:%u:%llu", dev->adapter,
dev->bus, dev->target, dev->unit) < 0 ||
virAsprintf(&dev->sg_path, "%s/%s",
sysfs_prefix ? sysfs_prefix : "/dev", sg) < 0)
return dev->target;
}
-unsigned int
+unsigned long long
virSCSIDeviceGetUnit(virSCSIDevicePtr dev)
{
return dev->unit;
const char *adapter,
unsigned int bus,
unsigned int target,
- unsigned int unit);
+ unsigned long long unit);
char *virSCSIDeviceGetDevName(const char *sysfs_prefix,
const char *adapter,
unsigned int bus,
unsigned int target,
- unsigned int unit);
+ unsigned long long unit);
virSCSIDevicePtr virSCSIDeviceNew(const char *sysfs_prefix,
const char *adapter,
unsigned int bus,
unsigned int target,
- unsigned int unit,
+ unsigned long long unit,
bool readonly,
bool shareable);
unsigned int virSCSIDeviceGetAdapter(virSCSIDevicePtr dev);
unsigned int virSCSIDeviceGetBus(virSCSIDevicePtr dev);
unsigned int virSCSIDeviceGetTarget(virSCSIDevicePtr dev);
-unsigned int virSCSIDeviceGetUnit(virSCSIDevicePtr dev);
+unsigned long long virSCSIDeviceGetUnit(virSCSIDevicePtr dev);
bool virSCSIDeviceGetReadonly(virSCSIDevicePtr dev);
bool virSCSIDeviceGetShareable(virSCSIDevicePtr dev);
const char *adapter ATTRIBUTE_UNUSED,
unsigned int bus ATTRIBUTE_UNUSED,
unsigned int target ATTRIBUTE_UNUSED,
- unsigned int unit ATTRIBUTE_UNUSED)
+ unsigned long long unit ATTRIBUTE_UNUSED)
{
char *sg = NULL;
struct SCSIAddress {
unsigned int controller;
unsigned int bus;
- unsigned int unit;
+ unsigned long long unit;
};
struct IDEAddress {
return -1;
unit++;
- if (virStrToLong_uip(unit, NULL, 0, &scsiAddr->unit) != 0)
+ if (virStrToLong_ullp(unit, NULL, 0, &scsiAddr->unit) != 0)
return -1;
return 0;
if (diskAddr.type == DISK_ADDR_TYPE_SCSI) {
virBufferAsprintf(&buf,
"<address type='drive' controller='%u'"
- " bus='%u' unit='%u' />\n",
+ " bus='%u' unit='%llu' />\n",
diskAddr.addr.scsi.controller, diskAddr.addr.scsi.bus,
diskAddr.addr.scsi.unit);
} else {