Re: [Qemu-devel] [PATCH v2] xen_disk: add discard support

2014-02-24 Thread Olaf Hering
On Sun, Feb 23, Stefano Stabellini wrote: > Given that 4.2 is the first Xen release to have BLKIF_OP_DISCARD, maybe > we could just #define BLKIF_OP_DISCARD 5 in that case? > Do we actually need to #ifndef BLKIF_OP_DISCARD? I will do just the #define and resend with that change. Olaf

Re: [Qemu-devel] [PATCH v2] xen_disk: add discard support

2014-02-23 Thread Stefano Stabellini
On Thu, 20 Feb 2014, Olaf Hering wrote: > On Thu, Feb 20, Stefano Stabellini wrote: > > > On Thu, 6 Feb 2014, Olaf Hering wrote: > > > @@ -253,6 +254,8 @@ static int ioreq_parse(struct ioreq *ioreq) > > > case BLKIF_OP_WRITE: > > > ioreq->prot = PROT_READ; /* from memory */ > > >

Re: [Qemu-devel] [PATCH v2] xen_disk: add discard support

2014-02-20 Thread Olaf Hering
On Thu, Feb 20, Stefano Stabellini wrote: > On Thu, 6 Feb 2014, Olaf Hering wrote: > > @@ -253,6 +254,8 @@ static int ioreq_parse(struct ioreq *ioreq) > > case BLKIF_OP_WRITE: > > ioreq->prot = PROT_READ; /* from memory */ > > break; > > +case BLKIF_OP_DISCARD: > > +

Re: [Qemu-devel] [PATCH v2] xen_disk: add discard support

2014-02-20 Thread Stefano Stabellini
On Thu, 20 Feb 2014, Olaf Hering wrote: > On Thu, Feb 20, Stefano Stabellini wrote: > > > On Thu, 6 Feb 2014, Olaf Hering wrote: > > > @@ -253,6 +254,8 @@ static int ioreq_parse(struct ioreq *ioreq) > > > case BLKIF_OP_WRITE: > > > ioreq->prot = PROT_READ; /* from memory */ > > >

Re: [Qemu-devel] [PATCH v2] xen_disk: add discard support

2014-02-20 Thread Olaf Hering
On Thu, Feb 20, Stefano Stabellini wrote: > On Thu, 6 Feb 2014, Olaf Hering wrote: > > @@ -253,6 +254,8 @@ static int ioreq_parse(struct ioreq *ioreq) > > case BLKIF_OP_WRITE: > > ioreq->prot = PROT_READ; /* from memory */ > > break; > > +case BLKIF_OP_DISCARD: > > +

Re: [Qemu-devel] [PATCH v2] xen_disk: add discard support

2014-02-20 Thread Stefano Stabellini
On Thu, 6 Feb 2014, Olaf Hering wrote: > @@ -253,6 +254,8 @@ static int ioreq_parse(struct ioreq *ioreq) > case BLKIF_OP_WRITE: > ioreq->prot = PROT_READ; /* from memory */ > break; > +case BLKIF_OP_DISCARD: > +return 0; > default: > xen_be_printf(&b

[Qemu-devel] [PATCH v2] xen_disk: add discard support

2014-02-06 Thread Olaf Hering
Implement discard support for xen_disk. It makes use of the existing discard code in qemu. The discard support is enabled unconditionally. The tool stack may provide a property "discard-enable" in the backend node to optionally disable discard support. This is helpful in case the backing file was