From 1907120f23ada097ccf00ba8ac040097c911e9e6 Mon Sep 17 00:00:00 2001 From: aszlig Date: Mon, 30 Apr 2018 00:21:36 +0200 Subject: [PATCH] nixos/tests/udisks2: Fix USB device hotplug The usb_add and usb_del monitor commands have been removed in QEMU version 2.12 (introduced in 3e3b39f173f9abc99da84084a1f4657c9de885bd). Quote from https://wiki.qemu.org/ChangeLog/2.12#Incompatible_changes: > The deprecated HMP commands "usb_add" and "usb_del" have been removed. > Use "device_add" and "device_del" as replacement instead. So we're doing exactly that and the udisks2 test now works again. Signed-off-by: aszlig Cc: @edolstra --- nixos/tests/udisks2.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nixos/tests/udisks2.nix b/nixos/tests/udisks2.nix index 72d51c0051c0..70a999267a54 100644 --- a/nixos/tests/udisks2.nix +++ b/nixos/tests/udisks2.nix @@ -37,7 +37,8 @@ in $machine->fail("udisksctl info -b /dev/sda1"); # Attach a USB stick and wait for it to show up. - $machine->sendMonitorCommand("usb_add disk:$stick"); + $machine->sendMonitorCommand("drive_add 0 id=stick,if=none,file=$stick,format=raw"); + $machine->sendMonitorCommand("device_add usb-storage,id=stick,drive=stick"); $machine->waitUntilSucceeds("udisksctl info -b /dev/sda1"); $machine->succeed("udisksctl info -b /dev/sda1 | grep 'IdLabel:.*USBSTICK'"); @@ -52,7 +53,7 @@ in $machine->fail("[ -d /run/media/alice/USBSTICK ]"); # Remove the USB stick. - $machine->sendMonitorCommand("usb_del 0.3"); # FIXME + $machine->sendMonitorCommand("device_del stick"); $machine->waitUntilFails("udisksctl info -b /dev/sda1"); $machine->fail("[ -e /dev/sda ]"); '';