qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 3/8] split away drive init from ide_init2()


From: Gerd Hoffmann
Subject: Re: [Qemu-devel] [PATCH 3/8] split away drive init from ide_init2()
Date: Fri, 11 Sep 2009 16:36:34 +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


+void ide_init_drive(IDEState *s, DriveInfo *dinfo)
+{
+    int cylinders, heads, secs;
+    uint64_t nb_sectors;
+
+    if (dinfo&&  dinfo->bdrv) {
+        s->bs = dinfo->bdrv;

Before, this assignement was executed even when !dinfo->bdrv.  Can this
happen?

Running this once with dinfo->bdrv = something, then with dinfo->bdrv = NULL (which is the only case where this matters) can't happen. You can't hot-unplut ide drives ;)

The code used to be called once for initialization. Now it might be called twice for ide busses converted to qdev: Once with dinfo = NULL (when setting up the bus) and once with dinfo != NULL (when attaching the drive).

cheers,
  Gerd





reply via email to

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