• 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 »


  • Add a bdrv_probe_device method to all BlockDriver instances implementing
    host devices to move matching of host device types into the actual drivers.
    For now we keep exacly the old matching behaviour based on the devices names,
    although we really should have better detetion methods based on device
    information in the future.
    
    Signed-off-by: Christoph Hellwig <hch@lst.de>
    Christoph Hellwig authored
     
    Browse Code »
  • Instead of declaring one BlockDriver for all host devices declared one
    for each type:  a generic one for normal disk devices, a Linux floppy
    driver and a CDROM driver for Linux and FreeBSD.  This gets rid of a lot
    of messy ifdefs and switching based on the type in the various removal
    device methods.
    
    block.c grows a new method to find the correct host device driver based
    on OS-sepcific criteria, which will later into the actual drivers in a
    later patch in this series.
    
    Signed-off-by: Christoph Hellwig <hch@lst.de>
    Christoph Hellwig authored
     
    Browse Code »

  • Now that we have a separate aio pool structure we can remove those
    aio pool details from BlockDriver.
    
    Every driver supporting AIO now needs to declare a static AIOPool
    with the aiocb size and the cancellation method.  This cleans up the
    current code considerably and will make it cleaner and more obvious
    to support two different aio implementations behind a single
    BlockDriver.
    
    Signed-off-by: Christoph Hellwig <hch@lst.de>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Christoph Hellwig authored
     
    Browse Code »
  • This patch converts the remaining users of bdrv_create2 to bdrv_create and
    removes the now unused function.
    
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Kevin Wolf authored
     
    Browse File »



  • This patch makes the range checks for block requests more strict: It fixes a
    potential integer overflow and checks for negative offsets. Also, it adds the
    check for compressed writes.
    
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Kevin Wolf authored
     
    Browse Code »

  • this patch adds a buffer_alignment field to BlockDriverState and
    implements a qemu_blockalign function that uses that field to allocate a
    memory aligned buffer to be used by the block driver.
    buffer_alignment is initialized to 512 but each block driver can set
    a different value (at the moment none of them do).
    This patch modifies ide.c, block-qcow.c, block-qcow2.c and block.c to
    use qemu_blockalign instead of qemu_memalign.
    There is only one place left that still uses qemu_memalign to allocate
    buffers used by block drivers that is posix-aio-compat:handle_aiocb_rw
    because it is not possible to get the BlockDriverState from that
    function. However I think it is not important because posix-aio-compat
    already deals with driver specific code so it is supposed to know its
    own needs.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    
    
    git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7229 c046a42c-6fe2-441c-8c8c-71466251a162
    aliguori 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 »
  • If a bounced vectored aio fails immediately (the inner aio submission
    returning NULL) then the bounce handler erronously returns an aio
    request which will never be completed (and which crashes when cancelled).
    
    Fix by detecting that the inner request has failed and propagating the
    error.
    
    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@6892 c046a42c-6fe2-441c-8c8c-71466251a162
    aliguori authored
     
    Browse File »






  • 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 »
  • Currently, waiting for the user to type in some password blocks the
    whole VM because monitor_readline starts its own I/O loop. And this loop
    also screws up reading passwords from virtual console.
    
    Patch below fixes the shortcomings by using normal I/O processing also
    for waiting on a password. To keep to modal property for the monitor
    terminal, the command handler is temporarily replaced by a password
    handler and a callback infrastructure is established to process the
    result before switching back to command mode.
    
    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@6710 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 »
  • If the backing file is encrypted, 'info block' currently does not report
    the disk as encrypted. Fix this by using the standard API to check disk
    encryption mode. Moreover, switch to a canonical output format.
    
    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@6706 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 »