mirror of
				https://git.proxmox.com/git/qemu-server
				synced 2025-11-04 11:28:38 +00:00 
			
		
		
		
	config2command test: mock kernel_has_vhost_net
just return true for now, the use is guarded by an 'is_native($arch)' check anyway. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
		
							parent
							
								
									e1bdc0debc
								
							
						
					
					
						commit
						db70021bcf
					
				@ -1387,7 +1387,9 @@ sub kvm_user_version {
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
my $kernel_has_vhost_net = -c '/dev/vhost-net';
 | 
			
		||||
sub kernel_has_vhost_net {
 | 
			
		||||
    return -c '/dev/vhost-net';
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
sub valid_drive_names {
 | 
			
		||||
    # order is important - used to autoselect boot disk
 | 
			
		||||
@ -1973,7 +1975,7 @@ sub print_netdev_full {
 | 
			
		||||
 | 
			
		||||
    my $vhostparam = '';
 | 
			
		||||
    if (is_native($arch)) {
 | 
			
		||||
	$vhostparam = ',vhost=on' if $kernel_has_vhost_net && $net->{model} eq 'virtio';
 | 
			
		||||
	$vhostparam = ',vhost=on' if kernel_has_vhost_net() && $net->{model} eq 'virtio';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    my $vmname = $conf->{name} || "vm$vmid";
 | 
			
		||||
 | 
			
		||||
@ -110,6 +110,9 @@ $qemu_server_module->mock(
 | 
			
		||||
    kvm_version => sub {
 | 
			
		||||
	return $current_test->{qemu_version} // $base_env->{real_qemu_version};
 | 
			
		||||
    },
 | 
			
		||||
    kernel_has_vhost_net => sub {
 | 
			
		||||
	return 1; # TODO: make this per-test configurable?
 | 
			
		||||
    },
 | 
			
		||||
    get_host_arch => sub() {
 | 
			
		||||
	return $current_test->{host_arch} // 'x86_64';
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user