qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 3/4] SCSI-Hotdel: Implement drive_hot_del


From: Gerd Hoffmann
Subject: Re: [Qemu-devel] [PATCH 3/4] SCSI-Hotdel: Implement drive_hot_del
Date: Mon, 21 Sep 2009 09:53:56 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090814 Fedora/3.0-2.6.b3.fc11 Lightning/1.0pre Thunderbird/3.0b3

  Hi,

+     dinfo = drive_get(type, bus, unit);
+     if (!dinfo) {
+         monitor_printf(mon, "Trying to remove non-existent device\n");
+        return;
+     }

No. Just don't do this silly if/bus/unit parsing. At very minimum use drive_get_by_id() here, then have something like 'drive_del $id'.

IMHO much better would be to go qdev instead though. We should have generic device_add + device_del monitor commands which work for any device, pretty much like the -device command line switch.

cheers,
  Gerd




reply via email to

[Prev in Thread] Current Thread [Next in Thread]