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

Re: [Xen-devel] BUG 4.2.2: xl cd-insert corrupts xenstore state



Ha!  I knew I'd seen this before... the following git c/s needs to be
backported:

commit c3556e2a1aee3c9b7dda5d57e85e8867fff1b9da
Author: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
Commit: George Dunlap <george.dunlap@xxxxxxxxxxxxx>

    libxl: Fix bug in libxl_cdrom_insert, make more robust against bad
xenstore data

    libxl_cdrom_insert was failing to initialize the backend type,
    resulting in the wrong default backend.  The result was not only that
    the CD was not inserted properly, but also that some improper xenstore
    entries were created, causing further block commands to fail.

    This patch fixes the bug by setting the disk backend type based on the
    type of the existing device.

    It also makes the system more robust by checking to see that it has
    got a valid path before proceeding to write a partial xenstore entry.

    Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
    Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
    Committed-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

On Fri, Apr 26, 2013 at 3:34 PM, George Dunlap
<George.Dunlap@xxxxxxxxxxxxx> wrote:
> $ git checkout RELEASE-4.2.2
> $ git clean -ffdx
>
> [do a build, install, reboot]
>
> $ xl create a0
>
> $ xl cd-eject a0 hdc
>
> [However, the guest OS still sees the CD inserted]
>
> $ xl block-list a0
> Segmentation fault
>
> $ xl cd-insert a0 hdc file:/images/xs-tools-6.0.0.iso
> Segmentation fault
>
> The problem seems to be that xl cd-eject is writing corrupt values to
> xenstore.  Note that vbd/1/5632 is still there as when it booted, but
> qdisk/1/5632 has some random stuff in it
>
> $ xenstore-ls -f /local/domain/0/backend
> /local/domain/0/backend/qdisk = ""
> /local/domain/0/backend/qdisk/1 = ""
> /local/domain/0/backend/qdisk/1/768 = ""
> /local/domain/0/backend/qdisk/1/768/frontend = 
> "/local/domain/1/device/vbd/768"
> /local/domain/0/backend/qdisk/1/768/params = "qcow:/images/vm/a0"
> /local/domain/0/backend/qdisk/1/768/frontend-id = "1"
> /local/domain/0/backend/qdisk/1/768/online = "1"
> /local/domain/0/backend/qdisk/1/768/removable = "0"
> /local/domain/0/backend/qdisk/1/768/bootable = "1"
> /local/domain/0/backend/qdisk/1/768/state = "2"
> /local/domain/0/backend/qdisk/1/768/dev = "hda"
> /local/domain/0/backend/qdisk/1/768/type = "qdisk"
> /local/domain/0/backend/qdisk/1/768/mode = "w"
> /local/domain/0/backend/qdisk/1/768/device-type = "disk"
> /local/domain/0/backend/qdisk/1/768/feature-barrier = "1"
> /local/domain/0/backend/qdisk/1/768/info = "0"
> /local/domain/0/backend/qdisk/1/768/sector-size = "512"
> /local/domain/0/backend/qdisk/1/768/sectors = "33554432"
> /local/domain/0/backend/qdisk/1/768/hotplug-status = "connected"
> /local/domain/0/backend/qdisk/1/5632 = ""
> /local/domain/0/backend/qdisk/1/5632/type = "qdisk"
> /local/domain/0/backend/qdisk/1/5632/params = ""
> /local/domain/0/backend/vbd = ""
> /local/domain/0/backend/vbd/1 = ""
> /local/domain/0/backend/vbd/1/5632 = ""
> /local/domain/0/backend/vbd/1/5632/frontend = 
> "/local/domain/1/device/vbd/5632"
> /local/domain/0/backend/vbd/1/5632/tapdisk-params =
> "aio:/images/autoinstall//w2k3eesp2.iso"
> /local/domain/0/backend/vbd/1/5632/params = "/dev/xen/blktap-2/tapdev0"
> /local/domain/0/backend/vbd/1/5632/script = "/etc/xen/scripts/block"
> /local/domain/0/backend/vbd/1/5632/physical-device = "fd:0"
> /local/domain/0/backend/vbd/1/5632/frontend-id = "1"
> /local/domain/0/backend/vbd/1/5632/online = "1"
> /local/domain/0/backend/vbd/1/5632/removable = "1"
> /local/domain/0/backend/vbd/1/5632/bootable = "1"
> /local/domain/0/backend/vbd/1/5632/state = "2"
> /local/domain/0/backend/vbd/1/5632/dev = "hdc"
> /local/domain/0/backend/vbd/1/5632/type = "phy"
> /local/domain/0/backend/vbd/1/5632/mode = "r"
> /local/domain/0/backend/vbd/1/5632/device-type = "cdrom"
>
> The disk string from the config file is as follows:
>
> disk = [ 
> 'qcow:/images/vm/a0,hda,w','file:/images/autoinstall//w2k3eesp2.iso,hdc:cdrom,r'
> ]
>
>  -George

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.