StringOutputVisitor crashes when it visits a struct because ->start_struct() is NULL. Show "<omitted>" instead of crashing. This is necessary because the virtio-blk-pci iothread-vq-mapping parameter that I'd like to introduce soon is a list of IOThreadMapping structs. This patch is a quick fix to solve the crash, but the long-term solution is replacing StringOutputVisitor with something that can handle the full gamut of values in QEMU. Cc: Markus Armbruster <armbru@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-ID: <20231212134934.500289-1-stefanha@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
		
			
				
	
	
		
			36 lines
		
	
	
		
			979 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			36 lines
		
	
	
		
			979 B
		
	
	
	
		
			C
		
	
	
	
	
	
/*
 | 
						|
 * String printing Visitor
 | 
						|
 *
 | 
						|
 * Copyright Red Hat, Inc. 2012
 | 
						|
 *
 | 
						|
 * Author: Paolo Bonzini <pbonzini@redhat.com>
 | 
						|
 *
 | 
						|
 * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
 | 
						|
 * See the COPYING.LIB file in the top-level directory.
 | 
						|
 *
 | 
						|
 */
 | 
						|
 | 
						|
#ifndef STRING_OUTPUT_VISITOR_H
 | 
						|
#define STRING_OUTPUT_VISITOR_H
 | 
						|
 | 
						|
#include "qapi/visitor.h"
 | 
						|
 | 
						|
typedef struct StringOutputVisitor StringOutputVisitor;
 | 
						|
 | 
						|
/*
 | 
						|
 * Create a new string output visitor.
 | 
						|
 *
 | 
						|
 * Using @human creates output that is a bit easier for humans to read
 | 
						|
 * (for example, showing integer values in both decimal and hex).
 | 
						|
 *
 | 
						|
 * If everything else succeeds, pass @result to visit_complete() to
 | 
						|
 * collect the result of the visit.
 | 
						|
 *
 | 
						|
 * The string output visitor does not implement support for alternates, null,
 | 
						|
 * or arbitrary QTypes.  Struct fields are not shown.  It also requires a
 | 
						|
 * non-null list argument to visit_start_list().
 | 
						|
 */
 | 
						|
Visitor *string_output_visitor_new(bool human, char **result);
 | 
						|
 | 
						|
#endif
 |