Skip to contentSkip to conversation

blkif.h: document scsi/0x12/0x83 node

RFC PATCH In review Bob Liu 6 participants 27 messages Mar 16, 2016 – Mar 22, 2016

lore
Share & tools
lore

Bob Liu

author
#0 lore raw

RFC PATCH 1/1 blkif.h: document scsi/0x12/0x83 node

Sometimes, we need to query VPD page=0x83 data from underlying storage so that vendor supplied software can run inside the VM and believe it's talking to the vendor's own storage.
But different vendors may have different special features, so it's not suitable to export through "feature-xxxx".

One solution is query the whole VPD page through Xenstore node, which has already been used by windows pv driver.
http://xenbits.xen.org/gitweb/?p=pvdrivers/win/xenvbd.git;a=blob;f=src/xenvbd/pdoinquiry.c

This patch documents the Xenstore node to blkif.h, so that blkfront in Linux and other frontends can use the same mechanism.

---
 xen/include/public/io/blkif.h |    8 ++++++++
 1 file changed, 8 insertions(+)
xen/include/public/io/blkif.h +8 -0
index 99f0326..30a6e46 100644
@@ -182,6 +182,14 @@
  *      backend driver paired with a LIFO queue in the frontend will
  *      allow us to have better performance in this scenario.
  *
+ * scsi/0x12/0x83
+ * 	Values:	string
+ *
+ * 	A base64 formatted string providing VPD pages read out from backend
+ * 	device.
+ * 	The backend driver or the toolstack should write this node with VPD
+ * 	informations when attaching devices.
+ *
  *----------------------- Request Transport Parameters ------------------------
  *
  * max-ring-page-order
Signature · 7 lines
1.7.10.4


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#1 lore raw
Quoted 23 lines · Bob Liu

Sometimes, we need to query VPD page=0x83 data from underlying storage so that vendor supplied software can run inside the VM and believe it's talking to the vendor's own storage.
But different vendors may have different special features, so it's not suitable to export through "feature-xxxx".

One solution is query the whole VPD page through Xenstore node, which has already been used by windows pv driver.
http://xenbits.xen.org/gitweb/?p=pvdrivers/win/xenvbd.git;a=blob;f=src/xenvbd/pdoinquiry.c

This patch documents the Xenstore node to blkif.h, so that blkfront in Linux and other frontends can use the same mechanism.

---
 xen/include/public/io/blkif.h |    8 ++++++++
 1 file changed, 8 insertions(+)
xen/include/public/io/blkif.h +0 -0
index 99f0326..30a6e46 100644

xen/include/public/io/blkif.h line 185

Quoted 4 lines
xen/include/public/io/blkif.h +1 -0
@@ -182,6 +182,14 @@
  *      backend driver paired with a LIFO queue in the frontend will
  *      allow us to have better performance in this scenario.
  *
+ * scsi/0x12/0x83

Could you mention that 0x12 is the SCSI opcode for INQUIRY and 0x83 is for device identity.

There is also the 0x80 with serial number (useful?)

Quoted 13 lines
xen/include/public/io/blkif.h +7 -0
+ * 	Values:	string
+ *
+ * 	A base64 formatted string providing VPD pages read out from backend
+ * 	device.
+ * 	The backend driver or the toolstack should write this node with VPD
+ * 	informations when attaching devices.
+ *
  *----------------------- Request Transport Parameters ------------------------
  *
  * max-ring-page-order
Signature · 1 line
1.7.10.4

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#2 lore raw
In reply to Bob Liu

Bob Liu writes ("[RFC PATCH] blkif.h: document scsi/0x12/0x83 node"):

Quoted 9 lines

Sometimes, we need to query VPD page=0x83 data from underlying storage so that vendor supplied software can run inside the VM and believe it's talking to the vendor's own storage. But different vendors may have different special features, so it's not suitable to export through "feature-xxxx".

One solution is query the whole VPD page through Xenstore node, which has already been used by windows pv driver.
http://xenbits.xen.org/gitweb/?p=pvdrivers/win/xenvbd.git;a=blob;f=src/xenvbd/pdoinquiry.c

Thanks for your contribution.

Thanks also to Konrad for decoding the numbers, which really helps me understand what is going on here and helped me find the relevant references.

(For background: I have just double-checked the SCSI spec and: INQUIRY lets you query either the standard page, or one of a number of `vital product data' pages, each identified by an 8-bit page number. The VPD pages are mostly full of vendor-specific data in vendor-specific format.)

I have some qualms about the approach you have adopted. It is difficult to see how this feature could be used safely without knowledge specific to the storage vendor.

But I think it is probably OK to define a specification along these lines provided that it is very clear that if you aren't the storage vendor and you use this and something breaks, you get to keep all the pieces.

Quoted 4 lines

+ * scsi/0x12/0x83
+ * Values: string
+ * A base64 formatted string providing VPD pages read out from backend
+ * device.

I think this probably isn't the prettiest name for this node or necessarily the best format but given that this protocol is already deployed, and this syntax will do, I don't want to quibble.

I would like the base64 encoding to specified much more explicitly. Just `base64 formatted' is too vague.

Quoted 2 lines

+ * The backend driver or the toolstack should write this node with VPD
+ * informations when attaching devices.

I think this is the wrong semantics. I certainly don't want to encourage backends to use this feature.

Rather, I would prefer something like this:

* scsi/0x12/0x<NN>

This optional node contains SCSI INQUIRY VPD information. <NN> is the hexadecimal representation of the VPD page code.

A frontend which represents a Xen VBD to its containing operating system as a (virtual) SCSI target may return the specified data in response to INQUIRY commands from its containing OS.

A frontend which supports this feature must return the backend- specified data for every INQUIRY command with the EVPD bit set. For EVPD=1 INQUIRY commands where the corresponding xenstore node does not exist, the frontend must report (to its containing OS) an appropriate failure condition.

A frontend which does not support this feature (ie, which does not use these xenstore nodes), and which presents as a SCSI target to its containing OS, should support and provide whatever VPD information it considers appropriate, and should disregard these xenstore nodes.

A frontend need not - and often will not - present to its containing OS as a device addressable with SCSI CDBs. Such a frontend has no use for SCSI INQUIRY VPD information.

A backend should set this information with caution. Pages containing device-vendor-specific information should not be specified without the appropriate device-vendor-specific knowledge.

Also I have two other observations:

Firstly, AFAICT you have not provided any way to set the standard INQUIRY response. Is it not necessary in your application to provide synthetic vendorid and productid, at the very least ?

Secondly, I think your hope that

Quoted 1 line

blkfront in Linux ... can use the same mechanism.

is I think misguided. blkfront does not present the disk (to the rest of the Linux storage system) as a SCSI device. Rather, Linux allows blkfront to present as a block device, directly, and this is what blkfront does.

So blkfront would not consume this data.

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

author
#3 lore raw
Quoted 74 lines · Ian Jackson

Bob Liu writes ("[RFC PATCH] blkif.h: document scsi/0x12/0x83 node"):

Quoted 9 lines

Sometimes, we need to query VPD page=0x83 data from underlying storage so that vendor supplied software can run inside the VM and believe it's talking to the vendor's own storage. But different vendors may have different special features, so it's not suitable to export through "feature-xxxx".

One solution is query the whole VPD page through Xenstore node, which has already been used by windows pv driver.
http://xenbits.xen.org/gitweb/?p=pvdrivers/win/xenvbd.git;a=blob;f=src/xenvbd/pdoinquiry.c

Thanks for your contribution.

Thanks also to Konrad for decoding the numbers, which really helps me understand what is going on here and helped me find the relevant references.

(For background: I have just double-checked the SCSI spec and: INQUIRY lets you query either the standard page, or one of a number of `vital product data' pages, each identified by an 8-bit page number. The VPD pages are mostly full of vendor-specific data in vendor-specific format.)

I have some qualms about the approach you have adopted. It is difficult to see how this feature could be used safely without knowledge specific to the storage vendor.

But I think it is probably OK to define a specification along these lines provided that it is very clear that if you aren't the storage vendor and you use this and something breaks, you get to keep all the pieces.

Quoted 4 lines

+ * scsi/0x12/0x83
+ * Values: string
+ * A base64 formatted string providing VPD pages read out from backend
+ * device.

I think this probably isn't the prettiest name for this node or necessarily the best format but given that this protocol is already deployed, and this syntax will do, I don't want to quibble.

I would like the base64 encoding to specified much more explicitly. Just `base64 formatted' is too vague.

Quoted 2 lines

+ * The backend driver or the toolstack should write this node with VPD
+ * informations when attaching devices.

I think this is the wrong semantics. I certainly don't want to encourage backends to use this feature.

Rather, I would prefer something like this:

* scsi/0x12/0x<NN>

This optional node contains SCSI INQUIRY VPD information. <NN> is the hexadecimal representation of the VPD page code.

A frontend which represents a Xen VBD to its containing operating system as a (virtual) SCSI target may return the specified data in response to INQUIRY commands from its containing OS.

A frontend which supports this feature must return the backend- specified data for every INQUIRY command with the EVPD bit set. For EVPD=1 INQUIRY commands where the corresponding xenstore node does not exist, the frontend must report (to its containing OS) an appropriate failure condition.

A frontend which does not support this feature (ie, which does not use these xenstore nodes), and which presents as a SCSI target to its containing OS, should support and provide whatever VPD information it considers appropriate, and should disregard these xenstore nodes.

Quoted 8 lines

A frontend need not - and often will not - present to its containing OS as a device addressable with SCSI CDBs. Such a frontend has no use for SCSI INQUIRY VPD information.

A backend should set this information with caution. Pages containing device-vendor-specific information should not be specified without the appropriate device-vendor-specific knowledge.

That's much more clear, thank you very much!

Quoted 5 lines

Also I have two other observations:

Firstly, AFAICT you have not provided any way to set the standard INQUIRY response. Is it not necessary in your application to provide

If backends are not encouraged to use this node, then we must have the toolstack write this node with the right VPD information. Paul mentioned there should be corresponding code in the xapi project, but I haven't found out where.

Quoted 11 lines

synthetic vendorid and productid, at the very least ?

Secondly, I think your hope that

Quoted 1 line

blkfront in Linux ... can use the same mechanism.

is I think misguided. blkfront does not present the disk (to the rest of the Linux storage system) as a SCSI device. Rather, Linux allows blkfront to present as a block device, directly, and this is what blkfront does.

But we'd like to get the VPD information(of underlying storage device) also in Linux blkfront, even blkfront is not a SCSI device.

That's because our underlying storage device has some vendor-specific features which can be recognized through informations in VPD pages. And Our applications in guest want to aware of these vendor-specific features.

Regards,
Bob

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#4 lore raw
Quoted 123 lines

-----Original Message-----
From: Bob Liu [mailto:[email protected]]
Sent: 16 March 2016 13:59
To: Ian Jackson
Cc: [email protected]; Paul Durrant; [email protected]; [email protected]; Roger Pau Monne; [email protected]
Subject: Re: [RFC PATCH] blkif.h: document scsi/0x12/0x83 node

Quoted 8 lines · Ian Jackson

Bob Liu writes ("[RFC PATCH] blkif.h: document scsi/0x12/0x83 node"):

Quoted 7 lines

Sometimes, we need to query VPD page=0x83 data from underlying storage so that vendor supplied software can run inside the VM and believe it's talking to the vendor's own storage. But different vendors may have different special features, so it's not suitable to export through "feature-xxxx".

One solution is query the whole VPD page through Xenstore node, which

has

Quoted 2 lines
Quoted 2 lines

already been used by windows pv driver.

http://xenbits.xen.org/gitweb/?p=pvdrivers/win/xenvbd.git;a=blob;f=src/x
envbd/pdoinquiry.c

Quoted 13 lines

Thanks for your contribution.

Thanks also to Konrad for decoding the numbers, which really helps me understand what is going on here and helped me find the relevant references.

(For background: I have just double-checked the SCSI spec and: INQUIRY lets you query either the standard page, or one of a number of `vital product data' pages, each identified by an 8-bit page number. The VPD pages are mostly full of vendor-specific data in vendor-specific format.)

Quoted 12 lines

I have some qualms about the approach you have adopted. It is difficult to see how this feature could be used safely without knowledge specific to the storage vendor.

But I think it is probably OK to define a specification along these lines provided that it is very clear that if you aren't the storage vendor and you use this and something breaks, you get to keep all the pieces.

Quoted 3 lines

+ * scsi/0x12/0x83
+ * Values: string
+ * A base64 formatted string providing VPD pages read out from

backend

Quoted 39 lines
Quoted 1 line

+ * device.

I think this probably isn't the prettiest name for this node or necessarily the best format but given that this protocol is already deployed, and this syntax will do, I don't want to quibble.

I would like the base64 encoding to specified much more explicitly. Just `base64 formatted' is too vague.

Quoted 2 lines

+ * The backend driver or the toolstack should write this node with VPD
+ * informations when attaching devices.

I think this is the wrong semantics. I certainly don't want to encourage backends to use this feature.

Rather, I would prefer something like this:

* scsi/0x12/0x<NN>

This optional node contains SCSI INQUIRY VPD information. <NN> is the hexadecimal representation of the VPD page code.

A frontend which represents a Xen VBD to its containing operating system as a (virtual) SCSI target may return the specified data in response to INQUIRY commands from its containing OS.

A frontend which supports this feature must return the backend- specified data for every INQUIRY command with the EVPD bit set. For EVPD=1 INQUIRY commands where the corresponding xenstore node does not exist, the frontend must report (to its containing OS) an appropriate failure condition.

A frontend which does not support this feature (ie, which does not use these xenstore nodes), and which presents as a SCSI target to its containing OS, should support and provide whatever VPD information it considers appropriate, and should disregard these xenstore nodes.

Quoted 8 lines

A frontend need not - and often will not - present to its containing OS as a device addressable with SCSI CDBs. Such a frontend has no use for SCSI INQUIRY VPD information.

A backend should set this information with caution. Pages containing device-vendor-specific information should not be specified without the appropriate device-vendor-specific knowledge.

That's much more clear, thank you very much!

Quoted 5 lines

Also I have two other observations:

Firstly, AFAICT you have not provided any way to set the standard INQUIRY response. Is it not necessary in your application to provide

If backends are not encouraged to use this node, then we must have the toolstack write this node with the right VPD information.
Paul mentioned there should be corresponding code in the xapi project, but I haven't found out where.

Quoted 11 lines

synthetic vendorid and productid, at the very least ?

Secondly, I think your hope that

Quoted 1 line

blkfront in Linux ... can use the same mechanism.

is I think misguided. blkfront does not present the disk (to the rest of the Linux storage system) as a SCSI device. Rather, Linux allows blkfront to present as a block device, directly, and this is what blkfront does.

Quoted 7 lines

But we'd like to get the VPD information(of underlying storage device) also in Linux blkfront, even blkfront is not a SCSI device.

That's because our underlying storage device has some vendor-specific features which can be recognized through informations in VPD pages. And Our applications in guest want to aware of these vendor-specific features.

I think the missing piece of the puzzle is how the applications get this information. In Windows, since everything is a SCSI LUN (or has to emulate one) applications just send down 'scsi pass-through' IOCTLs and get the raw INQUIRY data back. In Linux there would need to be some alternative scheme that presumably blkfront would have to support.

Paul

Quoted 4 lines

Regards,
Bob

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#6 lore raw
In reply to Bob Liu
Quoted 2 lines · Bob Liu

But we'd like to get the VPD information(of underlying storage device) also in Linux blkfront, even blkfront is not a SCSI device.

Why does blkback/blkfront need to involved here? This is just some xenstore keys that can be written by the toolstack and directly read by the relevant application in the guest.

David

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#26 lore raw
In reply to Bob Liu

Bob Liu writes ("Re: [RFC PATCH] blkif.h: document scsi/0x12/0x83 node"):

Quoted 2 lines

That's because our underlying storage device has some vendor-specific features which can be recognized through informations in VPD pages. And Our applications in guest want to aware of these vendor-specific features.

What kind of vendor-specific features ? How would the application in the guest make use of them ?

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

author
#5 lore raw
In reply to Paul Durrant
Quoted 2 lines · Paul Durrant
Quoted 2 lines

-----Original Message-----
From: Bob Liu [mailto:[email protected]]

..snip..

Quoted 5 lines
Quoted 5 lines
Quoted 1 line

But we'd like to get the VPD information(of underlying storage device) also in Linux blkfront, even blkfront is not a SCSI device.

Quoted 9 lines
Quoted 4 lines

That's because our underlying storage device has some vendor-specific features which can be recognized through informations in VPD pages. And Our applications in guest want to aware of these vendor-specific features.

I think the missing piece of the puzzle is how the applications get this information.
In Windows, since everything is a SCSI LUN (or has to emulate one) applications just send down 'scsi pass-through' IOCTLs and get the raw INQUIRY data back. In Linux there would need to be some alternative scheme that presumably blkfront would have to support.

They plan to send a REQ_TYPE_BLOCK_PC request down to blkfront, and hoping blkfront can handle this request and return the VPD informations. I'll confirm weather they can read the xenstore node directly.

Signature · 7 lines
Regards,
-Bob

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
author
#7 lore raw
In reply to David Vrabel
Quoted 8 lines · David Vrabel
Quoted 2 lines · Bob Liu

But we'd like to get the VPD information(of underlying storage device) also in Linux blkfront, even blkfront is not a SCSI device.

Why does blkback/blkfront need to involved here? This is just some xenstore keys that can be written by the toolstack and directly read by the relevant application in the guest.

Exactly, let me check if they can direct read this xenstore node.

Signature · 7 lines
Regards,
-Bob

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#8 lore raw
In reply to David Vrabel

David Vrabel writes ("Re: [Xen-devel] [RFC PATCH] blkif.h: document scsi/0x12/0x83 node"):

Quoted 6 lines · Bob Liu
Quoted 1 line

But we'd like to get the VPD information(of underlying storage device) also in Linux blkfront, even blkfront is not a SCSI device.

Why does blkback/blkfront need to involved here? This is just some xenstore keys that can be written by the toolstack and directly read by the relevant application in the guest.

I'm getting rather a different picture here than at first. Previously I thought you had some 3rd-party application, not under your control, which expected to see this VPD data.

But now I think that you're saying the application is under your own control. I don't understand why synthetic VPD data is the best way to give your application the information it needs.

What is the application doing with this VPD data ? I mean, which specific application functions, and how do they depend on the VPD data ?

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#9 lore raw
Quoted 11 lines · Ian Jackson

David Vrabel writes ("Re: [Xen-devel] [RFC PATCH] blkif.h: document scsi/0x12/0x83 node"):

Quoted 6 lines · Bob Liu
Quoted 1 line

But we'd like to get the VPD information(of underlying storage device) also in Linux blkfront, even blkfront is not a SCSI device.

Why does blkback/blkfront need to involved here? This is just some xenstore keys that can be written by the toolstack and directly read by the relevant application in the guest.

I'm getting rather a different picture here than at first. Previously I thought you had some 3rd-party application, not under your control, which expected to see this VPD data.

Bob != David?

Quoted 7 lines

But now I think that you're saying the application is under your own control. I don't understand why synthetic VPD data is the best way to give your application the information it needs.

What is the application doing with this VPD data ? I mean, which specific application functions, and how do they depend on the VPD data ?

David

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#10 lore raw

David Vrabel writes ("Re: [Xen-devel] [RFC PATCH] blkif.h: document scsi/0x12/0x83 node"):

Quoted 9 lines · Ian Jackson
Quoted 8 lines

David Vrabel writes ("Re: [Xen-devel] [RFC PATCH] blkif.h: document scsi/0x12/0x83 node"):

Quoted 6 lines · Bob Liu
Quoted 1 line

But we'd like to get the VPD information(of underlying storage device) also in Linux blkfront, even blkfront is not a SCSI device.

Why does blkback/blkfront need to involved here? This is just some xenstore keys that can be written by the toolstack and directly read by the relevant application in the guest.

Quoted 5 lines
Quoted 3 lines

I'm getting rather a different picture here than at first. Previously I thought you had some 3rd-party application, not under your control, which expected to see this VPD data.

Bob != David?

Sorry, yes, the "you" I refer to above is Bob, not David. I replied to David's message because it seemd to give the best context.

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

author
#11 lore raw
In reply to Ian Jackson
Quoted 8 lines · Ian Jackson

David Vrabel writes ("Re: [Xen-devel] [RFC PATCH] blkif.h: document scsi/0x12/0x83 node"):

Quoted 6 lines · Bob Liu
Quoted 1 line

But we'd like to get the VPD information(of underlying storage device) also in Linux blkfront, even blkfront is not a SCSI device.

Why does blkback/blkfront need to involved here? This is just some xenstore keys that can be written by the toolstack and directly read by the relevant application in the guest.

They want a more generic way because the application may run on all kinds of environment including baremetal. So they prefers to just call ioctl(SG_IO) against a storage device.

Quoted 4 lines

I'm getting rather a different picture here than at first. Previously I thought you had some 3rd-party application, not under your control, which expected to see this VPD data.

Quoted 8 lines

But now I think that you're saying the application is under your own control. I don't understand why synthetic VPD data is the best way to give your application the information it needs.

What is the application doing with this VPD data ? I mean, which specific application functions, and how do they depend on the VPD data ?

From the feedbacks I just got, they do *not* want the details to be in public.

Anyway, I think this is not a block of this patch.
In Windows PV block driver, we already use the same way to get the raw INQUIRY data.
* The Windows PV block driver accepts ioctl(SG_IO).
* Then it reads this /scsi/0x12/0x83 node.
* Then return the raw INQURIY data back to ioctl.

Since Linux guest also wants to do the same thing, let's making this mechanism to be a generic interface! I'll post a patch adding ioctl(SG_IO) support to xen-blkfront together with a updated version of this patch soon.

Thanks,
Bob

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#12 lore raw
Quoted 22 lines · Bob Liu
Quoted 8 lines · Ian Jackson

David Vrabel writes ("Re: [Xen-devel] [RFC PATCH] blkif.h: document scsi/0x12/0x83 node"):

Quoted 6 lines · Bob Liu
Quoted 1 line

But we'd like to get the VPD information(of underlying storage device) also in Linux blkfront, even blkfront is not a SCSI device.

Why does blkback/blkfront need to involved here? This is just some xenstore keys that can be written by the toolstack and directly read by the relevant application in the guest.

They want a more generic way because the application may run on all kinds of environment including baremetal. So they prefers to just call ioctl(SG_IO) against a storage device.

Quoted 8 lines

I'm getting rather a different picture here than at first. Previously I thought you had some 3rd-party application, not under your control, which expected to see this VPD data.

But now I think that you're saying the application is under your own control. I don't understand why synthetic VPD data is the best way to give your application the information it needs.

Quoted 6 lines
Quoted 4 lines

What is the application doing with this VPD data ? I mean, which specific application functions, and how do they depend on the VPD data ?

From the feedbacks I just got, they do *not* want the details to be in public.

It is difficult to suggest how it should be done correctly without this information.

I also find it difficult to see a use case where running the storage software in the guest (instead of in the backend) is sensible or desirable.

Quoted 8 lines

Anyway, I think this is not a block of this patch.
In Windows PV block driver, we already use the same way to get the raw INQUIRY data.
* The Windows PV block driver accepts ioctl(SG_IO).
* Then it reads this /scsi/0x12/0x83 node.
* Then return the raw INQURIY data back to ioctl.

Since Linux guest also wants to do the same thing, let's making this mechanism to be a generic interface! I'll post a patch adding ioctl(SG_IO) support to xen-blkfront together with a updated version of this patch soon.

I do not think this feature is generally useful outside of this unspecified use case. I do not think that supplying details about underlying storage device (beyond generic properties) to guests is sensible (e.g., what if the guest snapshot is restored on different storage?).

And thus I do not not think we should either: a) make this part of the blkif ABI; or b) add support to xen-blkfront or xen-blkback.

David

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#13 lore raw
Quoted 28 lines · David Vrabel
Quoted 27 lines · Bob Liu
Quoted 8 lines · Ian Jackson

David Vrabel writes ("Re: [Xen-devel] [RFC PATCH] blkif.h: document scsi/0x12/0x83 node"):

Quoted 6 lines · Bob Liu
Quoted 1 line

But we'd like to get the VPD information(of underlying storage device) also in Linux blkfront, even blkfront is not a SCSI device.

Why does blkback/blkfront need to involved here? This is just some xenstore keys that can be written by the toolstack and directly read by the relevant application in the guest.

They want a more generic way because the application may run on all kinds of environment including baremetal. So they prefers to just call ioctl(SG_IO) against a storage device.

Quoted 12 lines

I'm getting rather a different picture here than at first. Previously I thought you had some 3rd-party application, not under your control, which expected to see this VPD data.

But now I think that you're saying the application is under your own control. I don't understand why synthetic VPD data is the best way to give your application the information it needs.

What is the application doing with this VPD data ? I mean, which specific application functions, and how do they depend on the VPD data ?

Quoted 4 lines
Quoted 1 line

From the feedbacks I just got, they do *not* want the details to be in public.

It is difficult to suggest how it should be done correctly without this information.

Just think of it as a black box.

Quoted 3 lines

I also find it difficult to see a use case where running the storage software in the guest (instead of in the backend) is sensible or desirable.

Are you suggesting that doing backend drivers is not sensible?

Quoted 7 lines
Quoted 7 lines

Anyway, I think this is not a block of this patch.
In Windows PV block driver, we already use the same way to get the raw INQUIRY data.
* The Windows PV block driver accepts ioctl(SG_IO).
* Then it reads this /scsi/0x12/0x83 node.
* Then return the raw INQURIY data back to ioctl.

Quoted 8 lines
Quoted 2 lines

Since Linux guest also wants to do the same thing, let's making this mechanism to be a generic interface! I'll post a patch adding ioctl(SG_IO) support to xen-blkfront together with a updated version of this patch soon.

I do not think this feature is generally useful outside of this unspecified use case. I do not think that supplying details about underlying storage device (beyond generic properties) to guests is sensible (e.g., what if the guest snapshot is restored on different storage?).

The restore process (xl) can update the XenStore key with the new storage.

Quoted 3 lines

And thus I do not not think we should either: a) make this part of the blkif ABI; or b) add support to xen-blkfront or xen-blkback.

It is already coded in Windows PV drivers so I am not following why codyfing this in the blkif.h is harmful?

Quoted 7 lines

David

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#14 lore raw
Quoted 29 lines · Konrad Rzeszutek Wilk
Quoted 28 lines · David Vrabel
Quoted 27 lines · Bob Liu
Quoted 8 lines · Ian Jackson

David Vrabel writes ("Re: [Xen-devel] [RFC PATCH] blkif.h: document scsi/0x12/0x83 node"):

Quoted 6 lines · Bob Liu
Quoted 1 line

But we'd like to get the VPD information(of underlying storage device) also in Linux blkfront, even blkfront is not a SCSI device.

Why does blkback/blkfront need to involved here? This is just some xenstore keys that can be written by the toolstack and directly read by the relevant application in the guest.

They want a more generic way because the application may run on all kinds of environment including baremetal. So they prefers to just call ioctl(SG_IO) against a storage device.

Quoted 12 lines

I'm getting rather a different picture here than at first. Previously I thought you had some 3rd-party application, not under your control, which expected to see this VPD data.

But now I think that you're saying the application is under your own control. I don't understand why synthetic VPD data is the best way to give your application the information it needs.

What is the application doing with this VPD data ? I mean, which specific application functions, and how do they depend on the VPD data ?

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

From the feedbacks I just got, they do *not* want the details to be in public.

It is difficult to suggest how it should be done correctly without this information.

Just think of it as a black box.

This isn't sufficient.

You are presenting a solution but have not properly described the problem so no one can evaluate whether the solution is appropriate.

Quoted 4 lines
Quoted 2 lines

I also find it difficult to see a use case where running the storage software in the guest (instead of in the backend) is sensible or desirable.

Are you suggesting that doing backend drivers is not sensible?

I do not understand your question.

Quoted 9 lines
Quoted 9 lines
Quoted 8 lines

Anyway, I think this is not a block of this patch.
In Windows PV block driver, we already use the same way to get the raw INQUIRY data.
* The Windows PV block driver accepts ioctl(SG_IO).
* Then it reads this /scsi/0x12/0x83 node.
* Then return the raw INQURIY data back to ioctl.

Since Linux guest also wants to do the same thing, let's making this mechanism to be a generic interface! I'll post a patch adding ioctl(SG_IO) support to xen-blkfront together with a updated version of this patch soon.

Quoted 7 lines
Quoted 5 lines

I do not think this feature is generally useful outside of this unspecified use case. I do not think that supplying details about underlying storage device (beyond generic properties) to guests is sensible (e.g., what if the guest snapshot is restored on different storage?).

The restore process (xl) can update the XenStore key with the new storage.

And how is this going to be communicated to the application using the data?

Quoted 5 lines
Quoted 2 lines

And thus I do not not think we should either: a) make this part of the blkif ABI; or b) add support to xen-blkfront or xen-blkback.

It is already coded in Windows PV drivers so I am not following why codyfing this in the blkif.h is harmful?

My understanding was that this was a legacy hack that should be removed (we do not currently make use of it).

David

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#15 lore raw
Quoted 85 lines

-----Original Message-----
From: David Vrabel [mailto:[email protected]]
Sent: 22 March 2016 14:38
To: Konrad Rzeszutek Wilk
Cc: Bob Liu; Ian Jackson; [email protected]; [email protected]; [email protected]; Paul Durrant; Roger Pau Monne
Subject: Re: [Xen-devel] [RFC PATCH] blkif.h: document scsi/0x12/0x83 node

Quoted 5 lines · Konrad Rzeszutek Wilk
Quoted 4 lines · David Vrabel
Quoted 3 lines · Bob Liu
Quoted 1 line · Ian Jackson

David Vrabel writes ("Re: [Xen-devel] [RFC PATCH] blkif.h: document

scsi/0x12/0x83 node"):

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines · Bob Liu
Quoted 1 line

But we'd like to get the VPD information(of underlying storage

device) also in Linux blkfront, even blkfront is not a SCSI device.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Why does blkback/blkfront need to involved here? This is just some xenstore keys that can be written by the toolstack and directly read

by

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines
Quoted 1 line

the relevant application in the guest.

They want a more generic way because the application may run on all

kinds of environment including baremetal.

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

So they prefers to just call ioctl(SG_IO) against a storage device.

Quoted 8 lines

I'm getting rather a different picture here than at first. Previously I thought you had some 3rd-party application, not under your control, which expected to see this VPD data.

But now I think that you're saying the application is under your own control. I don't understand why synthetic VPD data is the best way to give your application the information it needs.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines

What is the application doing with this VPD data ? I mean, which specific application functions, and how do they depend on the VPD data ?

From the feedbacks I just got, they do *not* want the details to be in

public.

Quoted 5 lines
Quoted 3 lines

It is difficult to suggest how it should be done correctly without this information.

Just think of it as a black box.

This isn't sufficient.

You are presenting a solution but have not properly described the problem so no one can evaluate whether the solution is appropriate.

Quoted 4 lines
Quoted 2 lines

I also find it difficult to see a use case where running the storage software in the guest (instead of in the backend) is sensible or desirable.

Are you suggesting that doing backend drivers is not sensible?

I do not understand your question.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Anyway, I think this is not a block of this patch.
In Windows PV block driver, we already use the same way to get the raw

INQUIRY data.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

* The Windows PV block driver accepts ioctl(SG_IO).
* Then it reads this /scsi/0x12/0x83 node.
* Then return the raw INQURIY data back to ioctl.

Since Linux guest also wants to do the same thing, let's making this

mechanism to be a generic interface!

Quoted 1 line
Quoted 1 line
Quoted 1 line

I'll post a patch adding ioctl(SG_IO) support to xen-blkfront together

with a updated version of this patch soon.

Quoted 8 lines
Quoted 6 lines

I do not think this feature is generally useful outside of this unspecified use case. I do not think that supplying details about underlying storage device (beyond generic properties) to guests is sensible (e.g., what if the guest snapshot is restored on different storage?).

The restore process (xl) can update the XenStore key with the new

storage.

And how is this going to be communicated to the application using the data?

Quoted 9 lines
Quoted 5 lines
Quoted 2 lines

And thus I do not not think we should either: a) make this part of the blkif ABI; or b) add support to xen-blkfront or xen-blkback.

It is already coded in Windows PV drivers so I am not following why codyfing this in the blkif.h is harmful?

My understanding was that this was a legacy hack that should be removed (we do not currently make use of it).

AFAIK XenServer still very much makes use of it.

Paul

Quoted 1 line

David

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#16 lore raw

Paul Durrant writes ("RE: [Xen-devel] [RFC PATCH] blkif.h: document scsi/0x12/0x83 node"):

Quoted 1 line

AFAIK XenServer still very much makes use of it.

Can you answer, for XenServer's use case, some of the questions that David and I have asked ?

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#21 lore raw
In reply to David Vrabel

David Vrabel writes ("Re: [Xen-devel] [RFC PATCH] blkif.h: document scsi/0x12/0x83 node"):

Quoted 7 lines · Konrad Rzeszutek Wilk
Quoted 1 line

Just think of it as a black box.

This isn't sufficient.

You are presenting a solution but have not properly described the problem so no one can evaluate whether the solution is appropriate.

I'm sorry to be awkward, but I'm afraid I do agree with David Vrabel's messages in this thread.

I don't think this is a sterile academic conversation which would (if satisfactorily answered) have no real implications. Rather, if we understood the use case properly, there would probably be implications for whether how this functionality ought to be exposed via the libxl API; whether blkfront should consume this information by default; and so on.

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#17 lore raw
In reply to Ian Jackson
Quoted 8 lines

-----Original Message-----
From: Ian Jackson [mailto:[email protected]]
Sent: 22 March 2016 15:09
To: Paul Durrant
Cc: David Vrabel; Konrad Rzeszutek Wilk; Bob Liu; [email protected]; xen- [email protected]; [email protected]; Roger Pau Monne
Subject: RE: [Xen-devel] [RFC PATCH] blkif.h: document scsi/0x12/0x83 node

Quoted 7 lines

Paul Durrant writes ("RE: [Xen-devel] [RFC PATCH] blkif.h: document scsi/0x12/0x83 node"):

Quoted 1 line

AFAIK XenServer still very much makes use of it.

Can you answer, for XenServer's use case, some of the questions that David and I have asked ?

It's getting hard to parse the thread at this point but, as I've mentioned in a previous response in the thread, Windows basically assumes disks are SCSI and it's up to the controller driver to make it look that way.
To that end the XENVBD Windows PV driver synthesizes VPD pages 80 and 83 but also have the ability pull base64 encoded VPD data from xenstore. The synthesis is required to make Windows work properly but the reason for overriding it with data from xenstore is not apparent. In XenServer the storage backend code does populate the VPD information (with UUID information for the storage volume created by XAPI) but I don't believe that this is necessary behaviour in the normal case. My *assumption* is that, at some point in the past, XenServer had OEM specific storage backends and the requirement to run OEM s/w in guest which relied on VPD supplied by the storage, and as is commonly the case xenstore was the easiest way to get this information from the backend and into the guest.

Paul

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#22 lore raw
In reply to Ian Jackson
Quoted 12 lines · Ian Jackson

David Vrabel writes ("Re: [Xen-devel] [RFC PATCH] blkif.h: document scsi/0x12/0x83 node"):

Quoted 7 lines · Konrad Rzeszutek Wilk
Quoted 1 line

Just think of it as a black box.

This isn't sufficient.

You are presenting a solution but have not properly described the problem so no one can evaluate whether the solution is appropriate.

I'm sorry to be awkward, but I'm afraid I do agree with David Vrabel's messages in this thread.

Quoted 6 lines

I don't think this is a sterile academic conversation which would (if satisfactorily answered) have no real implications. Rather, if we understood the use case properly, there would probably be implications for whether how this functionality ought to be exposed via the libxl API; whether blkfront should consume this information by default; and so on.

Lets take one step back.

What is the problem with documenting an existing use-case in blkif.h?

Regardless of whether it is viewed "legacy" by some folks and by others drivers it is still in use?

Quoted 2 lines

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#23 lore raw

Konrad Rzeszutek Wilk writes ("Re: [Xen-devel] [RFC PATCH] blkif.h: document scsi/0x12/0x83 node"):

Quoted 7 lines
Quoted 6 lines

I don't think this is a sterile academic conversation which would (if satisfactorily answered) have no real implications. Rather, if we understood the use case properly, there would probably be implications for whether how this functionality ought to be exposed via the libxl API; whether blkfront should consume this information by default; and so on.

Quoted 6 lines

Lets take one step back.

What is the problem with documenting an existing use-case in blkif.h?

Regardless of whether it is viewed "legacy" by some folks and by others drivers it is still in use?

Firstly, if you want to document it then the documentation needs to explain what the semantics are supposed to be. At the moment I'm not sure I see a correct and useful set of semantics. I had a go at writing something but several of the things I wrote in it seem to have been contradicted by comments from Bob Liu and others.

It is difficult to write a suitable document. Ideally the document would give an example use case. But it appears that the only use case is super secret!

Secondly, apparently this is not regarded as deprecated. Bob Liu says he plans to add support for it to blkfront.

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#18 lore raw
In reply to Paul Durrant

Paul Durrant writes ("RE: [Xen-devel] [RFC PATCH] blkif.h: document scsi/0x12/0x83 node"):

Quoted 4 lines

It's getting hard to parse the thread at this point but, as I've mentioned in a previous response in the thread, Windows basically assumes disks are SCSI and it's up to the controller driver to make it look that way.

Right. That makes perfect sense.

Quoted 3 lines

To that end the XENVBD Windows PV driver synthesizes VPD pages 80 and 83 but also have the ability pull base64 encoded VPD data from xenstore. The synthesis is required to make Windows work properly

Right.

Quoted 2 lines

but the reason for overriding it with data from xenstore is not apparent.

Thanks, this is the part that we are struggling with and which it is proposed to now document.

Quoted 4 lines

In XenServer the storage backend code does populate the VPD information (with UUID information for the storage volume created by XAPI) but I don't believe that this is necessary behaviour in the normal case.

So the VPD here is a UUID from Xapi ? Not anything do with the underlying storage ?

I think that is a plausible thing for Xapi to do. Although I don't fully understand why it would be necessary, it doesn't seem implausible that there are guest OS's which look for and do something useful with such data (because they could use it, for example, to reliably identify a storage volume other than by reading its contents).

Quoted 5 lines

My *assumption* is that, at some point
in the past, XenServer had OEM specific storage backends and the requirement to run OEM s/w in guest which relied on VPD supplied by the storage, and as is commonly the case xenstore was the easiest way to get this information from the backend and into the guest.

Right, but the VPD information would be Xapi-generated and generic, rather than containing OEM information from the disk ?

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#25 lore raw
In reply to Konrad Rzeszutek Wilk
Quoted 22 lines
Quoted 1 line
Quoted 1 line · On 22.03.16 at 16:27, <[email protected]> wrote:
Quoted 1 line · Ian Jackson

David Vrabel writes ("Re: [Xen-devel] [RFC PATCH] blkif.h: document

scsi/0x12/0x83 node"):

Quoted 11 lines
Quoted 7 lines · Konrad Rzeszutek Wilk
Quoted 1 line

Just think of it as a black box.

This isn't sufficient.

You are presenting a solution but have not properly described the problem so no one can evaluate whether the solution is appropriate.

I'm sorry to be awkward, but I'm afraid I do agree with David Vrabel's messages in this thread.

Quoted 6 lines

I don't think this is a sterile academic conversation which would (if satisfactorily answered) have no real implications. Rather, if we understood the use case properly, there would probably be implications for whether how this functionality ought to be exposed via the libxl API; whether blkfront should consume this information by default; and so on.

Quoted 3 lines

Lets take one step back.

What is the problem with documenting an existing use-case in blkif.h?

Namely taking into account Paul's almost simultaneous reply I'm in doubt whether this is a use case or an abuse of some readily available mechanism.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#24 lore raw
In reply to Ian Jackson
Quoted 21 lines · Ian Jackson

Konrad Rzeszutek Wilk writes ("Re: [Xen-devel] [RFC PATCH] blkif.h: document scsi/0x12/0x83 node"):

Quoted 7 lines
Quoted 6 lines

I don't think this is a sterile academic conversation which would (if satisfactorily answered) have no real implications. Rather, if we understood the use case properly, there would probably be implications for whether how this functionality ought to be exposed via the libxl API; whether blkfront should consume this information by default; and so on.

Quoted 6 lines

Lets take one step back.

What is the problem with documenting an existing use-case in blkif.h?

Regardless of whether it is viewed "legacy" by some folks and by others drivers it is still in use?

Firstly, if you want to document it then the documentation needs to explain what the semantics are supposed to be. At the moment I'm not sure I see a correct and useful set of semantics. I had a go at writing something but several of the things I wrote in it seem to have been contradicted by comments from Bob Liu and others.

Quoted 3 lines

It is difficult to write a suitable document. Ideally the document would give an example use case. But it appears that the only use case is super secret!

:-)

Quoted 3 lines

Secondly, apparently this is not regarded as deprecated. Bob Liu says he plans to add support for it to blkfront.

One step at a time. First lets document this XenStore key in blkif.h so it is know what it does and the semantics of it.

Quoted 2 lines

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#19 lore raw
In reply to Ian Jackson
Quoted 20 lines · Ian Jackson

Paul Durrant writes ("RE: [Xen-devel] [RFC PATCH] blkif.h: document scsi/0x12/0x83 node"):

Quoted 4 lines

It's getting hard to parse the thread at this point but, as I've mentioned in a previous response in the thread, Windows basically assumes disks are SCSI and it's up to the controller driver to make it look that way.

Right. That makes perfect sense.

Quoted 3 lines

To that end the XENVBD Windows PV driver synthesizes VPD pages 80 and 83 but also have the ability pull base64 encoded VPD data from xenstore. The synthesis is required to make Windows work properly

Right.

Quoted 2 lines

but the reason for overriding it with data from xenstore is not apparent.

Thanks, this is the part that we are struggling with and which it is proposed to now document.

Quoted 7 lines
Quoted 4 lines

In XenServer the storage backend code does populate the VPD information (with UUID information for the storage volume created by XAPI) but I don't believe that this is necessary behaviour in the normal case.

So the VPD here is a UUID from Xapi ? Not anything do with the underlying storage ?

For this to be 'correct' the SCSI INQ binary result data (which is what the base64 would encode) would need to follow the SCSI op codes.

There are bits in it that MUST be defined to make any sense. The serial number can be an UUID or such.

Quoted 14 lines

I think that is a plausible thing for Xapi to do. Although I don't fully understand why it would be necessary, it doesn't seem implausible that there are guest OS's which look for and do something useful with such data (because they could use it, for example, to reliably identify a storage volume other than by reading its contents).

Quoted 5 lines

My *assumption* is that, at some point
in the past, XenServer had OEM specific storage backends and the requirement to run OEM s/w in guest which relied on VPD supplied by the storage, and as is commonly the case xenstore was the easiest way to get this information from the backend and into the guest.

Quoted 4 lines

Right, but the VPD information would be Xapi-generated and generic, rather than containing OEM information from the disk ?

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#20 lore raw
In reply to Ian Jackson
Quoted 37 lines

-----Original Message-----
From: Ian Jackson [mailto:[email protected]]
Sent: 22 March 2016 16:15
To: Paul Durrant
Cc: David Vrabel; Konrad Rzeszutek Wilk; Bob Liu; [email protected]; xen- [email protected]; [email protected]; Roger Pau Monne
Subject: RE: [Xen-devel] [RFC PATCH] blkif.h: document scsi/0x12/0x83 node

Paul Durrant writes ("RE: [Xen-devel] [RFC PATCH] blkif.h: document scsi/0x12/0x83 node"):

Quoted 4 lines

It's getting hard to parse the thread at this point but, as I've mentioned in a previous response in the thread, Windows basically assumes disks are SCSI and it's up to the controller driver to make it look that way.

Right. That makes perfect sense.

Quoted 3 lines

To that end the XENVBD Windows PV driver synthesizes VPD pages 80 and 83 but also have the ability pull base64 encoded VPD data from xenstore. The synthesis is required to make Windows work properly

Right.

Quoted 2 lines

but the reason for overriding it with data from xenstore is not apparent.

Thanks, this is the part that we are struggling with and which it is proposed to now document.

Quoted 4 lines

In XenServer the storage backend code does populate the VPD information (with UUID information for the storage volume created by XAPI) but I don't believe that this is necessary behaviour in the normal case.

So the VPD here is a UUID from Xapi ? Not anything do with the underlying storage ?

Quoted 7 lines

I think that is a plausible thing for Xapi to do. Although I don't fully understand why it would be necessary, it doesn't seem implausible that there are guest OS's which look for and do something useful with such data (because they could use it, for example, to reliably identify a storage volume other than by reading its contents).

I think that in the general case the VPD data is created by XAPI (or some element of the storage code) from the UUID. My belief is, though, there were cases where XAPI instead got the VPD data from the underlying storage.

Quoted 9 lines
Quoted 5 lines

My *assumption* is that, at some point
in the past, XenServer had OEM specific storage backends and the requirement to run OEM s/w in guest which relied on VPD supplied by the storage, and as is commonly the case xenstore was the easiest way to get this information from the backend and into the guest.

Right, but the VPD information would be Xapi-generated and generic, rather than containing OEM information from the disk ?

Not in the case of these (mythical) OEM backends.

I don't know whether it meets Oracle's use-case but I'm happy to add code in XENVBD to synthesize page 80 from a straightforward serial number in xenstore.

Paul

Quoted 1 line

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel