upstream: integrate block changes
This large patch upgrades the block support code to the upstream
version available in ba5e7f82169f32ab8163c707d97c799ca09f8924
dated 2010-08-08
Change-Id: I8b24df0c287e72f6620650a4d6a62e1bb315453e
diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c
index a0485db..3d3946a 100644
--- a/hw/scsi-disk.c
+++ b/hw/scsi-disk.c
@@ -15,6 +15,7 @@
#include <qemu-common.h>
#include <sysemu.h>
+#include "blockdev.h"
//#define DEBUG_SCSI
#ifdef DEBUG_SCSI
@@ -219,7 +220,7 @@
static int scsi_handle_write_error(SCSIRequest *r, int error)
{
- BlockInterfaceErrorAction action = drive_get_onerror(r->dev->bdrv);
+ BlockErrorAction action = bdrv_get_on_error(r->dev->bdrv, 0);
if (action == BLOCK_ERR_IGNORE)
return 0;
@@ -318,7 +319,7 @@
while (r) {
if (r->status & SCSI_REQ_STATUS_RETRY) {
r->status &= ~SCSI_REQ_STATUS_RETRY;
- scsi_write_request(r);
+ scsi_write_request(r);
}
r = r->next;
}
@@ -948,9 +949,11 @@
if (nb_sectors)
nb_sectors--;
s->max_lba = nb_sectors;
+#if 0
strncpy(s->drive_serial_str, drive_get_serial(s->bdrv),
sizeof(s->drive_serial_str));
if (strlen(s->drive_serial_str) == 0)
+#endif
pstrcpy(s->drive_serial_str, sizeof(s->drive_serial_str), "0");
qemu_add_vm_change_state_handler(scsi_dma_restart_cb, s);
d = (SCSIDevice *)qemu_mallocz(sizeof(SCSIDevice));