#ifdef DEBUG_TPM
fprintf(logfile," read(%08x) = %08x\n",
- addr,
+ (int)addr,
val);
#endif
#ifdef DEBUG_TPM
fprintf(logfile,"write(%08x) = %08x\n",
- addr,
+ (int)addr,
val);
#endif
static void tpm_save(QEMUFile* f,void* opaque)
{
tpmState* s=(tpmState*)opaque;
+ uint8_t locty = s->active_loc;
int c;
/* need to wait for outstanding requests to complete */
- if (IS_COMM_WITH_VTPM(s)) {
+ if (s->loc[locty].state == STATE_EXECUTION) {
int repeats = 30; /* 30 seconds; really should be infty */
while (repeats > 0 &&
!(s->loc[s->active_loc].sts & STS_DATA_AVAILABLE)) {
}
}
+ if (IS_COMM_WITH_VTPM(s)) {
+ close_vtpm_channel(s, 1);
+ }
+
qemu_put_be32s(f,&s->offset);
qemu_put_buffer(f, s->buffer.buf, TPM_MAX_PKT);
qemu_put_8s(f, &s->active_loc);
uint32_t size = tpm_get_size_from_buffer(buffer->buf);
if (size + sizeof(buffer->instance) != off) {
fprintf(logfile,"TPM: Packet size is bad! %d != %d\n",
- size + sizeof(buffer->instance),
+ (int)(size + sizeof(buffer->instance)),
off);
} else {
uint32_t ret;