diff mbox

[PATCHv8,0/5] block: add native support for NFS

Message ID 20140131160720.GC15009@stefanha-thinkpad.redhat.com
State New
Headers show

Commit Message

Stefan Hajnoczi Jan. 31, 2014, 4:07 p.m. UTC
On Fri, Jan 31, 2014 at 12:38:48PM +0100, Peter Lieven wrote:
> This adds v6 of the NFS protocol driver + qemu-iotest adjustments.
> 
> v7->v8:
>  - bump libnfs requirement to 1.9.2
>  - renamed NFSRPC->status to NFSRPC->ret [Benoit]
>  - avoid double invocation of nfs_client_close in nfs_file_create [Benoit]
>  - fixed error propagation in nfs_file_open [Benoit]

I was able to create a qcow2 image and boot a VM successfully over NFS.

I'm getting qemu-iotests failures:
$ ./check -nfs -qcow2
071 1s ... - output mismatch (see 071.out.bad)

Comments

Peter Lieven Jan. 31, 2014, 5:32 p.m. UTC | #1
Am 31.01.2014 um 17:07 schrieb Stefan Hajnoczi <stefanha@redhat.com>:

> On Fri, Jan 31, 2014 at 12:38:48PM +0100, Peter Lieven wrote:
>> This adds v6 of the NFS protocol driver + qemu-iotest adjustments.
>> 
>> v7->v8:
>> - bump libnfs requirement to 1.9.2
>> - renamed NFSRPC->status to NFSRPC->ret [Benoit]
>> - avoid double invocation of nfs_client_close in nfs_file_create [Benoit]
>> - fixed error propagation in nfs_file_open [Benoit]
> 
> I was able to create a qcow2 image and boot a VM successfully over NFS.

This test is obviously new. It is not suitable for protocols other than file as it seems (as a lot
of other tests). The file not found error looks like it and not a problem with the driver itself.
I think it needs to be adjusted to work with file only for now.

Peter



> 
> I'm getting qemu-iotests failures:
> $ ./check -nfs -qcow2
> 071 1s ... - output mismatch (see 071.out.bad)
> --- 071.out	2014-01-31 13:14:07.066452661 +0100
> +++ 071.out.bad	2014-01-31 16:41:52.824898587 +0100
> @@ -4,29 +4,19 @@
> 
> Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864 
> Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 
> -read 512/512 bytes at offset 0
> -512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 512/512 bytes at offset 229376
> -512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -read 512/512 bytes at offset 229376
> -512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> +qemu-io: can't open device nfs://127.0.0.1//home/stefanha/qemu/tests/qemu-iotests/scratch/t.qcow2: Could not open 'nfs://127.0.0.1//home/stefanha/qemu/tests/qemu-iotests/scratch/t.qcow2.base': No such file or directory
> wrote 512/512 bytes at offset 0
> 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -blkverify: read sector_num=0 nb_sectors=4 contents mismatch in sector 0
> +qemu-io: can't open device nfs://127.0.0.1//home/stefanha/qemu/tests/qemu-iotests/scratch/t.qcow2: Could not open 'nfs://127.0.0.1//home/stefanha/qemu/tests/qemu-iotests/scratch/t.qcow2.base': No such file or directory
> 
> === Testing blkverify through file blockref ===
> 
> Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864 
> Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 
> -read 512/512 bytes at offset 0
> -512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 512/512 bytes at offset 229376
> -512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -read 512/512 bytes at offset 229376
> -512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> +qemu-io: can't open device (null): Could not open 'nfs://127.0.0.1//home/stefanha/qemu/tests/qemu-iotests/scratch/t.qcow2.base': No such file or directory
> wrote 512/512 bytes at offset 0
> 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -blkverify: read sector_num=0 nb_sectors=4 contents mismatch in sector 0
> +qemu-io: can't open device nfs://127.0.0.1//home/stefanha/qemu/tests/qemu-iotests/scratch/t.qcow2: Could not open 'nfs://127.0.0.1//home/stefanha/qemu/tests/qemu-iotests/scratch/t.qcow2.base': No such file or directory
> 
> === Testing blkdebug through filename ===
> 
> @@ -34,7 +24,7 @@
> 
> === Testing blkdebug through file blockref ===
> 
> -read failed: Input/output error
> +qemu-io: can't open device (null): Could not open 'nfs://127.0.0.1//home/stefanha/qemu/tests/qemu-iotests/scratch/t.qcow2': No such file or directory
> 
> === Testing blkdebug on existing block device ===
> 
> @@ -55,8 +45,12 @@
> Testing: -drive file=TEST_DIR/t.IMGFMT,format=IMGFMT,if=none,id=drive0
> QMP_VERSION
> {"return": {}}
> +{"error": {"class": "GenericError", "desc": "could not open disk image drive0-verify: Could not open 'TEST_DIR/t.qcow2.base': No such file or directory"}}
> +{"return": "Device 'drive0-verify' not found\r\n"}
> {"return": {}}
> -blkverify: read sector_num=0 nb_sectors=1 contents mismatch in sector 0
> +{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "SHUTDOWN"}
> +{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "ide1-cd0", "tray-open": true}}
> +{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "floppy0", "tray-open": true}}
> 
> 
> === Testing blkverify on existing raw block device ===
> @@ -64,8 +58,12 @@
> Testing: -drive file=TEST_DIR/t.IMGFMT.base,if=none,id=drive0
> QMP_VERSION
> {"return": {}}
> +{"error": {"class": "GenericError", "desc": "could not open disk image drive0-verify: Could not open 'TEST_DIR/t.qcow2': No such file or directory"}}
> +{"return": "Device 'drive0-verify' not found\r\n"}
> {"return": {}}
> -blkverify: read sector_num=0 nb_sectors=1 contents mismatch in sector 0
> +{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "SHUTDOWN"}
> +{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "ide1-cd0", "tray-open": true}}
> +{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "floppy0", "tray-open": true}}
> 
> 
> === Testing blkdebug's set-state through QMP ===
> 072 1s ... - output mismatch (see 072.out.bad)
> --- 072.out	2014-01-31 13:14:07.066452661 +0100
> +++ 072.out.bad	2014-01-31 16:41:53.285899409 +0100
> @@ -9,12 +9,7 @@
> 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> wrote 512/512 bytes at offset 1024
> 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -read 512/512 bytes at offset 0
> -512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -read 512/512 bytes at offset 512
> -512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -read 512/512 bytes at offset 1024
> -512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> +qemu-io: can't open device (null): Could not open 'nfs://127.0.0.1//home/stefanha/qemu/tests/qemu-iotests/scratch/t.qcow2': No such file or directory
> Pattern verification failed at offset 0, 512 bytes
> read 512/512 bytes at offset 0
> 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
Stefan Hajnoczi Jan. 31, 2014, 8:41 p.m. UTC | #2
On Fri, Jan 31, 2014 at 6:32 PM, Peter Lieven <pl@kamp.de> wrote:
>
> Am 31.01.2014 um 17:07 schrieb Stefan Hajnoczi <stefanha@redhat.com>:
>
>> On Fri, Jan 31, 2014 at 12:38:48PM +0100, Peter Lieven wrote:
>>> This adds v6 of the NFS protocol driver + qemu-iotest adjustments.
>>>
>>> v7->v8:
>>> - bump libnfs requirement to 1.9.2
>>> - renamed NFSRPC->status to NFSRPC->ret [Benoit]
>>> - avoid double invocation of nfs_client_close in nfs_file_create [Benoit]
>>> - fixed error propagation in nfs_file_open [Benoit]
>>
>> I was able to create a qcow2 image and boot a VM successfully over NFS.
>
> This test is obviously new. It is not suitable for protocols other than file as it seems (as a lot
> of other tests). The file not found error looks like it and not a problem with the driver itself.
> I think it needs to be adjusted to work with file only for now.

I think you are right.  Max is the author of the tests, he can confirm
that the -o file.file.filename= syntax he used and the blkverify
driver only support the file protocol for now.

Peter: Please send another revision that restricts protocol to 'file'
for these tests.  It can be part of the patch that adjusts the other
test cases.

Stefan
Max Reitz Jan. 31, 2014, 8:46 p.m. UTC | #3
On 31.01.2014 21:41, Stefan Hajnoczi wrote:
> On Fri, Jan 31, 2014 at 6:32 PM, Peter Lieven <pl@kamp.de> wrote:
>> Am 31.01.2014 um 17:07 schrieb Stefan Hajnoczi <stefanha@redhat.com>:
>>
>>> On Fri, Jan 31, 2014 at 12:38:48PM +0100, Peter Lieven wrote:
>>>> This adds v6 of the NFS protocol driver + qemu-iotest adjustments.
>>>>
>>>> v7->v8:
>>>> - bump libnfs requirement to 1.9.2
>>>> - renamed NFSRPC->status to NFSRPC->ret [Benoit]
>>>> - avoid double invocation of nfs_client_close in nfs_file_create [Benoit]
>>>> - fixed error propagation in nfs_file_open [Benoit]
>>> I was able to create a qcow2 image and boot a VM successfully over NFS.
>> This test is obviously new. It is not suitable for protocols other than file as it seems (as a lot
>> of other tests). The file not found error looks like it and not a problem with the driver itself.
>> I think it needs to be adjusted to work with file only for now.
> I think you are right.  Max is the author of the tests, he can confirm
> that the -o file.file.filename= syntax he used and the blkverify
> driver only support the file protocol for now.

Yes, you are correct. Sorry for not checking whether this test is really 
generic, neither regarding the format tested nor the protocol.

Max

> Peter: Please send another revision that restricts protocol to 'file'
> for these tests.  It can be part of the patch that adjusts the other
> test cases.
>
> Stefan
Peter Lieven Feb. 2, 2014, 5:41 p.m. UTC | #4
Am 31.01.2014 um 21:41 schrieb Stefan Hajnoczi <stefanha@gmail.com>:

> On Fri, Jan 31, 2014 at 6:32 PM, Peter Lieven <pl@kamp.de> wrote:
>> 
>> Am 31.01.2014 um 17:07 schrieb Stefan Hajnoczi <stefanha@redhat.com>:
>> 
>>> On Fri, Jan 31, 2014 at 12:38:48PM +0100, Peter Lieven wrote:
>>>> This adds v6 of the NFS protocol driver + qemu-iotest adjustments.
>>>> 
>>>> v7->v8:
>>>> - bump libnfs requirement to 1.9.2
>>>> - renamed NFSRPC->status to NFSRPC->ret [Benoit]
>>>> - avoid double invocation of nfs_client_close in nfs_file_create [Benoit]
>>>> - fixed error propagation in nfs_file_open [Benoit]
>>> 
>>> I was able to create a qcow2 image and boot a VM successfully over NFS.
>> 
>> This test is obviously new. It is not suitable for protocols other than file as it seems (as a lot
>> of other tests). The file not found error looks like it and not a problem with the driver itself.
>> I think it needs to be adjusted to work with file only for now.
> 
> I think you are right.  Max is the author of the tests, he can confirm
> that the -o file.file.filename= syntax he used and the blkverify
> driver only support the file protocol for now.
> 
> Peter: Please send another revision that restricts protocol to 'file'
> for these tests.  It can be part of the patch that adjusts the other
> test cases.

Will do on Monday.

Peter
diff mbox

Patch

--- 071.out	2014-01-31 13:14:07.066452661 +0100
+++ 071.out.bad	2014-01-31 16:41:52.824898587 +0100
@@ -4,29 +4,19 @@ 
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864 
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 
-read 512/512 bytes at offset 0
-512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 512/512 bytes at offset 229376
-512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-read 512/512 bytes at offset 229376
-512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+qemu-io: can't open device nfs://127.0.0.1//home/stefanha/qemu/tests/qemu-iotests/scratch/t.qcow2: Could not open 'nfs://127.0.0.1//home/stefanha/qemu/tests/qemu-iotests/scratch/t.qcow2.base': No such file or directory
 wrote 512/512 bytes at offset 0
 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-blkverify: read sector_num=0 nb_sectors=4 contents mismatch in sector 0
+qemu-io: can't open device nfs://127.0.0.1//home/stefanha/qemu/tests/qemu-iotests/scratch/t.qcow2: Could not open 'nfs://127.0.0.1//home/stefanha/qemu/tests/qemu-iotests/scratch/t.qcow2.base': No such file or directory
 
 === Testing blkverify through file blockref ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864 
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 
-read 512/512 bytes at offset 0
-512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 512/512 bytes at offset 229376
-512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-read 512/512 bytes at offset 229376
-512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+qemu-io: can't open device (null): Could not open 'nfs://127.0.0.1//home/stefanha/qemu/tests/qemu-iotests/scratch/t.qcow2.base': No such file or directory
 wrote 512/512 bytes at offset 0
 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-blkverify: read sector_num=0 nb_sectors=4 contents mismatch in sector 0
+qemu-io: can't open device nfs://127.0.0.1//home/stefanha/qemu/tests/qemu-iotests/scratch/t.qcow2: Could not open 'nfs://127.0.0.1//home/stefanha/qemu/tests/qemu-iotests/scratch/t.qcow2.base': No such file or directory
 
 === Testing blkdebug through filename ===
 
@@ -34,7 +24,7 @@ 
 
 === Testing blkdebug through file blockref ===
 
-read failed: Input/output error
+qemu-io: can't open device (null): Could not open 'nfs://127.0.0.1//home/stefanha/qemu/tests/qemu-iotests/scratch/t.qcow2': No such file or directory
 
 === Testing blkdebug on existing block device ===
 
@@ -55,8 +45,12 @@ 
 Testing: -drive file=TEST_DIR/t.IMGFMT,format=IMGFMT,if=none,id=drive0
 QMP_VERSION
 {"return": {}}
+{"error": {"class": "GenericError", "desc": "could not open disk image drive0-verify: Could not open 'TEST_DIR/t.qcow2.base': No such file or directory"}}
+{"return": "Device 'drive0-verify' not found\r\n"}
 {"return": {}}
-blkverify: read sector_num=0 nb_sectors=1 contents mismatch in sector 0
+{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "SHUTDOWN"}
+{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "ide1-cd0", "tray-open": true}}
+{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "floppy0", "tray-open": true}}
 
 
 === Testing blkverify on existing raw block device ===
@@ -64,8 +58,12 @@ 
 Testing: -drive file=TEST_DIR/t.IMGFMT.base,if=none,id=drive0
 QMP_VERSION
 {"return": {}}
+{"error": {"class": "GenericError", "desc": "could not open disk image drive0-verify: Could not open 'TEST_DIR/t.qcow2': No such file or directory"}}
+{"return": "Device 'drive0-verify' not found\r\n"}
 {"return": {}}
-blkverify: read sector_num=0 nb_sectors=1 contents mismatch in sector 0
+{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "SHUTDOWN"}
+{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "ide1-cd0", "tray-open": true}}
+{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "floppy0", "tray-open": true}}
 
 
 === Testing blkdebug's set-state through QMP ===
072 1s ... - output mismatch (see 072.out.bad)
--- 072.out	2014-01-31 13:14:07.066452661 +0100
+++ 072.out.bad	2014-01-31 16:41:53.285899409 +0100
@@ -9,12 +9,7 @@ 
 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 512/512 bytes at offset 1024
 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-read 512/512 bytes at offset 0
-512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-read 512/512 bytes at offset 512
-512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-read 512/512 bytes at offset 1024
-512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+qemu-io: can't open device (null): Could not open 'nfs://127.0.0.1//home/stefanha/qemu/tests/qemu-iotests/scratch/t.qcow2': No such file or directory
 Pattern verification failed at offset 0, 512 bytes
 read 512/512 bytes at offset 0
 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)