virt: acrn: Mark the uuid field as unused
PATCH 1/1 virt: acrn: Mark the uuid field as unused
After the commits for userspace [1][2] the uuid field is not being used in the ACRN code. Update kernel to reflect these changes. I.e. we do the following:
- adding a comment explaining that it's not used anymore
- replacing the specific type by a raw buffer
- updating the example code accordingly
[1]: https://github.com/projectacrn/acrn-hypervisor/commit/da0d24326ed6
[2]: https://github.com/projectacrn/acrn-hypervisor/commit/bb0327e70097
--- include/uapi/linux/acrn.h | 5 ++--- samples/acrn/vm-sample.c | 3 --- 2 files changed, 2 insertions(+), 6 deletions(-)
include/uapi/linux/acrn.h +2 -3
@@ -12,7 +12,6 @@#define _UAPI_ACRN_H#include <linux/types.h> -#include <linux/uuid.h> #define ACRN_IO_REQUEST_MAX 16
@@ -186,7 +185,7 @@ struct acrn_ioreq_notify {* @reserved0: Reserved and must be 0 * @vcpu_num: Number of vCPU in the VM. Return from hypervisor. * @reserved1: Reserved and must be 0 -* @uuid: UUID of the VM. Pass to hypervisor directly. +* @uuid: Reserved (used to be UUID of the VM) * @vm_flag: Flag of the VM creating. Pass to hypervisor directly. * @ioreq_buf: Service VM GPA of I/O request buffer. Pass to * hypervisor directly.
@@ -198,7 +197,7 @@ struct acrn_vm_creation {__u16 reserved0;__u16 vcpu_num;__u16 reserved1; -guid_t uuid; +__u8 uuid[16 ];__u64 vm_flag;__u64 ioreq_buf;__u64 cpu_affinity;
samples/acrn/vm-sample.c +0 -3
@@ -29,8 +29,6 @@ static struct acrn_io_request *io_req_buf = (struct acrn_io_request *)io_request__u16 vcpu_num;__u16 vmid; -/* POST_STANDARD_VM_UUID1, refer to https://github.com/projectacrn/acrn-hypervisor/blob/master/hypervisor/include/common/vm_uuids.h */ -guid_t vm_uuid =GUID_INIT (0x385479d2 ,0xd625 ,0xe811 ,0x86 ,0x4e ,0xcb ,0x7a ,0x18 ,0xb3 ,0x46 ,0x43 );int hsm_fd;int is_running =1 ;
@@ -63,7 +61,6 @@ int main(int argc, char **argv) } hsm_fd =open ("/dev/acrn_hsm" ,O_RDWR |O_CLOEXEC ); -memcpy (&create_vm.uuid, &vm_uuid,16 ); create_vm.ioreq_buf = (__u64 )io_req_buf; ret =ioctl (hsm_fd,ACRN_IOCTL_CREATE_VM , &create_vm);printf ("Created VM! [%d]\n" , ret);
Signature · 1 line
2.35.1
Li Fei1
maintainerQuoted 7 lines · Andy Shevchenko
After the commits for userspace [1][2] the uuid field is not being used in the ACRN code. Update kernel to reflect these changes. I.e. we do the following:
- adding a comment explaining that it's not used anymore
- replacing the specific type by a raw buffer
- updating the example code accordingly
Quoted 6 lines
[1]: https://github.com/projectacrn/acrn-hypervisor/commit/da0d24326ed6
[2]: https://github.com/projectacrn/acrn-hypervisor/commit/bb0327e70097Fixes 5b06931d7f8b ("sample/acrn: Introduce a sample of HSM ioctl interface usage")Fixes 9c5137aedd11 ("virt: acrn: Introduce VM management interfaces")Signed-off-by Andy Shevchenko <[email protected]>
Quoted 59 lines
--- include/uapi/linux/acrn.h | 5 ++--- samples/acrn/vm-sample.c | 3 --- 2 files changed, 2 insertions(+), 6 deletions(-)include/uapi/linux/acrn.h +2
-3@@ -12,7 +12,6 @@#define _UAPI_ACRN_H#include <linux/types.h> -#include <linux/uuid.h> #define ACRN_IO_REQUEST_MAX 16@@ -186,7 +185,7 @@ struct acrn_ioreq_notify {* @reserved0: Reserved and must be 0 * @vcpu_num: Number of vCPU in the VM. Return from hypervisor. * @reserved1: Reserved and must be 0 -* @uuid: UUID of the VM. Pass to hypervisor directly. +* @uuid: Reserved (used to be UUID of the VM) * @vm_flag: Flag of the VM creating. Pass to hypervisor directly. * @ioreq_buf: Service VM GPA of I/O request buffer. Pass to * hypervisor directly. @@ -198,7 +197,7 @@ struct acrn_vm_creation {__u16 reserved0;__u16 vcpu_num;__u16 reserved1; -guid_t uuid; +__u8 uuid[16 ];__u64 vm_flag;__u64 ioreq_buf;__u64 cpu_affinity;samples/acrn/vm-sample.c +0
-3@@ -29,8 +29,6 @@ static struct acrn_io_request *io_req_buf = (struct acrn_io_request *)io_request__u16 vcpu_num;__u16 vmid; -/* POST_STANDARD_VM_UUID1, refer to https://github.com/projectacrn/acrn-hypervisor/blob/master/hypervisor/include/common/vm_uuids.h */ -guid_t vm_uuid =GUID_INIT (0x385479d2 ,0xd625 ,0xe811 ,0x86 ,0x4e ,0xcb ,0x7a ,0x18 ,0xb3 ,0x46 ,0x43 );int hsm_fd;int is_running =1 ;@@ -63,7 +61,6 @@ int main(int argc, char **argv) } hsm_fd =open ("/dev/acrn_hsm" ,O_RDWR |O_CLOEXEC ); -memcpy (&create_vm.uuid, &vm_uuid,16 ); create_vm.ioreq_buf = (__u64 )io_req_buf; ret =ioctl (hsm_fd,ACRN_IOCTL_CREATE_VM , &create_vm);printf ("Created VM! [%d]\n" , ret);Signature · 1 line
2.35.1
Quoted 8 lines · On Thu, Jun 16, 2022 at 12:20:54AM +0800, Li Fei1 wrote:
Quoted 7 lines · Andy Shevchenko
After the commits for userspace [1][2] the uuid field is not being used in the ACRN code. Update kernel to reflect these changes. I.e. we do the following:
- adding a comment explaining that it's not used anymore
- replacing the specific type by a raw buffer
- updating the example code accordingly
Quoted 8 lines
Quoted 6 lines
[1]: https://github.com/projectacrn/acrn-hypervisor/commit/da0d24326ed6
[2]: https://github.com/projectacrn/acrn-hypervisor/commit/bb0327e70097Fixes 5b06931d7f8b ("sample/acrn: Introduce a sample of HSM ioctl interface usage")Fixes 9c5137aedd11 ("virt: acrn: Introduce VM management interfaces")Signed-off-by Andy Shevchenko <[email protected]>Signed-off-by Fei Li <[email protected]>
Dunno if SoB works for Greg, works for me.
Thanks!
Greg, can this be applied?
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 12 lines · Andy Shevchenko
Quoted 11 lines · On Thu, Jun 16, 2022 at 12:20:54AM +0800, Li Fei1 wrote:
Quoted 10 lines · Andy Shevchenko
After the commits for userspace [1][2] the uuid field is not being used in the ACRN code. Update kernel to reflect these changes. I.e. we do the following:
- adding a comment explaining that it's not used anymore
- replacing the specific type by a raw buffer
- updating the example code accordingly[1]: https://github.com/projectacrn/acrn-hypervisor/commit/da0d24326ed6
[2]: https://github.com/projectacrn/acrn-hypervisor/commit/bb0327e70097
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Fixes 5b06931d7f8b ("sample/acrn: Introduce a sample of HSM ioctl interface usage")Fixes 9c5137aedd11 ("virt: acrn: Introduce VM management interfaces")Signed-off-by Andy Shevchenko <[email protected]>Signed-off-by Fei Li <[email protected]>Dunno if SoB works for Greg, works for me.
Thanks!
Greg, can this be applied?
Signature · 2 lines
With Best Regards, Andy Shevchenko