mirror of https://gitee.com/openkylin/libvirt.git
avoid more format-related warnings
* src/qemu/qemu_conf.c (qemuBuildDriveStr): Use "%s". * src/qemu/qemu_monitor_json.c (qemuMonitorJSONGetGuestPCIAddress): (qemuMonitorJSONGetGuestDriveAddress): Likewise.
This commit is contained in:
parent
dfff67c082
commit
d47b6e54fd
|
@ -1896,7 +1896,7 @@ qemuBuildDriveStr(virDomainDiskDefPtr disk,
|
||||||
* to have > 1 bus on a SCSI controller (yet). */
|
* to have > 1 bus on a SCSI controller (yet). */
|
||||||
if (disk->info.addr.drive.bus != 0) {
|
if (disk->info.addr.drive.bus != 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
||||||
_("SCSI controller only supports 1 bus"));
|
"%s", _("SCSI controller only supports 1 bus"));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
busid = disk->info.addr.drive.controller;
|
busid = disk->info.addr.drive.controller;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* qemu_monitor_json.c: interaction with QEMU monitor console
|
* qemu_monitor_json.c: interaction with QEMU monitor console
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2009 Red Hat, Inc.
|
* Copyright (C) 2006-2010 Red Hat, Inc.
|
||||||
* Copyright (C) 2006 Daniel P. Berrange
|
* Copyright (C) 2006 Daniel P. Berrange
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
|
@ -1235,7 +1235,7 @@ qemuMonitorJSONGetGuestPCIAddress(virJSONValuePtr reply,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virJSONValueObjectGetNumberUint(addr, "function", &guestAddr->function) < 0) {
|
if (virJSONValueObjectGetNumberUint(addr, "function", &guestAddr->function) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("pci_add reply was missing device function number"));
|
_("pci_add reply was missing device function number"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -1531,19 +1531,19 @@ qemuMonitorJSONGetGuestDriveAddress(virJSONValuePtr reply,
|
||||||
|
|
||||||
addr = virJSONValueObjectGet(reply, "return");
|
addr = virJSONValueObjectGet(reply, "return");
|
||||||
if (!addr || addr->type != VIR_JSON_TYPE_OBJECT) {
|
if (!addr || addr->type != VIR_JSON_TYPE_OBJECT) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("drive_add reply was missing device address"));
|
_("drive_add reply was missing device address"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virJSONValueObjectGetNumberUint(addr, "bus", &driveAddr->bus) < 0) {
|
if (virJSONValueObjectGetNumberUint(addr, "bus", &driveAddr->bus) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("drive_add reply was missing device bus number"));
|
_("drive_add reply was missing device bus number"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virJSONValueObjectGetNumberUint(addr, "unit", &driveAddr->unit) < 0) {
|
if (virJSONValueObjectGetNumberUint(addr, "unit", &driveAddr->unit) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("drive_add reply was missing device unit number"));
|
_("drive_add reply was missing device unit number"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue