Miroslav Rezanina
2010-Oct-26 07:40 UTC
[Xen-devel] [PATCH] check for cdrom file on device reconfigure
When guest is started with non-existing file specified as cdrom device,
error is reported. However, when we try to use block-configure to change
cdrom to non-existing file, command is executed successfully although
qemu can''t open this file.
Following patch checks if we can read specified file and raise error
when this is not possible.
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
--
diff -r 3c4c3d48a835 tools/python/xen/xend/server/blkif.py
--- a/tools/python/xen/xend/server/blkif.py Thu Aug 26 11:16:56 2010 +0100
+++ b/tools/python/xen/xend/server/blkif.py Tue Oct 26 09:13:28 2010 +0200
@@ -130,6 +130,11 @@
if (dev_type == ''cdrom'' and
new_front[''device-type''] == ''cdrom'' and
dev == new_back[''dev''] and mode ==
''r''):
+
+ # check if can''t access device file
+ if not os.access(new_back[''params''],os.R_OK):
+ raise VmError("Can''t open file %s" %
new_back[''params''])
+
# dummy device
self.writeBackend(devid,
''type'',
new_back[''type''],
--
Miroslav Rezanina
Software Engineer - Virtualization Team - XEN kernel
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
Ian Jackson
2010-Oct-28 11:18 UTC
Re: [Xen-devel] [PATCH] check for cdrom file on device reconfigure
Miroslav Rezanina writes ("[Xen-devel] [PATCH] check for cdrom file on
device reconfigure"):> When guest is started with non-existing file specified as cdrom device,
> error is reported. However, when we try to use block-configure to change
> cdrom to non-existing file, command is executed successfully although
> qemu can''t open this file.
I''m not convinced that this is the right approach. Surely what should
happen is that errors that qemu experiences trying to open the cdrom
should be propagated through xenstore and back through the toolstack
to the user.
Ian.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel