summaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
authorGonglei <arei.gonglei@huawei.com>2014-09-19 14:48:30 +0800
committerGerd Hoffmann <kraxel@redhat.com>2014-09-23 12:51:07 +0200
commitf5dc59787849d135c5e24752379b5e487b6523cc (patch)
treec1f9ce5afbdead663bd162624ad7017c4e3d5cb3 /hw
parent5a882e40d57e791316ac88127f0576a1d518c2f9 (diff)
downloadhqemu-f5dc59787849d135c5e24752379b5e487b6523cc.zip
hqemu-f5dc59787849d135c5e24752379b5e487b6523cc.tar.gz
dev-storage: usring error_report instead of fprintf/printf
Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/usb/dev-storage.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c
index d97f7fd..bd7cc53 100644
--- a/hw/usb/dev-storage.c
+++ b/hw/usb/dev-storage.c
@@ -409,19 +409,19 @@ static void usb_msd_handle_data(USBDevice *dev, USBPacket *p)
switch (s->mode) {
case USB_MSDM_CBW:
if (p->iov.size != 31) {
- fprintf(stderr, "usb-msd: Bad CBW size");
+ error_report("usb-msd: Bad CBW size");
goto fail;
}
usb_packet_copy(p, &cbw, 31);
if (le32_to_cpu(cbw.sig) != 0x43425355) {
- fprintf(stderr, "usb-msd: Bad signature %08x\n",
- le32_to_cpu(cbw.sig));
+ error_report("usb-msd: Bad signature %08x",
+ le32_to_cpu(cbw.sig));
goto fail;
}
DPRINTF("Command on LUN %d\n", cbw.lun);
scsi_dev = scsi_device_find(&s->bus, 0, 0, cbw.lun);
if (scsi_dev == NULL) {
- fprintf(stderr, "usb-msd: Bad LUN %d\n", cbw.lun);
+ error_report("usb-msd: Bad LUN %d", cbw.lun);
goto fail;
}
tag = le32_to_cpu(cbw.tag);
@@ -682,13 +682,13 @@ static USBDevice *usb_msd_init(USBBus *bus, const char *filename)
pstrcpy(fmt, len, p2);
qemu_opt_set(opts, "format", fmt);
} else if (*filename != ':') {
- printf("unrecognized USB mass-storage option %s\n", filename);
+ error_report("unrecognized USB mass-storage option %s", filename);
return NULL;
}
filename = p1;
}
if (!*filename) {
- printf("block device specification needed\n");
+ error_report("block device specification needed");
return NULL;
}
qemu_opt_set(opts, "file", filename);
OpenPOWER on IntegriCloud