• Problem: It is impossible to feed filenames with the character colon because
    qemu interprets such names as a protocol. For example filename scsi:0, is
    interpreted as a protocol by name "scsi".
    
    This patch allows user to espace colon characters. For example the above
    filename can now be expressed either as 'scsi\:0' or as file:scsi:0
    
    anything following the "file:" tag is interpreted verbatin. However if "file:"
    tag is omitted then any colon characters in the string must be escaped using
    backslash.
    
    Here are couple of examples:
    
    scsi\:0\:abc is a local file scsi:0:abc
    http\://myweb is a local file by name http://myweb
    file:scsi:0:abc is a local file scsi:0:abc
    file:http://myweb is a local file by name http://myweb
    
    Signed-off-by: Ram Pai <linuxram@us.ibm.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Ram Pai authored
     
    Browse Code »

  • Section 10.8.25 ("START/STOP UNIT Command") of SFF-8020i states that
    if the device is locked we should refuse to eject if the device is
    locked.
    
    ASC_MEDIA_REMOVAL_PREVENTED is the appropriate return in this case.
    
    In order to stop itself from ejecting the media it is running from,
    Fedora's installer (anaconda) requires the CDROMEJECT ioctl() to fail
    if the drive has been previously locked.
    
    See also https://bugzilla.redhat.com/501412
    
    Signed-off-by: Mark McLoughlin <markmc@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Mark McLoughlin authored
     
    Browse Code »

  • Now we can make use of the newly introduced option structures. Instead of
    having bdrv_create carry more and more parameters (which are format specific in
    most cases), just pass a option structure as defined by the driver itself.
    
    bdrv_create2() contains an emulation of the old interface to simplify the
    transition.
    
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Kevin Wolf authored
     
    Browse Code »





  • Added a backing_format field to BlockDriverState.
    Added bdrv_create2 and drv->bdrv_create2 to create an image with
    a known backing file format.
    Upon bdrv_open2 if backing format is known use it, instead of
    probing the (backing) image.
    
    Signed-off-by: Uri Lublin <uril@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    
    
    git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6908 c046a42c-6fe2-441c-8c8c-71466251a162
    aliguori authored
     
    Browse Code »
  • Okay, I started looking into how to handle scsi-generic I/O in the
    new world order.
    
    I think the best is to use the SG_IO ioctl instead of the read/write
    interface as that allows us to support scsi passthrough on disk/cdrom
    devices, too.  See Hannes patch on the kvm list from August for an
    example.
    
    Now that we always do ioctls we don't need another abstraction than
    bdrv_ioctl for the synchronous requests for now, and for asynchronous
    requests I've added a aio_ioctl abstraction keeping it simple.
    
    Long-term we might want to move the ops to a higher-level abstraction
    and let the low-level code fill out the request header, but I'm lazy
    enough to leave that to the people trying to support scsi-passthrough
    on a non-Linux OS.
    
    Tested lightly by issuing various sg_ commands from sg3-utils in a guest
    to a host CDROM device.
    
    
    Signed-off-by: Christoph Hellwig <hch@lst.de>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    
    
    git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6895 c046a42c-6fe2-441c-8c8c-71466251a162
    aliguori authored
     
    Browse Code »

  • When a scsi device is backed by a scsi generic device instead of an
    ordinary host block device, the block API is abused in a couple of annoying
    ways:
    
     - nb_sectors is negative, and specifies a byte count instead of a sector count
     - offset is ignored, since scsi-generic is essentially a packet protocol
    
    This overloading makes hacking the block layer difficult.  Remove it by
    introducing a new explicit API for scsi-generic devices.  The new API
    is still backed by the old implementation, but at least the users are
    insulated.
    
    Signed-off-by: Avi Kivity <avi@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    
    
    git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6822 c046a42c-6fe2-441c-8c8c-71466251a162
    aliguori authored
     
    Browse Code »


  • Refactor the monitor API and prepare it for decoupled terminals:
    term_print functions are renamed to monitor_* and all monitor services
    gain a new parameter (mon) that will once refer to the monitor instance
    the output is supposed to appear on. However, the argument remains
    unused for now. All monitor command callbacks are also extended by a mon
    parameter so that command handlers are able to pass an appropriate
    reference to monitor output services.
    
    For the case that monitor outputs so far happen without clearly
    identifiable context, the global variable cur_mon is introduced that
    shall once provide a pointer either to the current active monitor (while
    processing commands) or to the default one. On the mid or long term,
    those use case will be obsoleted so that this variable can be removed
    again.
    
    Due to the broad usage of the monitor interface, this patch mostly deals
    with converting users of the monitor API. A few of them are already
    extended to pass 'mon' from the command handler further down to internal
    functions that invoke monitor_printf.
    
    At this chance, monitor-related prototypes are moved from console.h to
    a new monitor.h. The same is done for the readline API.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    
    
    git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6711 c046a42c-6fe2-441c-8c8c-71466251a162
    aliguori authored
     
    Browse Code »
  • Reading the passwords for encrypted hard disks during early startup is
    broken (I guess for quiet a while now):
     - No monitor terminal is ready for input at this point
     - Forcing all mux'ed terminals into monitor mode can confuse other
       users of that channels
    
    To overcome these issues and to lay the ground for a clean decoupling of
    monitor terminals, this patch changes the initial password inquiry as
    follows:
     - Prevent autostart if there is some encrypted disk
     - Once the user tries to resume the VM, prompt for all missing
       passwords
     - Only resume if all passwords were accepted
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    
    
    git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6707 c046a42c-6fe2-441c-8c8c-71466251a162
    aliguori authored
     
    Browse File »
  • Introduce bdrv_get_encrypted_filename service to allow more informative
    password prompting.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    
    
    git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6704 c046a42c-6fe2-441c-8c8c-71466251a162
    aliguori authored
     
    Browse File »
  • Make bdrv_iterate more useful by passing the BlockDriverState to the
    iterator instead of the device name.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    
    
    git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6703 c046a42c-6fe2-441c-8c8c-71466251a162
    aliguori authored
     
    Browse File »


  • qcow2 writes a cluster reference count on every cluster update.  This causes
    performance to crater when using anything but cache=writeback.  This is most
    noticeable when using savevm.  Right now, qcow2 isn't a reliable format
    regardless of the type of cache your using because metadata is not updated in
    the correct order.  Considering this, I think it's somewhat reasonable to use
    writeback caching by default with qcow2 files.
    
    It at least avoids the massive performance regression for users until we sort
    out the issues in qcow2. 
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    
    
    
    git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5879 c046a42c-6fe2-441c-8c8c-71466251a162
    aliguori authored
     
    Browse Code »



  • This patch changes the cache= option to accept none, writeback, or writethough
    to control the host page cache behavior.  By default, writethrough caching is
    now used which internally is implemented by using O_DSYNC to open the disk
    images.  When using -snapshot, writeback is used by default since data integrity
    it not at all an issue.
    
    cache=none has the same behavior as cache=off previously.  The later syntax is
    still supported by now deprecated.  I also cleaned up the O_DIRECT
    implementation to avoid many of the #ifdefs.
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    
    
    
    git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5485 c046a42c-6fe2-441c-8c8c-71466251a162
    aliguori authored
     
    Browse Code »

  • This patch adds a bdrv_flush_all() function.  It's necessary to ensure that all
    IO operations have been flushed to disk before completely a live migration.
    
    N.B. we don't actually use this now.  We really should flush the block drivers
    using an live savevm callback to avoid unnecessary guest down time.
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    
    
    
    git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5432 c046a42c-6fe2-441c-8c8c-71466251a162
    aliguori authored
     
    Browse Code »

  • This patch refactors the AIO layer to allow multiple AIO implementations.  It's
    only possible because of the recent signalfd() patch.  
    
    Right now, the AIO infrastructure is pretty specific to the block raw backend.
    For other block devices to implement AIO, the qemu_aio_wait function must
    support registration.  This patch introduces a new function,
    qemu_aio_set_fd_handler, which can be used to register a file descriptor to be
    called back.  qemu_aio_wait() now polls a set of file descriptors registered
    with this function until one becomes readable or writable.
    
    This patch should allow the implementation of alternative AIO backends (via a
    thread pool or linux-aio) and AIO backends in non-traditional block devices
    (like NBD).
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    
    
    
    git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5297 c046a42c-6fe2-441c-8c8c-71466251a162
    aliguori authored
     
    Browse Code »

  • Right now, we sprinkle #if defined(QEMU_IMG) && defined(QEMU_NBD) all over the
    code.  It's ugly and causes us to have to build multiple object files for
    linking against qemu and the tools.
    
    This patch introduces a new file, qemu-tool.c which contains enough for
    qemu-img, qemu-nbd, and QEMU to all share the same objects.
    
    This also required getting qemu-nbd to be a bit more Windows friendly.  I also
    changed the Windows block-raw to use normal IO instead of overlapping IO since
    we don't actually do AIO yet on Windows.  I changed the various #if 0's to
     #if WIN32_AIO to make it easier for someone to eventually fix AIO on Windows.
    
    After this patch, there are no longer any #ifdef's related to qemu-img and
    qemu-nbd.
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    
    
    
    git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5226 c046a42c-6fe2-441c-8c8c-71466251a162
    aliguori authored
     
    Browse Code »

  • This patch introduces signalfd() to work around the signal/select race in
    checking for AIO completions.  For platforms that don't support signalfd(), we
    emulate it with threads.
    
    There was a long discussion about this approach.  I don't believe there are any
    fundamental problems with this approach and I believe eliminating the use of
    signals is a good thing.
    
    I've tested Windows and Linux using Windows and Linux guests.  I've also checked
    for disk IO performance regressions.
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    
    
    
    git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5187 c046a42c-6fe2-441c-8c8c-71466251a162
    aliguori authored
     
    Browse File »