Block layer patches:

- iotests: Fix pylint/mypy warnings with Python 3.9
 - qmp: fix aio_poll() assertion failure on Windows
 - Some minor fixes
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCAAvFiEE3D3rFZqa+V09dFb+fwmycsiPL9YFAl+hdk0RHGt3b2xmQHJl
 ZGhhdC5jb20ACgkQfwmycsiPL9agjQ/6AkTuHF9qZzJFndTY5zm99Hgci0aHB1aj
 P9W/lmC8ch7tWJQSwpdjkGLgdiTnkWPauWe1ogzr+3F+8X5qbTc5Z96HKXu1dhiR
 ZunzW4hazESQ9DrG+7WW48GANTE6goX9T4ykqhH8p97HY6oBBFaNPhhPfN4y3zIA
 sYZJMB3HbdgHidJ6urNsn+y4rG2rVl+63vcVp+l7P3x7B/o0Toa2W3ZFXNnOtPJr
 HR9xVqx3xUp5TcXnftWnmEGVTmLrU+LSZB3dqW2agJdOiuyEXEGkYD9/qgJ3GNch
 TNPln4zYmk+3H/JXwv5CMPQW1f+t+cAcWOuFt5QIwjQz6y+qopvN0S5Q+j9cN4/B
 JpzWqlyl8aBSO+IHJ3d9VZBFdnLTQ/fvLeMSZk7sHdzMubFw3EjNJK2ufj3bGf3E
 ThAbFxyS/1zIv+SN7GsWEWCgScMxrbgoT0WjMG7qL5tf7Cr9odWc3ItdQC/HCWtM
 urM+QGm7kqCfjnc6yf1r0Ijmdw7ngxED2SQ1casaMoFwcwtkME0vx1vkTDUWuOhP
 RuiX2JQprEJIFOR59R+UpVdGze/Ih9CUS5OUjNYXc3DZbhiIgYBn8cyq0xn+fy4r
 rF2ayaZtw9Z4nSv/p0jG0bNDfRus32xQfDxl/XbhoUOatnnBq+Ubq3Sk9kqFtV+p
 4peJbiKGDj4=
 =RwlB
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging

Block layer patches:

- iotests: Fix pylint/mypy warnings with Python 3.9
- qmp: fix aio_poll() assertion failure on Windows
- Some minor fixes

# gpg: Signature made Tue 03 Nov 2020 15:25:01 GMT
# gpg:                using RSA key DC3DEB159A9AF95D3D7456FE7F09B272C88F2FD6
# gpg:                issuer "kwolf@redhat.com"
# gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" [full]
# Primary key fingerprint: DC3D EB15 9A9A F95D 3D74  56FE 7F09 B272 C88F 2FD6

* remotes/kevin/tags/for-upstream:
  block/vvfat: Fix bad printf format specifiers
  iotests: Use Python 3 style super()
  iotests: Disable unsubscriptable-object in pylint
  iotests.py: Fix type check errors in wait_migration()
  qemu-img convert: Free @sn_opts in all error cases
  qmp: fix aio_poll() assertion failure on Windows

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
master
Peter Maydell 2020-11-03 15:59:44 +00:00
commit 8507c9d5c9
5 changed files with 25 additions and 11 deletions

View File

@ -1437,7 +1437,7 @@ static void print_direntry(const direntry_t* direntry)
for(i=0;i<11;i++)
ADD_CHAR(direntry->name[i]);
buffer[j] = 0;
fprintf(stderr,"%s attributes=0x%02x begin=%d size=%d\n",
fprintf(stderr, "%s attributes=0x%02x begin=%u size=%u\n",
buffer,
direntry->attributes,
begin_of_direntry(direntry),le32_to_cpu(direntry->size));
@ -1446,7 +1446,7 @@ static void print_direntry(const direntry_t* direntry)
static void print_mapping(const mapping_t* mapping)
{
fprintf(stderr, "mapping (%p): begin, end = %d, %d, dir_index = %d, "
fprintf(stderr, "mapping (%p): begin, end = %u, %u, dir_index = %u, "
"first_mapping_index = %d, name = %s, mode = 0x%x, " ,
mapping, mapping->begin, mapping->end, mapping->dir_index,
mapping->first_mapping_index, mapping->path, mapping->mode);
@ -1454,7 +1454,7 @@ static void print_mapping(const mapping_t* mapping)
if (mapping->mode & MODE_DIRECTORY)
fprintf(stderr, "parent_mapping_index = %d, first_dir_index = %d\n", mapping->info.dir.parent_mapping_index, mapping->info.dir.first_dir_index);
else
fprintf(stderr, "offset = %d\n", mapping->info.file.offset);
fprintf(stderr, "offset = %u\n", mapping->info.file.offset);
}
#endif
@ -1588,7 +1588,7 @@ typedef struct commit_t {
static void clear_commits(BDRVVVFATState* s)
{
int i;
DLOG(fprintf(stderr, "clear_commits (%d commits)\n", s->commits.next));
DLOG(fprintf(stderr, "clear_commits (%u commits)\n", s->commits.next));
for (i = 0; i < s->commits.next; i++) {
commit_t* commit = array_get(&(s->commits), i);
assert(commit->path || commit->action == ACTION_WRITEOUT);
@ -2648,7 +2648,9 @@ static int handle_renames_and_mkdirs(BDRVVVFATState* s)
fprintf(stderr, "handle_renames\n");
for (i = 0; i < s->commits.next; i++) {
commit_t* commit = array_get(&(s->commits), i);
fprintf(stderr, "%d, %s (%d, %d)\n", i, commit->path ? commit->path : "(null)", commit->param.rename.cluster, commit->action);
fprintf(stderr, "%d, %s (%u, %d)\n", i,
commit->path ? commit->path : "(null)",
commit->param.rename.cluster, commit->action);
}
#endif

View File

@ -2751,7 +2751,6 @@ out:
qemu_progress_end();
qemu_opts_del(opts);
qemu_opts_free(create_opts);
qemu_opts_del(sn_opts);
qobject_unref(open_opts);
blk_unref(s.target);
if (s.src) {
@ -2763,6 +2762,7 @@ out:
g_free(s.src_sectors);
g_free(s.src_alignment);
fail_getopt:
qemu_opts_del(sn_opts);
g_free(options);
return !!ret;

View File

@ -543,10 +543,10 @@ class VM(qtest.QEMUQtestMachine):
def __init__(self, path_suffix=''):
name = "qemu%s-%d" % (path_suffix, os.getpid())
super(VM, self).__init__(qemu_prog, qemu_opts, name=name,
test_dir=test_dir,
socket_scm_helper=socket_scm_helper,
sock_dir=sock_dir)
super().__init__(qemu_prog, qemu_opts, name=name,
test_dir=test_dir,
socket_scm_helper=socket_scm_helper,
sock_dir=sock_dir)
self._num_drives = 0
def add_object(self, opts):
@ -747,6 +747,10 @@ class VM(qtest.QEMUQtestMachine):
def wait_migration(self, expect_runstate: Optional[str]) -> bool:
while True:
event = self.event_wait('MIGRATION')
# We use the default timeout, and with a timeout, event_wait()
# never returns None
assert event
log(event, filters=[filter_qmp_event])
if event['data']['status'] in ('completed', 'failed'):
break

View File

@ -17,6 +17,8 @@ disable=invalid-name,
too-many-lines,
too-many-locals,
too-many-public-methods,
# pylint warns about Optional[] etc. as unsubscriptable in 3.9
unsubscriptable-object,
# These are temporary, and should be removed:
missing-docstring,

View File

@ -18,6 +18,7 @@
#include "qemu/osdep.h"
#include "qemu-common.h"
#include "block/block.h"
#include "qemu/main-loop.h"
#include "qemu/queue.h"
#include "qemu/sockets.h"
#include "qapi/error.h"
@ -333,8 +334,13 @@ bool aio_poll(AioContext *ctx, bool blocking)
* There cannot be two concurrent aio_poll calls for the same AioContext (or
* an aio_poll concurrent with a GSource prepare/check/dispatch callback).
* We rely on this below to avoid slow locked accesses to ctx->notify_me.
*
* aio_poll() may only be called in the AioContext's thread. iohandler_ctx
* is special in that it runs in the main thread, but that thread's context
* is qemu_aio_context.
*/
assert(in_aio_context_home_thread(ctx));
assert(in_aio_context_home_thread(ctx == iohandler_get_aio_context() ?
qemu_get_aio_context() : ctx));
progress = false;
/* aio_notify can avoid the expensive event_notifier_set if