[PATCH] ide:do nothing for identify cmd if no any device attached

zhaoxin\RockCuioc posted 1 patch 5 years, 1 month ago
Test docker-quick@centos7 failed
Test docker-mingw@fedora passed
Test checkpatch failed
Test FreeBSD passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200814043657.5815-1-RockCui-oc@zhaoxin.com
Maintainers: John Snow <jsnow@redhat.com>
There is a newer version of this series
hw/ide/core.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
[PATCH] ide:do nothing for identify cmd if no any device attached
Posted by zhaoxin\RockCuioc 5 years, 1 month ago
From: "zhaoxin\\rockcuioc" <RockCui-oc@zhaoxin.com>

This patch is for avoiding win7 IDE driver polling 0x1f7 when
no any device attached. During Win7 VM boot procedure, if use virtio for
disk and there is no any device be attached on hda & hdb, the win7 IDE driver
would poll 0x1f7 for a while. This action may be stop windows LOGO atomic for
a while too on a poor performance CPU.

Signed-off-by: zhaoxin\RockCuioc <RockCui-oc@zhaoxin.com>
---
 hw/ide/core.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/hw/ide/core.c b/hw/ide/core.c
index d997a78e47..07968aadfd 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -2073,8 +2073,9 @@ void ide_exec_cmd(IDEBus *bus, uint32_t val)
     s = idebus_active_if(bus);
     trace_ide_exec_cmd(bus, s, val);
 
-    /* ignore commands to non existent slave */
-    if (s != bus->ifs && !s->blk) {
+    /* ignore commands if no any device exist or non existent slave */
+    if ((!bus->ifs[0].blk && !bus->ifs[1].blk) || 
+	(s != bus->ifs && !s->blk)) {
         return;
     }
 
-- 
2.17.1


Re: [PATCH] ide:do nothing for identify cmd if no any device attached
Posted by no-reply@patchew.org 5 years, 1 month ago
Patchew URL: https://patchew.org/QEMU/20200814043657.5815-1-RockCui-oc@zhaoxin.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20200814043657.5815-1-RockCui-oc@zhaoxin.com
Subject: [PATCH] ide:do nothing for identify cmd if no any device attached

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
c0ee2f5 ide:do nothing for identify cmd if no any device attached

=== OUTPUT BEGIN ===
ERROR: trailing whitespace
#27: FILE: hw/ide/core.c:2077:
+    if ((!bus->ifs[0].blk && !bus->ifs[1].blk) || $

ERROR: code indent should never use tabs
#28: FILE: hw/ide/core.c:2078:
+^I(s != bus->ifs && !s->blk)) {$

total: 2 errors, 0 warnings, 11 lines checked

Commit c0ee2f5abbf3 (ide:do nothing for identify cmd if no any device attached) has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20200814043657.5815-1-RockCui-oc@zhaoxin.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
Re: [PATCH] ide:do nothing for identify cmd if no any device attached
Posted by no-reply@patchew.org 5 years, 1 month ago
Patchew URL: https://patchew.org/QEMU/20200814043657.5815-1-RockCui-oc@zhaoxin.com/



Hi,

This series failed the docker-quick@centos7 build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
make docker-image-centos7 V=1 NETWORK=1
time make docker-test-quick@centos7 SHOW_ENV=1 J=14 NETWORK=1
=== TEST SCRIPT END ===

  TEST    check-unit: tests/test-char
Unexpected error in object_property_try_add() at /tmp/qemu-test/src/qom/object.c:1181:
attempt to add duplicate property 'serial-id' to object (type 'container')
ERROR test-char - too few tests run (expected 38, got 9)
make: *** [check-unit] Error 1
make: *** Waiting for unfinished jobs....
  TEST    iotest-qcow2: 024
  TEST    iotest-qcow2: 025
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=3d9b744ea9784590902f0fd1b1c1cc94', '-u', '1003', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=1', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-uf3g3t43/src/docker-src.2020-08-14-11.29.38.3773:/var/tmp/qemu:z,ro', 'qemu/centos7', '/var/tmp/qemu/run', 'test-quick']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=3d9b744ea9784590902f0fd1b1c1cc94
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-uf3g3t43/src'
make: *** [docker-run-test-quick@centos7] Error 2

real    13m29.699s
user    0m8.487s


The full log is available at
http://patchew.org/logs/20200814043657.5815-1-RockCui-oc@zhaoxin.com/testing.docker-quick@centos7/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com