diff --git a/hw/remote/memory.c b/hw/remote/memory.c index 472ed2a272..6e21ab1a45 100644 --- a/hw/remote/memory.c +++ b/hw/remote/memory.c @@ -46,7 +46,7 @@ void remote_sysmem_reconfig(MPQemuMsg *msg, Error **errp) subregion = g_new(MemoryRegion, 1); memory_region_init_ram_from_fd(subregion, NULL, name, sysmem_info->sizes[region], - true, msg->fds[region], + RAM_SHARED, msg->fds[region], sysmem_info->offsets[region], errp); diff --git a/tests/acceptance/virtio-gpu.py b/tests/acceptance/virtio-gpu.py index 589332c1b7..4acc1e6d5f 100644 --- a/tests/acceptance/virtio-gpu.py +++ b/tests/acceptance/virtio-gpu.py @@ -17,10 +17,6 @@ import socket import subprocess -ACCEL_NOT_AVAILABLE_FMT = "%s accelerator does not seem to be available" -KVM_NOT_AVAILABLE = ACCEL_NOT_AVAILABLE_FMT % "KVM" - - def pick_default_vug_bin(): relative_path = "./contrib/vhost-user-gpu/vhost-user-gpu" if is_readable_executable_file(relative_path): @@ -34,19 +30,23 @@ def pick_default_vug_bin(): class VirtioGPUx86(Test): """ :avocado: tags=virtio-gpu + :avocado: tags=arch:x86_64 + :avocado: tags=cpu:host """ - KERNEL_COMMON_COMMAND_LINE = "printk.time=0 " + KERNEL_COMMAND_LINE = "printk.time=0 console=ttyS0 rdinit=/bin/bash" KERNEL_URL = ( "https://archives.fedoraproject.org/pub/fedora" "/linux/releases/33/Everything/x86_64/os/images" "/pxeboot/vmlinuz" ) + KERNEL_HASH = '1433cfe3f2ffaa44de4ecfb57ec25dc2399cdecf' INITRD_URL = ( "https://archives.fedoraproject.org/pub/fedora" "/linux/releases/33/Everything/x86_64/os/images" "/pxeboot/initrd.img" ) + INITRD_HASH = 'c828d68a027b53e5220536585efe03412332c2d9' def wait_for_console_pattern(self, success_message, vm=None): wait_for_console_pattern( @@ -58,24 +58,18 @@ class VirtioGPUx86(Test): def test_virtio_vga_virgl(self): """ - :avocado: tags=arch:x86_64 - :avocado: tags=device:virtio-vga - :avocado: tags=cpu:host + :avocado: tags=device:virtio-vga-gl """ - kernel_command_line = ( - self.KERNEL_COMMON_COMMAND_LINE + "console=ttyS0 rdinit=/bin/bash" - ) # FIXME: should check presence of virtio, virgl etc - if not kvm_available(self.arch, self.qemu_bin): - self.cancel(KVM_NOT_AVAILABLE) + self.require_accelerator('kvm') - kernel_path = self.fetch_asset(self.KERNEL_URL) - initrd_path = self.fetch_asset(self.INITRD_URL) + kernel_path = self.fetch_asset(self.KERNEL_URL, self.KERNEL_HASH) + initrd_path = self.fetch_asset(self.INITRD_URL, self.INITRD_HASH) self.vm.set_console() self.vm.add_args("-m", "2G") self.vm.add_args("-machine", "pc,accel=kvm") - self.vm.add_args("-device", "virtio-vga,virgl=on") + self.vm.add_args("-device", "virtio-vga-gl") self.vm.add_args("-display", "egl-headless") self.vm.add_args( "-kernel", @@ -83,7 +77,7 @@ class VirtioGPUx86(Test): "-initrd", initrd_path, "-append", - kernel_command_line, + self.KERNEL_COMMAND_LINE, ) try: self.vm.launch() @@ -99,23 +93,17 @@ class VirtioGPUx86(Test): def test_vhost_user_vga_virgl(self): """ - :avocado: tags=arch:x86_64 :avocado: tags=device:vhost-user-vga - :avocado: tags=cpu:host """ - kernel_command_line = ( - self.KERNEL_COMMON_COMMAND_LINE + "console=ttyS0 rdinit=/bin/bash" - ) # FIXME: should check presence of vhost-user-gpu, virgl, memfd etc - if not kvm_available(self.arch, self.qemu_bin): - self.cancel(KVM_NOT_AVAILABLE) + self.require_accelerator('kvm') vug = pick_default_vug_bin() if not vug: self.cancel("Could not find vhost-user-gpu") - kernel_path = self.fetch_asset(self.KERNEL_URL) - initrd_path = self.fetch_asset(self.INITRD_URL) + kernel_path = self.fetch_asset(self.KERNEL_URL, self.KERNEL_HASH) + initrd_path = self.fetch_asset(self.INITRD_URL, self.INITRD_HASH) # Create socketpair to connect proxy and remote processes qemu_sock, vug_sock = socket.socketpair( @@ -153,7 +141,7 @@ class VirtioGPUx86(Test): "-initrd", initrd_path, "-append", - kernel_command_line, + self.KERNEL_COMMAND_LINE, ) self.vm.launch() self.wait_for_console_pattern("as init process")