All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] check for cdrom file on device reconfigure
       [not found] <372543940.373181288078681968.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com>
@ 2010-10-26  7:40 ` Miroslav Rezanina
  2010-10-28 11:18   ` Ian Jackson
  0 siblings, 1 reply; 2+ messages in thread
From: Miroslav Rezanina @ 2010-10-26  7:40 UTC (permalink / raw)
  To: xen-devel

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] check for cdrom file on device reconfigure
  2010-10-26  7:40 ` [PATCH] check for cdrom file on device reconfigure Miroslav Rezanina
@ 2010-10-28 11:18   ` Ian Jackson
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Jackson @ 2010-10-28 11:18 UTC (permalink / raw)
  To: Miroslav Rezanina; +Cc: xen-devel

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-10-28 11:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <372543940.373181288078681968.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com>
2010-10-26  7:40 ` [PATCH] check for cdrom file on device reconfigure Miroslav Rezanina
2010-10-28 11:18   ` Ian Jackson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.