Bug 1159728

Summary: add blockdev-add support with libiscsi backends
Product: Red Hat Enterprise Linux 7 Reporter: Sibiao Luo <sluo>
Component: qemu-kvm-rhevAssignee: Kevin Wolf <kwolf>
Status: CLOSED ERRATA QA Contact: Suqin Huang <shuang>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.4CC: aliang, armbru, chayang, coli, famz, hannsj_uhl, hhuang, jomiller, juzhang, kwolf, meyang, michen, mrezanin, mzhan, ngu, pbonzini, pingl, qzhang, rbalakri, virt-bugs, virt-maint, xfu, xuwei
Target Milestone: rc   
Target Release: 7.4   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: qemu-kvm-rhev-2.9.0-1.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1086677 Environment:
Last Closed: 2017-08-01 23:27:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1086677    
Bug Blocks: 750801, 1289208    

Comment 1 Sibiao Luo 2014-11-03 07:58:17 UTC
host info:
# uname -r && rpm -q qemu-kvm-rhev
3.10.0-191.el7.x86_64
qemu-kvm-rhev-2.1.2-5.el7.x86_64

# qemu-img info iscsi://10.66.9.23:3260/iqn.2014-11.com.sluo:server.target0/1
image: iscsi://10.66.9.23:3260/iqn.2014-11.com.sluo:server.target0/1
file format: raw
virtual size: 10G (10737418240 bytes)
disk size: unavailable


{"execute":"qmp_capabilities"}
{"return": {}}
{ "execute": "blockdev-add", "arguments": {'options' : {'driver': 'raw', 'id':'drive-disk1', 'file': {'driver': 'file', 'filename': 'iscsi://10.66.9.23:3260/iqn.2014-11.com.sluo:server.target0/1'}, 'cache': { 'writeback': false, 'direct': true, 'no-flush': false }}} }
{"error": {"class": "GenericError", "desc": "could not open disk image drive-disk1: Could not open 'iscsi://10.66.9.23:3260/iqn.2014-11.com.sluo:server.target0/1': No such file or directory"}}

Comment 6 Ademar Reis 2017-03-31 21:33:41 UTC
blockdev-add is declared stable in QEMU-2.9.

Comment 7 Suqin Huang 2017-04-27 03:10:03 UTC
package:
qemu-kvm-rhev-2.9.0-1.el7.x86_64

Result:
1. I can get the block from info pci
-  Bus  0, device   4, function 0:
-    SCSI controller: PCI device 1af4:1001
-      IRQ 0.
-      BAR0: I/O at 0x1000 [0x103f].
-      BAR1: 32 bit memory at 0x80004000 [0x80004fff].
-      BAR4: 64 bit prefetchable memory at 0x80000000 [0x80003fff].
-      id "shuang"

2. I could not get block from info block (Do I need to open a new bug?)

(qemu) info block
drive_image1 (#block139): /root/rhel74-64-virtio.qcow2 (qcow2)
    Cache mode:       writeback, direct

3. I can get block from guest

vda                               252:0    0  20G  0 disk 
├─vda1                            252:1    0   1G  0 part /boot
└─vda2                            252:2    0  19G  0 part 
  ├─rhel_bootp--73--199--239-root 253:0    0  17G  0 lvm  /
  └─rhel_bootp--73--199--239-swap 253:1    0   2G  0 lvm  [SWAP]
vdb                               252:16   0   1G  0 disk 


steps:
1. 
qemu-img create -f qcow2 iscsi://10.73.199.233/iqn.2017-04.com.example:t3/0 1G
Formatting 'iscsi://10.73.199.233/iqn.2017-04.com.example:t3/0', fmt=qcow2 size=1073741824 encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16

2. 

{
    "execute": "blockdev-add",
        "arguments": {
            "node-name": "drive2",
            "driver": "qcow2",
            "file": {
                "driver":"iscsi",
                "transport":"tcp",
                "portal":"10.73.199.233",
                "initiator-name":"iqn.2008-11.org.linux-kvm",
                "target":"iqn.2017-04.com.example:t3",
                "lun":0
            }
        }
}
{"return": {}}

3. 

{
    "execute":"device_add",
        "arguments":{
            "driver":"virtio-blk-pci",
            "drive":"drive2",
            "id":"shuang"
                   }
}
{"return": {}}

4. Check the block 

(qemu) info block
drive_image1 (#block110): /root/rhel74-64-virtio.qcow2 (qcow2)
    Cache mode:       writeback, direct

5.

Comment 8 Suqin Huang 2017-04-27 03:12:54 UTC
Hi Kevin,

I can get block info from "info pci" and guest, but no block info in "info block", do I need to create a new bug for it ?

(qemu) info block
drive_image1 (#block139): /root/rhel74-64-virtio.qcow2 (qcow2)
    Cache mode:       writeback, direct

Comment 10 Kevin Wolf 2017-04-27 15:05:24 UTC
(In reply to Suqin Huang from comment #8)
> I can get block info from "info pci" and guest, but no block info in "info
> block", do I need to create a new bug for it ?

We know that this can still be improved. For now, please use 'info block -n'
for nodes that don't have a named BlockBackend, such as nodes created by
blockdev-add or the -blockdev command line option.

Comment 11 Suqin Huang 2017-04-28 05:59:31 UTC
(qemu) info block -n
drive2: json:{"driver": "qcow2", "file": {"lun": 0, "portal": "10.73.199.233", "initiator-name": "iqn.2008-11.org.linux-kvm", "driver": "iscsi", "transport": "tcp", "target": "iqn.2017-04.com.example:t3"}} (qcow2)
    Cache mode:       writeback

Comment 12 Suqin Huang 2017-04-28 06:00:21 UTC
According to comment7 and comment11, bug is fixed. update to verified

Comment 14 errata-xmlrpc 2017-08-01 23:27:12 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2017:2392

Comment 15 errata-xmlrpc 2017-08-02 01:04:50 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2017:2392

Comment 16 errata-xmlrpc 2017-08-02 01:56:50 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2017:2392

Comment 17 errata-xmlrpc 2017-08-02 02:37:35 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2017:2392

Comment 18 errata-xmlrpc 2017-08-02 03:02:18 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2017:2392

Comment 19 errata-xmlrpc 2017-08-02 03:22:27 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2017:2392