Re: [Qemu-block] [Qemu-devel] [PATCH v2 02/13] block: Introduce bdrv_lock and bdrv_unlock API

2015-06-23 Thread Fam Zheng
On Wed, 06/24 10:47, Fam Zheng wrote: > On Tue, 06/16 17:07, Stefan Hajnoczi wrote: > > On Tue, Jun 02, 2015 at 11:21:51AM +0800, Fam Zheng wrote: > > > +/** > > > + * bdrv_lock: > > > + * > > > + * Begin a temporary exclusive accessing by locking the BDS. > > > + */ > > > +void bdrv_lock(BlockDriv

Re: [Qemu-block] [PATCH v2 02/13] block: Introduce bdrv_lock and bdrv_unlock API

2015-06-23 Thread Fam Zheng
On Tue, 06/16 17:07, Stefan Hajnoczi wrote: > On Tue, Jun 02, 2015 at 11:21:51AM +0800, Fam Zheng wrote: > > +/** > > + * bdrv_lock: > > + * > > + * Begin a temporary exclusive accessing by locking the BDS. > > + */ > > +void bdrv_lock(BlockDriverState *bs); > > + > > +/** > > + * bdrv_unlock: > >

Re: [Qemu-block] [Qemu-devel] [PATCH COLO-Block v6 07/16] Add new block driver interface to connect/disconnect the remote target

2015-06-23 Thread Wen Congyang
On 06/19/2015 06:49 PM, Stefan Hajnoczi wrote: > On Fri, Jun 19, 2015 at 08:54:56AM +0800, Wen Congyang wrote: >> On 06/19/2015 12:06 AM, Stefan Hajnoczi wrote: >>> On Thu, Jun 18, 2015 at 10:36:39PM +0800, Wen Congyang wrote: At 2015/6/18 20:55, Stefan Hajnoczi Wrote: > On Thu, Jun 18, 20

Re: [Qemu-block] [PATCH] block.c: fix real cdrom detection

2015-06-23 Thread Programmingkid
On Jun 23, 2015, at 2:06 PM, John Snow wrote: > > > On 06/23/2015 01:56 PM, Programmingkid wrote: >> Fix real cdrom detection so that a real cdrom can actually be used. >> >> signed-off-by: John Arbuckle > > >> >> This patch has been tested on Mac OS X host a

Re: [Qemu-block] [PATCH] block.c: fix real cdrom detection

2015-06-23 Thread John Snow
On 06/23/2015 01:56 PM, Programmingkid wrote: > Fix real cdrom detection so that a real cdrom can actually be used. > > signed-off-by: John Arbuckle > > > This patch has been tested on Mac OS X host and guest. > Command used: qemu-system-ppc -cdrom /dev/cdrom

Re: [Qemu-block] [Qemu-devel] [PATCH 0/9] block: add differential backup support

2015-06-23 Thread John Snow
Ping. (Oh, I forgot to CC Stefan originally. :\) Stefan: I know you said this wasn't expressly requisite, but I was encouraged by Kevin to send it out as a usability patch for non-libvirt users, so here it is. Final "Yeah sure" or "No, definitely not" as 2.4 approaches? Also note that if the an

Re: [Qemu-block] [PATCH v8 00/11] Support streaming to an intermediate layer

2015-06-23 Thread Stefan Hajnoczi
On Tue, Jun 23, 2015 at 5:09 PM, Alberto Garcia wrote: > On Tue 23 Jun 2015 05:36:32 PM CEST, Stefan Hajnoczi wrote: > >> Did you try qemu-iotests? I'm still getting: >> >> 030 11s ... [failed, exit status 1] - output mismatch (see >> 030.out.bad) > > Yes, it works fine here. > >> +Traceback (mos

Re: [Qemu-block] [PATCH v8 00/11] Support streaming to an intermediate layer

2015-06-23 Thread Alberto Garcia
On Tue 23 Jun 2015 05:36:32 PM CEST, Stefan Hajnoczi wrote: > Did you try qemu-iotests? I'm still getting: > > 030 11s ... [failed, exit status 1] - output mismatch (see > 030.out.bad) Yes, it works fine here. > +Traceback (most recent call last): > + File "030", line 202, in test_stream_paral

Re: [Qemu-block] [PATCH 04/16] ahci: check for ncq prdtl overflow

2015-06-23 Thread John Snow
On 06/23/2015 09:46 AM, Stefan Hajnoczi wrote: > On Mon, Jun 22, 2015 at 10:08:22AM -0400, John Snow wrote: >> (sector_count == 0 means 64K sectors, though, like it does in regular >> ATA.) > > I don't see a case to handle this. > I apologize: Corrected in [PATCH 09/16] ahci: correct ncq sect

Re: [Qemu-block] [PATCH v8 00/11] Support streaming to an intermediate layer

2015-06-23 Thread Stefan Hajnoczi
On Tue, Jun 23, 2015 at 12:32:15AM +0300, Alberto Garcia wrote: > v8: > - Rebased on top of Stefan's block branch (0a35bce416) > - The loop that pauses the block jobs in bdrv_drain_all() is now split > in two: one that iterates the list of block jobs to stop them, and > one that iterates the ro

Re: [Qemu-block] [PATCH v5 0/5] Some fixes related to scsi-generic

2015-06-23 Thread Stefan Hajnoczi
On Tue, Jun 23, 2015 at 01:44:55PM +0300, Dimitris Aragiorgis wrote: > Hi all, > > These five patches make slight changes to the way QEMU handles SCSI > generic devices to fix a number of small problems. > > I am sending them against the master branch, since I don't know if they > can be consider

[Qemu-block] [PATCH v2 for-2.4 0/3] block: Improve warnings for doubly-connected drives

2015-06-23 Thread Peter Maydell
This patchset attempts to improve the warning and error messages for bad user command lines that attempt to connect a drive up to two devices. The motivation here is patch #4, which changes the default interface for the virt board to virtio. That will break some existing command lines which forgot

[Qemu-block] [PATCH v2 for-2.4 1/3] qdev-properties-system: Change set_pointer's parse callback to use Error

2015-06-23 Thread Peter Maydell
Instead of having set_pointer() call a parse callback which returns an error number that we then convert to an Error string with error_set_from_qdev_prop_error(), make the parse callback take an Error** and set the error itself. This will allow parse routines to provide more helpful error messages

Re: [Qemu-block] [PATCH v5 5/5] raw-posix: Introduce hdev_is_sg()

2015-06-23 Thread Stefan Hajnoczi
On Tue, Jun 23, 2015 at 01:45:00PM +0300, Dimitris Aragiorgis wrote: > +static bool hdev_is_sg(BlockDriverState *bs) > +{ > + > +#if defined(__linux__) > + > +struct stat st; > +struct sg_scsi_id scsiid; > +int sg_version; > + > +if (stat(bs->filename, &st) >= 0 && S_ISCHR(st.st_mod

[Qemu-block] [PATCH v2 for-2.4 3/3] hw/arm/virt: Make block devices default to virtio

2015-06-23 Thread Peter Maydell
Now we have virtio-pci, we can make the virt board's default block device type be IF_VIRTIO. This allows users to use simplified command lines that don't have to explicitly create virtio-pci-blk devices; the -hda &c very short options now also work. This means we also need to set no_cdrom to avoid

[Qemu-block] [PATCH v2 for-2.4 2/3] qdev-properties-system: Improve error message for drive assignment conflict

2015-06-23 Thread Peter Maydell
If the user forgot if=none on their drive specification they're likely to get an error message because the drive is assigned once automatically by QEMU and once by the manual id=/drive= user command line specification. Improve the error message produced in this case to explicitly guide the user tow

Re: [Qemu-block] [PATCH 08/16] ahci: clear error register before NCQ cmd

2015-06-23 Thread Stefan Hajnoczi
On Mon, Jun 22, 2015 at 05:51:10PM -0400, John Snow wrote: > Or I'll just ignore this whole train of thought under the premise that > every OS alive will always send an IDENTIFY packet first, and be on my way. Yes, it's not worth worrying about at this stage when guest OSes seem to be happy with Q

Re: [Qemu-block] [PATCH 04/16] ahci: check for ncq prdtl overflow

2015-06-23 Thread Stefan Hajnoczi
On Mon, Jun 22, 2015 at 10:08:22AM -0400, John Snow wrote: > (sector_count == 0 means 64K sectors, though, like it does in regular > ATA.) I don't see a case to handle this. pgpWOsI0WjrsG.pgp Description: PGP signature

Re: [Qemu-block] [Qemu-devel] [PATCH COLO-Block v6 07/16] Add new block driver interface to connect/disconnect the remote target

2015-06-23 Thread Wen Congyang
At 2015/6/23 21:42, Stefan Hajnoczi Wrote: On Mon, Jun 22, 2015 at 09:56:24PM +0800, Wen Congyang wrote: The NBD connect should not be performed during downtime, regardless of whether a monitor command is used or not. Why? NBD connection establishment takes unbounded time. It can extend the

Re: [Qemu-block] [Qemu-devel] [PATCH COLO-Block v6 07/16] Add new block driver interface to connect/disconnect the remote target

2015-06-23 Thread Stefan Hajnoczi
On Mon, Jun 22, 2015 at 09:56:24PM +0800, Wen Congyang wrote: > >The NBD connect should not be performed during downtime, regardless of > >whether a monitor command is used or not. > > Why? NBD connection establishment takes unbounded time. It can extend the downtime period and cause users to no

[Qemu-block] [PATCH 5/5] opts: produce valid command line in qemu_opts_print

2015-06-23 Thread Kővágó, Zoltán
This will let us print options in a format that the user would actually write it on the command line (foo=bar,baz=asd,etc=def), without prepending a spurious comma at the beginning of the list, or quoting values unnecessarily. This patch provides the following changes: * write and id=, if the opti

Re: [Qemu-block] [Qemu-devel] [PATCHv2 for-2.4] block: Auto-generate node_names for each BDS entry

2015-06-23 Thread Markus Armbruster
Paolo Bonzini writes: > On 23/06/2015 11:00, Markus Armbruster wrote: >> My point is: the problem is more general than just block nodes. Doesn't >> mean we mustn't solve the special problem unless we solve the general >> problem. Does mean we should at least try to solve the general problem, >>

[Qemu-block] [PATCH v5 5/5] raw-posix: Introduce hdev_is_sg()

2015-06-23 Thread Dimitris Aragiorgis
Until now, an SG device was identified only by checking if its path started with "/dev/sg". Then, hdev_open() would set the bs->sg flag accordingly. The patch relies on the actual properties of the device instead of the specified file path. To this end, test for an SG device (e.g. /dev/sg0) by ens

[Qemu-block] [PATCH v5 1/5] block: Use bdrv_is_sg() everywhere

2015-06-23 Thread Dimitris Aragiorgis
Instead of checking bs->sg use bdrv_is_sg() consistently throughout the code. Signed-off-by: Dimitris Aragiorgis Reviewed-by: Paolo Bonzini Reviewed-by: Stefan Hajnoczi --- block.c |6 +++--- block/iscsi.c |2 +- block/raw-posix.c |4 ++-- 3 files changed, 6 insertion

[Qemu-block] [PATCH v5 4/5] raw-posix: Use DPRINTF for DEBUG_FLOPPY

2015-06-23 Thread Dimitris Aragiorgis
Get rid of several #ifdef DEBUG_FLOPPY and substitute them with DPRINTF. Signed-off-by: Dimitris Aragiorgis Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi --- block/raw-posix.c | 22 +- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/block/raw-posix.c

[Qemu-block] [PATCH v5 0/5] Some fixes related to scsi-generic

2015-06-23 Thread Dimitris Aragiorgis
Hi all, These five patches make slight changes to the way QEMU handles SCSI generic devices to fix a number of small problems. I am sending them against the master branch, since I don't know if they can be considered bugfixes. Thanks, dimara v5 (rebased to current master): * First use stat() an

[Qemu-block] [PATCH v5 3/5] raw-posix: DPRINTF instead of DEBUG_BLOCK_PRINT

2015-06-23 Thread Dimitris Aragiorgis
Building the QEMU tools fails if we #define DEBUG_BLOCK inside block/raw-posix.c. Here instead of adding qemu-log.o in block-obj-y so that DEBUG_BLOCK_PRINT can be used, we substitute the latter with a simple DPRINTF() (that does not cause bit-rot). Signed-off-by: Dimitris Aragiorgis Reviewed-by:

[Qemu-block] [PATCH v5 2/5] Fix migration in case of scsi-generic

2015-06-23 Thread Dimitris Aragiorgis
During migration, QEMU uses fsync()/fdatasync() on the open file descriptor for read-write block devices to flush data just before stopping the VM. However, fsync() on a scsi-generic device returns -EINVAL which causes the migration to fail. This patch skips flushing data in case of an SG device,

Re: [Qemu-block] [Qemu-devel] [PATCHv2 for-2.4] block: Auto-generate node_names for each BDS entry

2015-06-23 Thread Paolo Bonzini
On 23/06/2015 11:00, Markus Armbruster wrote: > My point is: the problem is more general than just block nodes. Doesn't > mean we mustn't solve the special problem unless we solve the general > problem. Does mean we should at least try to solve the general problem, > and if we fail, try our bes

Re: [Qemu-block] [PATCH v2 3/3] block/nfs: switch to error_init_local

2015-06-23 Thread Michael S. Tsirkin
On Wed, Jun 17, 2015 at 09:32:09AM -0600, Eric Blake wrote: > On 06/17/2015 01:24 AM, Michael S. Tsirkin wrote: > > We probably should just switch everyone, this is > > just to demonstrate the API usage. > > > > Signed-off-by: Michael S. Tsirkin > > --- > > block/nfs.c | 2 +- > > 1 file changed

Re: [Qemu-block] [Qemu-devel] [PATCHv2 for-2.4] block: Auto-generate node_names for each BDS entry

2015-06-23 Thread Markus Armbruster
Copying Paolo for advice on the more general problem. Can you explain why we need this in 2.4? Eric Blake writes: > From: Jeff Cody > > Currently, node_name is only filled in when done so explicitly by the > user. If no node_name is specified, then the node name field is not > populated. Thi

[Qemu-block] [PATCH] block/nfs: add support for setting debug level

2015-06-23 Thread Peter Lieven
upcoming libnfs versions will support logging debug messages. Add support for it in qemu through an URL parameter. Signed-off-by: Peter Lieven --- block/nfs.c | 4 1 file changed, 4 insertions(+) diff --git a/block/nfs.c b/block/nfs.c index ca9e24e..f7388a3 100644 --- a/block/nfs.c +++ b/b

Re: [Qemu-block] [PATCHv2 for-2.4] block: Auto-generate node_names for each BDS entry

2015-06-23 Thread Alberto Garcia
On Tue 23 Jun 2015 01:10:39 AM CEST, Eric Blake wrote: > +#define GEN_NODE_NAME_PREFIX"__qemu##" > +#define GEN_NODE_NAME_MAX_LEN (sizeof(GEN_NODE_NAME_PREFIX) + 8 + 8) > static void bdrv_assign_node_name(BlockDriverState *bs, >const char *node_name, >