From: Gerd Hoffmann <kraxel@redhat.com>
To: Wolfgang Mauerer <wolfgang.mauerer@siemens.com>
Cc: "Kiszka, Jan" <jan.kiszka@siemens.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
"wlm.libvirt@googlemail.com" <wlm.libvirt@googlemail.com>
Subject: Re: [Qemu-devel] [PATCH 3/4] SCSI-Hotdel: Implement drive_hot_del
Date: Wed, 30 Sep 2009 21:04:50 +0200 [thread overview]
Message-ID: <4AC3ABD2.6080508@redhat.com> (raw)
In-Reply-To: <4AC37D08.7050506@siemens.com>
On 09/30/09 17:45, Wolfgang Mauerer wrote:
> Gerd Hoffmann wrote:
>> 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.
>
> That makes sense, but I'd nevertheless prefer to stick with the
> more traditional approach right now, replacing the
> bus/unit parsing with an ID-based variant.
Have a look at the "qdev: bus management updates." patch series posted a
few days ago. It adds device_add+device_del.
> However, is there any
> standard way to get from an instance of DriveInfo to
> the corresponding instance of SCSIDevice respectively
> SCSIDeviceInfo?
No. It is linked the other way around: The device has a reference to
the DriveInfo. Which is one of the reasons why I think drive_del isn't
that a great idea.
cheers,
Gerd
next prev parent reply other threads:[~2009-09-30 19:05 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-18 15:26 [Qemu-devel] [PATCH 0/4] SCSI-hotdel: Implement removal of SCSI hard disks Wolfgang Mauerer
2009-09-18 15:26 ` [Qemu-devel] [PATCH 1/4] SCSI-hotdel: Add detach method to LSI SCSI driver Wolfgang Mauerer
2009-09-18 15:26 ` [Qemu-devel] [PATCH 2/4] SCSI-hotdel: Factor out IF argument parsing Wolfgang Mauerer
2009-09-18 15:26 ` [Qemu-devel] [PATCH 3/4] SCSI-Hotdel: Implement drive_hot_del Wolfgang Mauerer
2009-09-18 15:26 ` [Qemu-devel] [PATCH 4/4] Small cleanup for drive_hot_add Wolfgang Mauerer
2009-09-21 7:53 ` [Qemu-devel] [PATCH 3/4] SCSI-Hotdel: Implement drive_hot_del Gerd Hoffmann
2009-09-30 15:45 ` Wolfgang Mauerer
2009-09-30 19:04 ` Gerd Hoffmann [this message]
2009-10-01 7:54 ` Wolfgang Mauerer
2009-10-01 8:50 ` Gerd Hoffmann
2009-09-21 7:46 ` [Qemu-devel] [PATCH 1/4] SCSI-hotdel: Add detach method to LSI SCSI driver Gerd Hoffmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4AC3ABD2.6080508@redhat.com \
--to=kraxel@redhat.com \
--cc=jan.kiszka@siemens.com \
--cc=qemu-devel@nongnu.org \
--cc=wlm.libvirt@googlemail.com \
--cc=wolfgang.mauerer@siemens.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).