Hi Mike, I have the following line in my config file: disk = [ ''file:/var/images/min-el3-i386.img,hda,w'' ] and my host doesn''t have a /dev/hda (it has a SATA disk which shows up as /dev/sda). But I would like the guest to see a /dev/hda. Sounds reasonable? Now, when I try to create this domain, I get: [2005-08-05 14:40:53 xend] DEBUG (blkif:24) exception looking up device number for hda: [Errno 2] No such file or directory: ''/dev/hda'' 2005-08-05 14:40:53 xend] DEBUG (blkif:449) Destroying blkif domain=1 [2005-08-05 14:40:53 xend] DEBUG (blkif:337) Destroying vbd domain=1 id=0 The code in util/blkif.py that tries to convert name to device number doesn''t seem to be new, but I don''t know why it started showing up suddenly. I worked around by manually creating /dev/hda, but I don''t think it''s reasonable to expect that host''s /dev contains entries for all guest devices. Also, the effect of having a bad "disk=" line in xmdefconfig (such as pointing to a non-existent file) results in a xend crash. We probably need to add a few checks at the python level so that the user sees a more useful stack trace. -Arun _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Anthony Liguori
2005-Aug-05 20:33 UTC
Re: [Xen-devel] exception looking up device number f,or hda
Hi Arun, I just pulled the latest unstable and could not reproduce. I have an identical scenario (no /dev/hda only /dev/sda due to SATA). Also, if the devno resolution code fails you should also get a vbd: Device not found exception in the logs. The exception you are seeing is not actually a problem, it just means that stat has failed. We should probably cleanup that error message. Can you post a more complete log file? I think the error is being caused somewhere else. Thanks, Anthony Liguori Arun Sharma wrote:> Hi Mike, > > I have the following line in my config file: > > disk = [ ''file:/var/images/min-el3-i386.img,hda,w'' ] > > and my host doesn''t have a /dev/hda (it has a SATA disk which shows up > as /dev/sda). > > But I would like the guest to see a /dev/hda. Sounds reasonable? > > Now, when I try to create this domain, I get: > > [2005-08-05 14:40:53 xend] DEBUG (blkif:24) exception looking up > device number for hda: [Errno 2] No such file or directory: ''/dev/hda'' > 2005-08-05 14:40:53 xend] DEBUG (blkif:449) Destroying blkif domain=1 > [2005-08-05 14:40:53 xend] DEBUG (blkif:337) Destroying vbd domain=1 id=0 > > The code in util/blkif.py that tries to convert name to device number > doesn''t seem to be new, but I don''t know why it started showing up > suddenly. > > I worked around by manually creating /dev/hda, but I don''t think it''s > reasonable to expect that host''s /dev contains entries for all guest > devices. > > Also, the effect of having a bad "disk=" line in xmdefconfig (such as > pointing to a non-existent file) results in a xend crash. We probably > need to add a few checks at the python level so that the user sees a > more useful stack trace. > > -Arun > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Arun Sharma
2005-Aug-05 21:20 UTC
Re: [Xen-devel] exception looking up device number f,or hda
Anthony Liguori wrote:> Hi Arun, > > I just pulled the latest unstable and could not reproduce. I have an > identical scenario (no /dev/hda only /dev/sda due to SATA). > > Also, if the devno resolution code fails you should also get a vbd: > Device not found exception in the logs. The exception you are seeing is > not actually a problem, it just means that stat has failed. > > We should probably cleanup that error message. > > Can you post a more complete log file? I think the error is being > caused somewhere else. >Hi Anthony, You''re probably not able to reproduce the problem because you''re not using VMX domains? We''re overloading the semantics of disk = [ ''file:/var/images/min-el3-i386.img,hda,w'' ] to create a IDE hard drive for a VMX domain. So we want to take advantage of the config file parsing code from the VBD code path, but we don''t want to do other tasks such as connecting the backend/frontend etc. The log from a successful VMX domain startup looks like: [2005-08-05 14:54:41 xend] INFO (XendRoot:126) EVENT> xend.domain.create [''fc3'', 2] [2005-08-05 14:54:42 xend] ERROR (process:37) [block-file] ioctl: LOOP_SET_FD: Device or resource busy [2005-08-05 14:54:42 xend] DEBUG (blkif:81) Connecting blkif <BlkifBackend frontend=2 backend=0 id=0> [2005-08-05 14:54:42 xend] DEBUG (blkif:89) send_be_create <BlkifBackend frontend=2 backend=0 id=0> [2005-08-05 14:54:42 xend] DEBUG (image:293) args: cdrom, val: None [2005-08-05 14:54:42 xend] DEBUG (image:293) args: boot, val: c [2005-08-05 14:54:42 xend] DEBUG (image:293) args: fda, val: None [2005-08-05 14:54:42 xend] DEBUG (image:293) args: fdb, val: None [2005-08-05 14:54:42 xend] DEBUG (image:293) args: localtime, val: None [2005-08-05 14:54:42 xend] DEBUG (image:293) args: serial, val: None [2005-08-05 14:54:42 xend] DEBUG (image:293) args: std-vga, val: None [2005-08-05 14:54:42 xend] DEBUG (image:293) args: isa, val: None [2005-08-05 14:54:42 xend] INFO (image:352) spawning device models: /usr/lib/xen/bin/qemu-dm [''/usr/lib/xen/bin/qemu-dm'', '' -vncconnect'', ''143.183.130.223:5502'', ''-d'', ''2'', ''-p'', ''19'', ''-m'', ''128'', ''-boot'', ''c'', ''-hda'', ''/var/images/min-el3-i386.i mg'', ''-vnc'', ''-k'', ''en-us'', ''-vncport'', ''5902''] i.e. we were doing things which we really shouldn''t be doing, but it didn''t hurt. But it started hurting today :) In the future, we''re also planning to have a VBD driver for unmodified OSes running on VMX domains and I was thinking of a syntax such as: disk = [ ''file:/var/images/min-el3-i386.img,vhda,w'' ] Any comments/suggestions on the syntax above to present emulated real devices as well as virtual devices to an unmodified OS? -Arun Complete log for the failed case: [2005-08-05 14:40:33 xend] INFO (SrvDaemon:300) Xend Daemon started [2005-08-05 14:40:33 xend] INFO (channel:148) Virq 3 on port 13 [2005-08-05 14:40:33 xend] DEBUG (XendDomainInfo:171) info={''vcpu_to_cpu'': [0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], ''cpu_time'': 20984020436L, ''ssidref'': 0, ''s hutdown_reason'': 0, ''dying'': 0, ''dom'': 0, ''running'': 1, ''maxmem_kb'': -4, ''paused'': 0, ''crashed'': 0, ''vcpus'': 1, ''shutdown'': 0, ''mem_kb'': 250880, ''cpumap'': [-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], ''blocked'': 0} [2005-08-05 14:40:33 xend] DEBUG (XendDomainInfo:172) config=''None'' [2005-08-05 14:40:33 xend] INFO (SrvServer:63) unix path=/var/lib/xend/xend-socket [2005-08-05 14:40:33 xend] INFO (XendRoot:126) EVENT> xend.start 0 [2005-08-05 14:40:33 xend] INFO (process:35) [network] network start bridge=xen-br0 netdev=eth0 antispoof=no [2005-08-05 14:40:53 xend] DEBUG (image:135) initDomain: cpu=-1 mem_kb=131204 ssidref=-1 dom=1 [2005-08-05 14:40:53 xend] DEBUG (XendDomainInfo:673) init_domain> Created domain=1 name=ExampleVMXDomain memory=128 [2005-08-05 14:40:53 xend] INFO (XendRoot:126) EVENT> xend.domain.create [''ExampleVMXDomain'', 1] [2005-08-05 14:40:53 xend] INFO (image:190) buildDomain os=vmx dom=1 vcpus=1 [2005-08-05 14:40:53 xend] INFO (image:259) VMX device model port: 3 [2005-08-05 14:40:53 xend] WARNING (XendDomainInfo:924) Unknown config field memmap [2005-08-05 14:40:53 xend] WARNING (XendDomainInfo:924) Unknown config field device_model [2005-08-05 14:40:53 xend] WARNING (XendDomainInfo:924) Unknown config field boot [2005-08-05 14:40:53 xend] WARNING (XendDomainInfo:924) Unknown config field vnc [2005-08-05 14:40:53 xend] WARNING (XendDomainInfo:924) Unknown config field display [2005-08-05 14:40:53 xend] DEBUG (blkif:24) exception looking up device number for hda: [Errno 2] No such file or directory : ''/dev/hda'' [2005-08-05 14:40:53 xend] DEBUG (blkif:449) Destroying blkif domain=1 [2005-08-05 14:40:53 xend] DEBUG (blkif:337) Destroying vbd domain=1 id=0 >>>> xend dies here <<< [2005-08-05 14:43:32 xend] INFO (SrvDaemon:300) Xend Daemon started _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
takebe_akio@jp.fujitsu.com
2005-Aug-08 02:21 UTC
Re: [Xen-devel] exception looking up device number f,or hda
Hi Arun>disk = [ ''file:/var/images/min-el3-i386.img,hda,w'' ]Please test the following settings. disk = [ ''file:/var/images/min-el3-i386.img,hda1,w'' ] And, it is necessary to rewrite /etc/fstab of domU. Thank, Akio _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Arun Sharma
2005-Aug-08 05:38 UTC
Re: [Xen-devel] exception looking up device number for hda
takebe_akio@jp.fujitsu.com wrote:> Hi Arun > > >>disk = [ ''file:/var/images/min-el3-i386.img,hda,w'' ] > > Please test the following settings. > disk = [ ''file:/var/images/min-el3-i386.img,hda1,w'' ] > > And, it is necessary to rewrite /etc/fstab of domU. >I''m not looking for configuration help for domU. I was looking for suggestions as to how: a) IDE hard drives for VMX domains should be configured b) VBD based devices for VMX domains should be configured and the bad failure mode for (a) when the user misconfigures it. -Arun _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Mike Wray
2005-Aug-08 08:08 UTC
[Xen-devel] Re: exception looking up device number f,or hda
Arun Sharma wrote:> Hi Mike, > > I have the following line in my config file: > > disk = [ ''file:/var/images/min-el3-i386.img,hda,w'' ] > > and my host doesn''t have a /dev/hda (it has a SATA disk which shows up > as /dev/sda). > > But I would like the guest to see a /dev/hda. Sounds reasonable? > > Now, when I try to create this domain, I get: > > [2005-08-05 14:40:53 xend] DEBUG (blkif:24) exception looking up device > number for hda: [Errno 2] No such file or directory: ''/dev/hda'' > 2005-08-05 14:40:53 xend] DEBUG (blkif:449) Destroying blkif domain=1 > [2005-08-05 14:40:53 xend] DEBUG (blkif:337) Destroying vbd domain=1 id=0 > > The code in util/blkif.py that tries to convert name to device number > doesn''t seem to be new, but I don''t know why it started showing up > suddenly. > > I worked around by manually creating /dev/hda, but I don''t think it''s > reasonable to expect that host''s /dev contains entries for all guest > devices.No, and the blkdev_name_to_number() function should convert names like /dev/hda without the device existing. This code should be trapping the error: try: return os.stat(n).st_rdev except Exception, ex: log.debug("exception looking up device number for %s: %s", name, ex) pass The code then uses regexps to analyse the device name (though you will see the debug message in the log). What xen version are you using?> > Also, the effect of having a bad "disk=" line in xmdefconfig (such as > pointing to a non-existent file) results in a xend crash. We probably > need to add a few checks at the python level so that the user sees a > more useful stack trace.All errors during domain construction are intended to be trapped and returned to the caller - so maybe something got broken. Did you see anything in the xend log? Might be worth causing the error using xend with tracing on (xend trace_start) and having a look at the trace (/var/log/xend.trace). Mike _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Mark Williamson
2005-Aug-08 14:48 UTC
Re: [Xen-devel] exception looking up device number for hda
> I was looking for suggestions as to how: > > a) IDE hard drives for VMX domains should be configured > b) VBD based devices for VMX domains should be configuredAh, I guess we have to distinguish the two... Hope about an optional: vbd:/emu: prefix (or similar) on the second part of the triplet for a disk? The default (for non VMX domains) could be "vbd" so existing behaviour would remain the same. If / when we move over to using "xvd" for VBDs I guess that could subsume this functionality (might still need it for non Linux guests, tho). Thoughts? Cheers, Mark> and the bad failure mode for (a) when the user misconfigures it. > > -Arun > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Arun Sharma
2005-Aug-09 00:06 UTC
Re: [Xen-devel] exception looking up device number for hda
Mark Williamson wrote:>>I was looking for suggestions as to how: >> >>a) IDE hard drives for VMX domains should be configured >>b) VBD based devices for VMX domains should be configured > > > Ah, I guess we have to distinguish the two... > > Hope about an optional: vbd:/emu: prefix (or similar) on the second part of > the triplet for a disk? The default (for non VMX domains) could be "vbd" so > existing behaviour would remain the same.Sounds good to me. How about: hda = VBD hda vbd://hda = VBD hda ioemu://hda = IDE hda The VBD patches are not ready yet - so I''d like to propose that we do: - self.create_configured_devices() + if self.image.ostype != ''vmx'': + self.create_configured_devices() and - self.create_blkif() + if self.image.ostype != ''vmx'': + self.create_blkif() When our VBD patches are ready, we''ll revert this. -Arun _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
David Hopwood
2005-Aug-09 01:25 UTC
Re: [Xen-devel] exception looking up device number for hda
Arun Sharma wrote:> Sounds good to me. How about: > > hda = VBD hda > vbd://hda = VBD hda > ioemu://hda = IDE hdaIn URIs the // syntax indicates a global naming authority such as DNS (see RFC 2396 section 3.2). Here the scheme-specific-part is in a local namespace, so it should be just "vbd:hda", for example. -- David Hopwood <david.nospam.hopwood@blueyonder.co.uk> _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Mark Williamson
2005-Aug-09 01:49 UTC
Re: [Xen-devel] exception looking up device number for hda
> > Hope about an optional: vbd:/emu: prefix (or similar) on the second part > > of the triplet for a disk? The default (for non VMX domains) could be > > "vbd" so existing behaviour would remain the same. > > Sounds good to me. How about: > > hda = VBD hda > vbd://hda = VBD hda > ioemu://hda = IDE hdaSounds fine but I think I''d actually ditch the // to fit in with the phy: and file: syntax we already have. (and as David said in another post, to avoid looking like a URL).> The VBD patches are not ready yet - so I''d like to propose that we do: > > - self.create_configured_devices() > + if self.image.ostype != ''vmx'': > + self.create_configured_devices() > > and > > - self.create_blkif() > + if self.image.ostype != ''vmx'': > + self.create_blkif() > > When our VBD patches are ready, we''ll revert this.Is there still a need for these changes if the ioemu: prefix is implemented? Cheers, Mark _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Xiaofeng Ling
2005-Aug-09 02:58 UTC
Re: [Xen-devel] exception looking up device number for hda
I''ve already made a patch when I doing para-driver debugging. see the attach patch. Does it fit the requirement? It will skip setupping up the loop device for ioemu image files, but by xm vbd-list, it can still see the file bind to hda. so this command is still useful. Mark Williamson wrote:>>>Hope about an optional: vbd:/emu: prefix (or similar) on the second part >>>of the triplet for a disk? The default (for non VMX domains) could be >>>"vbd" so existing behaviour would remain the same. >> >>Sounds good to me. How about: >> >>hda = VBD hda >>vbd://hda = VBD hda >>ioemu://hda = IDE hda > > > Sounds fine but I think I''d actually ditch the // to fit in with the phy: and > file: syntax we already have. (and as David said in another post, to avoid > looking like a URL). > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Arun Sharma
2005-Aug-09 18:19 UTC
Re: [Xen-devel] exception looking up device number for hda
Xiaofeng Ling wrote:> I''ve already made a patch when I doing para-driver debugging. > see the attach patch. > Does it fit the requirement? > It will skip setupping up the loop device for ioemu image files, > but by xm vbd-list, it can still see the file bind to hda. > so this command is still useful.> -disk = [ ''file:/var/images/min-el3-i386.img,hda,w'' ] > +disk = [ ''ioemu:/var/images/min-el3-i386.img,hda,w'' ]The ioemu: prefix should be on the second element i.e: +disk = [ ''file:/var/images/min-el3-i386.img,ioemu:hda,w'' ] and it should allow: +disk = [ ''phy:hdb,ioemu:hda,w'' ] -Arun _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Arun Sharma
2005-Aug-09 19:06 UTC
Re: [Xen-devel] exception looking up device number for hda
Mark Williamson wrote:> >>The VBD patches are not ready yet - so I''d like to propose that we do: >> >>- self.create_configured_devices() >>+ if self.image.ostype != ''vmx'': >>+ self.create_configured_devices() >> >>and >> >>- self.create_blkif() >>+ if self.image.ostype != ''vmx'': >>+ self.create_blkif() >> >>When our VBD patches are ready, we''ll revert this. > > > Is there still a need for these changes if the ioemu: prefix is implemented?We''ll implement the ioemu prefix ASAP - just trying to make sure that 3.0-testing ships with working VMX support :) -Arun _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Mark Williamson
2005-Aug-09 19:18 UTC
Re: [Xen-devel] exception looking up device number for hda
> > Is there still a need for these changes if the ioemu: prefix is > > implemented? > > We''ll implement the ioemu prefix ASAP - just trying to make sure that > 3.0-testing ships with working VMX support :)Sure thing :-) I wouldn''t have thought the ioemu: prefix should be too hard to implement. If it looks like taking a while you could try submitting a patch with your workaround before the -testing release. Cheers, Mark _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel