#include "hw/qdev-properties.h"
#include "sysemu/block-backend.h"
#include "qapi/error.h"
+#include "qemu/error-report.h"
#include "qemu/bitops.h"
#include "qemu/error-report.h"
#include "qemu/host-utils.h"
int size)
{
int offset_end;
+ int ret;
if (pfl->blk) {
offset_end = offset + size;
/* widen to sector boundaries */
offset = QEMU_ALIGN_DOWN(offset, BDRV_SECTOR_SIZE);
offset_end = QEMU_ALIGN_UP(offset_end, BDRV_SECTOR_SIZE);
- blk_pwrite(pfl->blk, offset, pfl->storage + offset,
+ ret = blk_pwrite(pfl->blk, offset, pfl->storage + offset,
offset_end - offset, 0);
+ if (ret < 0) {
+ /* TODO set error bit in status */
+ error_report("Could not update PFLASH: %s", strerror(-ret));
+ }
}
}
#include "hw/block/flash.h"
#include "hw/qdev-properties.h"
#include "qapi/error.h"
+#include "qemu/error-report.h"
#include "qemu/bitmap.h"
#include "qemu/timer.h"
#include "sysemu/block-backend.h"
static void pflash_update(PFlashCFI02 *pfl, int offset, int size)
{
int offset_end;
+ int ret;
if (pfl->blk) {
offset_end = offset + size;
/* widen to sector boundaries */
offset = QEMU_ALIGN_DOWN(offset, BDRV_SECTOR_SIZE);
offset_end = QEMU_ALIGN_UP(offset_end, BDRV_SECTOR_SIZE);
- blk_pwrite(pfl->blk, offset, pfl->storage + offset,
+ ret = blk_pwrite(pfl->blk, offset, pfl->storage + offset,
offset_end - offset, 0);
+ if (ret < 0) {
+ /* TODO set error bit in status */
+ error_report("Could not update PFLASH: %s", strerror(-ret));
+ }
}
}