block: Don't acquire AioContext in hmp_qemu_io()
Commit 15afd94a047 added code to acquire and release the AioContext in qemuio_command(). This means that the lock is taken twice now in the call path from hmp_qemu_io(). This causes BDRV_POLL_WHILE() to hang for any requests issued to nodes in a non-mainloop AioContext. Dropping the first locking from hmp_qemu_io() fixes the problem. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
		
							parent
							
								
									60369b86c4
								
							
						
					
					
						commit
						c200c4a470
					
				
							
								
								
									
										6
									
								
								hmp.c
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								hmp.c
									
									
									
									
									
								
							@ -2318,7 +2318,6 @@ void hmp_qemu_io(Monitor *mon, const QDict *qdict)
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
    BlockBackend *blk;
 | 
					    BlockBackend *blk;
 | 
				
			||||||
    BlockBackend *local_blk = NULL;
 | 
					    BlockBackend *local_blk = NULL;
 | 
				
			||||||
    AioContext *aio_context;
 | 
					 | 
				
			||||||
    const char* device = qdict_get_str(qdict, "device");
 | 
					    const char* device = qdict_get_str(qdict, "device");
 | 
				
			||||||
    const char* command = qdict_get_str(qdict, "command");
 | 
					    const char* command = qdict_get_str(qdict, "command");
 | 
				
			||||||
    Error *err = NULL;
 | 
					    Error *err = NULL;
 | 
				
			||||||
@ -2338,9 +2337,6 @@ void hmp_qemu_io(Monitor *mon, const QDict *qdict)
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    aio_context = blk_get_aio_context(blk);
 | 
					 | 
				
			||||||
    aio_context_acquire(aio_context);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    /*
 | 
					    /*
 | 
				
			||||||
     * Notably absent: Proper permission management. This is sad, but it seems
 | 
					     * Notably absent: Proper permission management. This is sad, but it seems
 | 
				
			||||||
     * almost impossible to achieve without changing the semantics and thereby
 | 
					     * almost impossible to achieve without changing the semantics and thereby
 | 
				
			||||||
@ -2368,8 +2364,6 @@ void hmp_qemu_io(Monitor *mon, const QDict *qdict)
 | 
				
			|||||||
     */
 | 
					     */
 | 
				
			||||||
    qemuio_command(blk, command);
 | 
					    qemuio_command(blk, command);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    aio_context_release(aio_context);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
fail:
 | 
					fail:
 | 
				
			||||||
    blk_unref(local_blk);
 | 
					    blk_unref(local_blk);
 | 
				
			||||||
    hmp_handle_error(mon, &err);
 | 
					    hmp_handle_error(mon, &err);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user