Gonglei (Arei)
2013-May-30 11:23 UTC
[PVSCSI]How to unplug scsi disk simulated by Qemu, just like unplug the ide disk?
Hi all, My environment is xen-4.1.2 + qemu-1.2.2 I made a pvscsi driver for Redhat guest, but I encountered a problem that I could see two scsi disks, one was simulated by QEMU, another was passthrough. Actually I want to unplug the scsi disk simulated. Any methods can solve the problem on the qemu upstream. Thanks!
Pasi Kärkkäinen
2013-May-30 12:47 UTC
Re: [PVSCSI]How to unplug scsi disk simulated by Qemu, just like unplug the ide disk?
On Thu, May 30, 2013 at 11:23:44AM +0000, Gonglei (Arei) wrote:> Hi all, > My environment is xen-4.1.2 + qemu-1.2.2 > I made a pvscsi driver for Redhat guest, but I encountered a problem that I could see two scsi disks, one was simulated by QEMU, another was passthrough. > Actually I want to unplug the scsi disk simulated. Any methods can solve the problem on the qemu upstream. Thanks! >Are you actually using Xen *PVSCSI* (http://wiki.xen.org/wiki/Paravirtualized_SCSI), or are you talking about Xen HVM guest with PV drivers for disk? -- Pasi
Pasi Kärkkäinen
2013-May-30 14:45 UTC
Re: [PVSCSI]How to unplug scsi disk simulated by Qemu, just like unplug the ide disk?
On Thu, May 30, 2013 at 10:39:03PM +0800, charles wjwen wrote:> Available work environment is not around,that is what i try, it pass > startup scsi parameters through the file libxl_dm.c(xensoure : > tools\libxl\libxl_dm.c): > if (strncmp(disks[i].vdev, "sd", 2) == 0) > drive = libxl__sprintf > (gc, "file=%s,if=scsi,bus=0,unit=%d,format=%s,cache=writeback", > disks[i].pdev_path, disk, format); > and it can see from qemu log, it works.But in the guest. you can see two > disk, one is pvscsi idsk, one is simulated by qemu, actually they are the > same. >(adding xen-devel back to CC). libxl does not currently have any kind of PVSCSI support. You''re not using PVSCSI. You''re using Qemu SCSI emulation support. So why are you passing the *same* disk as both IDE and SCSI? There''s no point in that, and it''ll cause problems, probably corrupting the disk. If you want better performance for the HVM guests you should use PVHVM mode, which means using Xen PV drivers in the HVM guest. There''s the unplug logic built for that, so the emulated IDE disk will be unplugged when you use PV drivers. (which is not the same as PVSCSI.) -- Pasi> 2013/5/30 Pasi Kärkkäinen <[1]pasik@iki.fi> > > On Thu, May 30, 2013 at 09:44:30PM +0800, charles wjwen wrote: > > I used in the wrong way? > > The guset VM boot with two disk, scsi disk is actually a user > volume, and > > the system volume is simulated by blkfront. > > > > Please paste your vm cfgfile (/etc/xen/<vm>) > -- Pasi > > > 2013/5/30 Pasi Kärkkäinen <[1][2]pasik@iki.fi> > > > > On Thu, May 30, 2013 at 09:26:48PM +0800, charles wjwen wrote: > > > It''s Xen PVSCSI > > > > > > > Are you sure? > > > , when i try to use platform_fixed_ioport_writew -> > > > unplug_disks (in xen_platform.c), it did''t work. > > > ide disk unpluged ok.Maybe i used in the wrong way,anyone > who > > encountered > > > a similar situation? > > > > > > > There''s absolutely no need for unplugging when using PVSCSI. > > I mean why would you pass passthru the *same* disk with PVSCSI > than with > > Qemu ?? > > > > -- Pasi > > > > > 2013/5/30 Pasi Kärkkäinen <[1][2][3]pasik@iki.fi> > > > > > > On Thu, May 30, 2013 at 11:23:44AM +0000, Gonglei (Arei) > wrote: > > > > Hi all, > > > > My environment is xen-4.1.2 + qemu-1.2.2 > > > > I made a pvscsi driver for Redhat guest, but I > > encountered a > > > problem that I could see two scsi disks, one was simulated > by > > QEMU, > > > another was passthrough. > > > > Actually I want to unplug the scsi disk simulated. > Any > > methods can > > > solve the problem on the qemu upstream. Thanks! > > > > > > > > > > Are you actually using Xen *PVSCSI* > > > ([2][3][4]http://wiki.xen.org/wiki/Paravirtualized_SCSI), > > > or are you talking about Xen HVM guest with PV drivers for > disk? > > > -- Pasi > > > > > > _______________________________________________ > > > Xen-devel mailing list > > > [3][4][5]Xen-devel@lists.xen.org > > > [4][5][6]http://lists.xen.org/xen-devel > > > > > > -- > > > charles,to be a better man. > > > > > > References > > > > > > Visible links > > > 1. mailto:[6][7]pasik@iki.fi > > > 2. [7][8]http://wiki.xen.org/wiki/Paravirtualized_SCSI > > > 3. mailto:[8][9]Xen-devel@lists.xen.org > > > 4. [9][10]http://lists.xen.org/xen-devel > > > > -- > > charles,to be a better man. > > > > References > > > > Visible links > > 1. mailto:[11]pasik@iki.fi > > 2. mailto:[12]pasik@iki.fi > > 3. [13]http://wiki.xen.org/wiki/Paravirtualized_SCSI > > 4. mailto:[14]Xen-devel@lists.xen.org > > 5. [15]http://lists.xen.org/xen-devel > > 6. mailto:[16]pasik@iki.fi > > 7. [17]http://wiki.xen.org/wiki/Paravirtualized_SCSI > > 8. mailto:[18]Xen-devel@lists.xen.org > > 9. [19]http://lists.xen.org/xen-devel > > -- > charles,to be a better man. > > References > > Visible links > 1. mailto:pasik@iki.fi > 2. mailto:pasik@iki.fi > 3. mailto:pasik@iki.fi > 4. http://wiki.xen.org/wiki/Paravirtualized_SCSI > 5. mailto:Xen-devel@lists.xen.org > 6. http://lists.xen.org/xen-devel > 7. mailto:pasik@iki.fi > 8. http://wiki.xen.org/wiki/Paravirtualized_SCSI > 9. mailto:Xen-devel@lists.xen.org > 10. http://lists.xen.org/xen-devel > 11. mailto:pasik@iki.fi > 12. mailto:pasik@iki.fi > 13. http://wiki.xen.org/wiki/Paravirtualized_SCSI > 14. mailto:Xen-devel@lists.xen.org > 15. http://lists.xen.org/xen-devel > 16. mailto:pasik@iki.fi > 17. http://wiki.xen.org/wiki/Paravirtualized_SCSI > 18. mailto:Xen-devel@lists.xen.org > 19. http://lists.xen.org/xen-devel
Konrad Rzeszutek Wilk
2013-Jun-03 13:16 UTC
Re: [PVSCSI]How to unplug scsi disk simulated by Qemu, just like unplug the ide disk?
On Thu, May 30, 2013 at 11:23:44AM +0000, Gonglei (Arei) wrote:> Hi all, > My environment is xen-4.1.2 + qemu-1.2.2 > I made a pvscsi driver for Redhat guest, but I encountered a problem that I could see two scsi disks, one was simulated by QEMU, another was passthrough. > Actually I want to unplug the scsi disk simulated. Any methods can solve the problem on the qemu upstream. Thanks!I would suggest you look at arch/x86/xen/platform-pci-unplug.c which tells QEMU to unplug the IDE driver. You could implement a similar mechanism in QEMU (and in the Linux kernel).> _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel >
Gonglei (Arei)
2013-Jun-03 13:20 UTC
Re: [PVSCSI]How to unplug scsi disk simulated by Qemu, just like unplug the ide disk?
> -----Original Message----- > From: Konrad Rzeszutek Wilk [mailto:konrad.wilk@oracle.com] > Sent: Monday, June 03, 2013 9:16 PM > To: Gonglei (Arei) > Cc: qemu-devel@nongnu.org; xen-devel@lists.xen.org; Luonengjun; Jinwenwu > Subject: Re: [Xen-devel] [PVSCSI]How to unplug scsi disk simulated by Qemu, > just like unplug the ide disk? > > On Thu, May 30, 2013 at 11:23:44AM +0000, Gonglei (Arei) wrote: > > Hi all, > > My environment is xen-4.1.2 + qemu-1.2.2 > > I made a pvscsi driver for Redhat guest, but I encountered a problem that > I could see two scsi disks, one was simulated by QEMU, another was > passthrough. > > Actually I want to unplug the scsi disk simulated. Any methods can solve > the problem on the qemu upstream. Thanks! > > I would suggest you look at arch/x86/xen/platform-pci-unplug.c which > tells QEMU to unplug the IDE driver. You could implement a similar > mechanism in QEMU (and in the Linux kernel). >Ok, thank you so much! -Gonglei