mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 17:23:56 -06:00
Merge remote-tracking branch 'kwolf/for-anthony' into staging
* kwolf/for-anthony: block: Don't forget to delete temporary file Don't require encryption password for 'qemu-img info' command qemu-img: Add json output option to the info command. qapi: Add SnapshotInfo and ImageInfo. ahci: properly reset PxCMD on HBA reset block: fix block tray status vdi: Fix warning from clang block/curl: Fix wrong free statement ide: Fix error messages from static code analysis (no real error) ATAPI: STARTSTOPUNIT only eject/load media if powercondition is 0 sheepdog: fix savevm and loadvm
This commit is contained in:
commit
109820df4a
12 changed files with 305 additions and 88 deletions
|
@ -1175,7 +1175,6 @@ void ahci_init(AHCIState *s, DeviceState *qdev, DMAContext *dma, int ports)
|
|||
ad->port_no = i;
|
||||
ad->port.dma = &ad->dma;
|
||||
ad->port.dma->ops = &ahci_dma_ops;
|
||||
ad->port_regs.cmd = PORT_CMD_SPIN_UP | PORT_CMD_POWER_ON;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1199,6 +1198,7 @@ void ahci_reset(AHCIState *s)
|
|||
pr->irq_stat = 0;
|
||||
pr->irq_mask = 0;
|
||||
pr->scr_ctl = 0;
|
||||
pr->cmd = PORT_CMD_SPIN_UP | PORT_CMD_POWER_ON;
|
||||
ahci_reset_port(s, i);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -875,6 +875,12 @@ static void cmd_start_stop_unit(IDEState *s, uint8_t* buf)
|
|||
int sense;
|
||||
bool start = buf[4] & 1;
|
||||
bool loej = buf[4] & 2; /* load on start, eject on !start */
|
||||
int pwrcnd = buf[4] & 0xf0;
|
||||
|
||||
if (pwrcnd) {
|
||||
/* eject/load only happens for power condition == 0 */
|
||||
return;
|
||||
}
|
||||
|
||||
if (loej) {
|
||||
if (!start && !s->tray_open && s->tray_locked) {
|
||||
|
|
|
@ -53,8 +53,6 @@ static const int smart_attributes[][12] = {
|
|||
{ 0x0c, 0x03, 0x00, 0x64, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
|
||||
/* airflow-temperature-celsius */
|
||||
{ 190, 0x03, 0x00, 0x45, 0x45, 0x1f, 0x00, 0x1f, 0x1f, 0x00, 0x00, 0x32},
|
||||
/* end of list */
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
|
||||
};
|
||||
|
||||
static int ide_handle_rw_error(IDEState *s, int error, int op);
|
||||
|
@ -1468,9 +1466,7 @@ void ide_exec_cmd(IDEBus *bus, uint32_t val)
|
|||
case SMART_READ_THRESH:
|
||||
memset(s->io_buffer, 0, 0x200);
|
||||
s->io_buffer[0] = 0x01; /* smart struct version */
|
||||
for (n=0; n<30; n++) {
|
||||
if (smart_attributes[n][0] == 0)
|
||||
break;
|
||||
for (n = 0; n < ARRAY_SIZE(smart_attributes); n++) {
|
||||
s->io_buffer[2+0+(n*12)] = smart_attributes[n][0];
|
||||
s->io_buffer[2+1+(n*12)] = smart_attributes[n][11];
|
||||
}
|
||||
|
@ -1484,10 +1480,7 @@ void ide_exec_cmd(IDEBus *bus, uint32_t val)
|
|||
case SMART_READ_DATA:
|
||||
memset(s->io_buffer, 0, 0x200);
|
||||
s->io_buffer[0] = 0x01; /* smart struct version */
|
||||
for (n=0; n<30; n++) {
|
||||
if (smart_attributes[n][0] == 0) {
|
||||
break;
|
||||
}
|
||||
for (n = 0; n < ARRAY_SIZE(smart_attributes); n++) {
|
||||
int i;
|
||||
for(i = 0; i < 11; i++) {
|
||||
s->io_buffer[2+i+(n*12)] = smart_attributes[n][i];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue