Skip to content

Commit

Permalink
CP-34028: Replace make_uuid with make
Browse files Browse the repository at this point in the history
Signed-off-by: Pau Ruiz Safont <pau.safont@citrix.com>
  • Loading branch information
psafont committed Apr 22, 2022
1 parent 24b4f18 commit c7e38b8
Show file tree
Hide file tree
Showing 57 changed files with 91 additions and 90 deletions.
2 changes: 1 addition & 1 deletion ocaml/database/block_device_io.ml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ let magic_size = 16

let generation_size = 16

let marker_size = String.length (Uuid.to_string (Uuid.make_uuid ()))
let marker_size = String.length (Uuid.to_string (Uuid.make ()))

let size_size = 16 (* decimal digits *)

Expand Down
2 changes: 1 addition & 1 deletion ocaml/database/redo_log.ml
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ let create ~name ~state_change_callback ~read_only =
let instance =
{
name
; marker= Uuid.to_string (Uuid.make_uuid ())
; marker= Uuid.to_string (Uuid.make ())
; read_only
; enabled= ref false
; device= ref None
Expand Down
3 changes: 2 additions & 1 deletion ocaml/libs/uuid/uuid.ml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ let read_bytes dev n =
let make_uuid_urnd () = of_bytes (read_bytes dev_urandom 16) |> Option.get

(* Use the CSPRNG-backed urandom *)
let make_uuid = make_uuid_urnd
let make = make_uuid_urnd


type cookie = string

Expand Down
2 changes: 1 addition & 1 deletion ocaml/libs/uuid/uuid.mli
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ val null : 'a t
(** A null UUID, as if such a thing actually existed. It turns out to be
useful though. *)

val make_uuid : unit -> 'a t
val make : unit -> 'a t
(** Create a fresh UUID *)

val make_uuid_urnd : unit -> 'a t
Expand Down
2 changes: 1 addition & 1 deletion ocaml/quicktest/quicktest_vdi.ml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ let vdi_bad_introduce rpc session_id sr_info () =
) ;
let (_ : API.ref_VDI) =
Client.Client.VDI.introduce ~rpc ~session_id
~uuid:(Uuid.to_string (Uuid.make_uuid ()))
~uuid:(Uuid.to_string (Uuid.make ()))
~name_label:"bad location" ~name_description:"" ~sR:vdir.API.vDI_SR
~_type:vdir.API.vDI_type ~sharable:false ~read_only:false
~other_config:[] ~location:vdir.API.vDI_location ~xenstore_data:[]
Expand Down
2 changes: 1 addition & 1 deletion ocaml/tests/common/test_common.ml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ open API
(* A directory to use for temporary files. *)
let working_area = Filename.(concat (get_temp_dir_name ()) "xapi-test")

let make_uuid () = Uuid.(to_string (make_uuid ()))
let make_uuid () = Uuid.(to_string (make ()))

let assert_raises_api_error (code : string) ?(args : string list option)
(f : unit -> 'a) : unit =
Expand Down
2 changes: 1 addition & 1 deletion ocaml/tests/test_host.ml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ open Test_common
let add_host __context name =
ignore
(Xapi_host.create ~__context
~uuid:(Uuid.to_string (Uuid.make_uuid ()))
~uuid:(Uuid.to_string (Uuid.make ()))
~name_label:name ~name_description:"" ~hostname:"host2"
~address:"127.0.0.1" ~external_auth_type:""
~external_auth_service_name:"" ~external_auth_configuration:[]
Expand Down
2 changes: 1 addition & 1 deletion ocaml/xapi/certificates.ml
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ end = struct
let fingerprint =
X509.Certificate.fingerprint `SHA256 certificate |> pp_hash
in
let uuid = Uuid.(to_string (make_uuid ())) in
let uuid = Uuid.(to_string (make ())) in
let ref' = Ref.make () in
Db.Certificate.create ~__context ~ref:ref' ~uuid ~host ~not_before
~not_after ~fingerprint ~name ~_type ;
Expand Down
8 changes: 4 additions & 4 deletions ocaml/xapi/create_misc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ and create_domain_zero_console_record_with_protocol ~__context ~domain_zero_ref
Xapi_globs.host_console_textport
in
Db.Console.create ~__context ~ref:console_ref
~uuid:(Uuid.to_string (Uuid.make_uuid ()))
~uuid:(Uuid.to_string (Uuid.make ()))
~protocol:dom0_console_protocol ~location ~vM:domain_zero_ref
~other_config:[] ~port

Expand All @@ -368,7 +368,7 @@ and create_domain_zero_console_record ~__context ~domain_zero_ref
and create_domain_zero_metrics_record ~__context ~domain_zero_metrics_ref
~memory_constraints ~vcpus : unit =
Db.VM_metrics.create ~__context ~ref:domain_zero_metrics_ref
~uuid:(Uuid.to_string (Uuid.make_uuid ()))
~uuid:(Uuid.to_string (Uuid.make ()))
~memory_actual:memory_constraints.target
~vCPUs_utilisation:(List.map (fun x -> (Int64.of_int x, 0.)) (mkints vcpus))
~vCPUs_number:(Int64.of_int vcpus) ~vCPUs_CPU:[] ~vCPUs_params:[]
Expand Down Expand Up @@ -449,7 +449,7 @@ and create_domain_zero_memory_constraints (_ : host_info) :
let create_root_user ~__context =
let fullname = "superuser"
and short_name = "root"
and uuid = Uuid.to_string (Uuid.make_uuid ())
and uuid = Uuid.to_string (Uuid.make ())
and ref = Ref.make () in
let all =
Db.User.get_records_where ~__context
Expand Down Expand Up @@ -675,7 +675,7 @@ let create_host_cpu ~__context host_info =
in
List.iter (fun (r, _) -> Db.Host_cpu.destroy ~__context ~self:r) host_cpus ;
for i = 0 to cpu_info.cpu_count - 1 do
let uuid = Uuid.to_string (Uuid.make_uuid ()) and ref = Ref.make () in
let uuid = Uuid.to_string (Uuid.make ()) and ref = Ref.make () in
debug "Creating CPU %d: %s" i uuid ;
ignore
(Db.Host_cpu.create ~__context ~ref ~uuid ~host
Expand Down
2 changes: 1 addition & 1 deletion ocaml/xapi/dbsync.ml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ let create_host_metrics ~__context =
(Db.Host.get_uuid ~__context ~self) ;
let r = Ref.make () in
Db.Host_metrics.create ~__context ~ref:r
~uuid:(Uuid.to_string (Uuid.make_uuid ()))
~uuid:(Uuid.to_string (Uuid.make ()))
~live:false ~memory_total:0L ~memory_free:0L
~last_updated:Xapi_stdext_date.Date.never ~other_config:[] ;
Db.Host.set_metrics ~__context ~self ~value:r
Expand Down
6 changes: 3 additions & 3 deletions ocaml/xapi/dbsync_master.ml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ let create_pool_record ~__context =
let pools = Db.Pool.get_all ~__context in
if pools = [] then
Db.Pool.create ~__context ~ref:(Ref.make ())
~uuid:(Uuid.to_string (Uuid.make_uuid ()))
~uuid:(Uuid.to_string (Uuid.make ()))
~name_label:"" ~name_description:""
~master:(Helpers.get_localhost ~__context)
~default_SR:Ref.null ~suspend_image_SR:Ref.null ~crash_dump_SR:Ref.null
Expand Down Expand Up @@ -164,7 +164,7 @@ let create_tools_sr __context name_label name_description sr_introduce
to make the PBD for the shared tools SR *)
let sr =
sr_introduce
~uuid:(Uuid.to_string (Uuid.make_uuid ()))
~uuid:(Uuid.to_string (Uuid.make ()))
~name_label ~name_description ~_type:"iso" ~content_type:"iso"
~shared:true ~sm_config:[]
in
Expand Down Expand Up @@ -269,7 +269,7 @@ let ensure_vm_metrics_records_exist __context =
info "Regenerating missing VM_metrics record for VM %s"
(Ref.string_of vm) ;
let m = Ref.make () in
let uuid = Uuid.to_string (Uuid.make_uuid ()) in
let uuid = Uuid.to_string (Uuid.make ()) in
Db.VM_metrics.create ~__context ~ref:m ~uuid ~vCPUs_number:0L
~vCPUs_utilisation:[] ~memory_actual:0L ~vCPUs_CPU:[] ~vCPUs_params:[]
~vCPUs_flags:[] ~start_time:Xapi_stdext_date.Date.never
Expand Down
4 changes: 2 additions & 2 deletions ocaml/xapi/debug_populate.ml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ let rec make_srs __context i =
if i = 0 then
()
else
let uuid = Uuid.to_string (Uuid.make_uuid ()) in
let uuid = Uuid.to_string (Uuid.make ()) in
let sr_ref =
Xapi_sr.introduce ~__context ~uuid
~name_label:("SR-" ^ string_of_int i)
Expand Down Expand Up @@ -56,7 +56,7 @@ let rec make_vdis_and_vbds __context vmref i =
if i = 0 then
()
else
let uuid = Uuid.to_string (Uuid.make_uuid ()) in
let uuid = Uuid.to_string (Uuid.make ()) in
let vm_uuid = Db.VM.get_uuid ~self:vmref ~__context in
let name_label = "VDI-" ^ string_of_int i ^ "-for-VM-" ^ vm_uuid in
let name_description = "dummy" in
Expand Down
2 changes: 1 addition & 1 deletion ocaml/xapi/gpg.ml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ let common ty filename signature size f =
Unix.unlink tmp_file ;
(* no need to close the 'tmp_oc' -> closing the fd is enough *)
let status_out, status_in = Unix.pipe () in
let status_in_uuid = Uuid.to_string (Uuid.make_uuid ()) in
let status_in_uuid = Uuid.to_string (Uuid.make ()) in
(* from the parent's PoV *)
let fds_to_close = ref [result_out; result_in; status_out; status_in] in
let close' fd =
Expand Down
4 changes: 2 additions & 2 deletions ocaml/xapi/import.ml
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ module VM : HandlerTools = struct
if config.full_restore then
other_config
else
(Xapi_globs.mac_seed, Uuid.(to_string (make_uuid ())))
(Xapi_globs.mac_seed, Uuid.(to_string (make ())))
:: List.filter (fun (x, _) -> x <> Xapi_globs.mac_seed) other_config
in
let vm_record = {vm_record with API.vM_other_config= other_config} in
Expand Down Expand Up @@ -800,7 +800,7 @@ module GuestMetrics : HandlerTools = struct
let gm_record = API.vM_guest_metrics_t_of_rpc x.snapshot in
let gm = Ref.make () in
Db.VM_guest_metrics.create ~__context ~ref:gm
~uuid:(Uuid.to_string (Uuid.make_uuid ()))
~uuid:(Uuid.to_string (Uuid.make ()))
~os_version:gm_record.API.vM_guest_metrics_os_version
~pV_drivers_version:gm_record.API.vM_guest_metrics_PV_drivers_version
~pV_drivers_up_to_date:
Expand Down
2 changes: 1 addition & 1 deletion ocaml/xapi/monitor_master.ml
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ let update_pifs ~__context host pifs =
else
let ref = Ref.make () in
Db.PIF_metrics.create ~__context ~ref
~uuid:(Uuid.to_string (Uuid.make_uuid ()))
~uuid:(Uuid.to_string (Uuid.make ()))
~carrier:false ~device_name:"" ~vendor_name:"" ~device_id:""
~vendor_id:"" ~speed:0L ~duplex:false ~pci_bus_path:""
~io_read_kbs:0. ~io_write_kbs:0.
Expand Down
4 changes: 2 additions & 2 deletions ocaml/xapi/storage_access.ml
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ module SMAPIv1 = struct
let other_config = Db.VDI.get_other_config ~__context ~self in
if not (List.mem_assoc "content_id" other_config) then
Db.VDI.add_to_other_config ~__context ~self ~key:"content_id"
~value:Uuid.(to_string (make_uuid ()))
~value:Uuid.(to_string (make ()))
) ;
(* If the backend doesn't advertise the capability then do nothing *)
if List.mem_assoc Smint.Vdi_deactivate (Sm.features_of_driver _type)
Expand Down Expand Up @@ -737,7 +737,7 @@ module SMAPIv1 = struct
try
List.assoc "content_id"
(Db.VDI.get_other_config ~__context ~self:clonee)
with _ -> Uuid.(to_string (make_uuid ()))
with _ -> Uuid.(to_string (make ()))
in
let snapshot_time = Date.of_float (Unix.gettimeofday ()) in
Db.VDI.set_name_label ~__context ~self ~value:vdi_info.name_label ;
Expand Down
8 changes: 4 additions & 4 deletions ocaml/xapi/storage_migrate.ml
Original file line number Diff line number Diff line change
Expand Up @@ -493,9 +493,9 @@ let copy' ~task ~dbg ~sr ~vdi ~url ~dest ~dest_vdi =
None
in
try
let remote_dp = Uuid.(to_string (make_uuid ())) in
let base_dp = Uuid.(to_string (make_uuid ())) in
let leaf_dp = Uuid.(to_string (make_uuid ())) in
let remote_dp = Uuid.(to_string (make ())) in
let base_dp = Uuid.(to_string (make ())) in
let leaf_dp = Uuid.(to_string (make ())) in
let dest_vdi_url =
Http.Url.set_uri remote_url
(Printf.sprintf "%s/nbd/%s/%s/%s"
Expand Down Expand Up @@ -968,7 +968,7 @@ let receive_start ~dbg ~sr ~vdi_info ~id ~similar =
let vdis = Local.SR.scan dbg sr in
(* We drop cbt_metadata VDIs that do not have any actual data *)
let vdis = List.filter (fun vdi -> vdi.ty <> "cbt_metadata") vdis in
let leaf_dp = Local.DP.create dbg Uuid.(to_string (make_uuid ())) in
let leaf_dp = Local.DP.create dbg Uuid.(to_string (make ())) in
try
let vdi_info = {vdi_info with sm_config= [("base_mirror", id)]} in
let leaf = Local.VDI.create dbg sr vdi_info in
Expand Down
2 changes: 1 addition & 1 deletion ocaml/xapi/system_status.ml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ let get_capabilities () =
(* This fn outputs xen-bugtool straight to the socket, only
for tar output. It should work on embedded edition *)
let send_via_fd __context s entries output =
let s_uuid = Uuid.to_string (Uuid.make_uuid ()) in
let s_uuid = Uuid.to_string (Uuid.make ()) in
let params =
[
sprintf "--entries=%s" entries
Expand Down
2 changes: 1 addition & 1 deletion ocaml/xapi/taskHelper.ml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type t = API.ref_task
(* creates a new task *)
let make ~__context ~http_other_config ?(description = "") ?session_id
?subtask_of label : t * t Uuid.t =
let uuid = Uuid.make_uuid () in
let uuid = Uuid.make () in
let uuid_str = Uuid.to_string uuid in
let ref = Ref.make () in
(* we store in database only parent/child relationship between real tasks *)
Expand Down
2 changes: 1 addition & 1 deletion ocaml/xapi/xapi_blob.ml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module D = Debug.Make (struct let name = "xapi_blob" end)
open D

let create ~__context ~mime_type ~public =
let uuid = Uuid.make_uuid () in
let uuid = Uuid.make () in
let ref = Ref.make () in
let mime_type' =
if mime_type = "" then "application/octet-stream" else mime_type
Expand Down
4 changes: 2 additions & 2 deletions ocaml/xapi/xapi_bond.ml
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ let create ~__context ~network ~members ~mAC ~mode ~properties =
let device_name = device in
let metrics = Xapi_pif.make_pif_metrics ~__context in
Db.PIF.create ~__context ~ref:master
~uuid:(Uuid.to_string (Uuid.make_uuid ()))
~uuid:(Uuid.to_string (Uuid.make ()))
~device ~device_name ~network ~host ~mAC ~mTU:(-1L) ~vLAN:(-1L) ~metrics
~physical:false ~currently_attached:false ~igmp_snooping_status:`unknown
~ip_configuration_mode:`None ~iP:"" ~netmask:"" ~gateway:"" ~dNS:""
Expand All @@ -512,7 +512,7 @@ let create ~__context ~network ~members ~mAC ~mode ~properties =
~primary_address_type:primary_slave_address_type ~managed:true
~properties:pif_properties ~capabilities:[] ~pCI:Ref.null ;
Db.Bond.create ~__context ~ref:bond
~uuid:(Uuid.to_string (Uuid.make_uuid ()))
~uuid:(Uuid.to_string (Uuid.make ()))
~master ~other_config:[] ~primary_slave ~mode ~properties ~links_up:0L
~auto_update_mac ;
(* Set the PIF.bond_slave_of fields of the members.
Expand Down
2 changes: 1 addition & 1 deletion ocaml/xapi/xapi_dr_task.ml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module D = Debug.Make (struct let name = "xapi_dr_task" end)
open D

let make_task ~__context =
let uuid = Uuid.make_uuid () in
let uuid = Uuid.make () in
let ref = Ref.make () in
Db.DR_task.create ~__context ~ref ~uuid:(Uuid.to_string uuid) ;
ref
Expand Down
2 changes: 1 addition & 1 deletion ocaml/xapi/xapi_gpu_group.ml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

let create ~__context ~name_label ~name_description ~other_config =
let group = Ref.make () in
let uuid = Uuid.to_string (Uuid.make_uuid ()) in
let uuid = Uuid.to_string (Uuid.make ()) in
Db.GPU_group.create ~__context ~ref:group ~uuid ~name_label ~name_description
~gPU_types:[] ~other_config ~allocation_algorithm:`depth_first ;
group
Expand Down
2 changes: 1 addition & 1 deletion ocaml/xapi/xapi_guest_agent.ml
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ let create_and_set_guest_metrics (lookup : string -> string option)
=
let initial_gm = get_initial_guest_metrics lookup list in
let self = Db.VM.get_by_uuid ~__context ~uuid in
let new_gm_uuid = Uuid.to_string (Uuid.make_uuid ())
let new_gm_uuid = Uuid.to_string (Uuid.make ())
and new_gm_ref = Ref.make () in
Db.VM_guest_metrics.create ~__context ~ref:new_gm_ref ~uuid:new_gm_uuid
~os_version:initial_gm.os_version
Expand Down
2 changes: 1 addition & 1 deletion ocaml/xapi/xapi_ha.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1886,7 +1886,7 @@ let enable __context heartbeat_srs configuration =
(* Start by assuming there is no ha_plan_for: this can be revised upwards later *)
Db.Pool.set_ha_plan_exists_for ~__context ~self:pool ~value:0L ;
let (_ : bool) = Xapi_ha_vm_failover.update_pool_status ~__context () in
let generation = Uuid.to_string (Uuid.make_uuid ()) in
let generation = Uuid.to_string (Uuid.make ()) in
let hosts = Db.Host.get_all ~__context in
(* This code always runs on the master *)
let statefiles = attach_statefiles ~__context !statefile_vdis in
Expand Down
4 changes: 2 additions & 2 deletions ocaml/xapi/xapi_host.ml
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ let create ~__context ~uuid ~name_label ~name_description:_ ~hostname ~address
) ;
let make_new_metrics_object ref =
Db.Host_metrics.create ~__context ~ref
~uuid:(Uuid.to_string (Uuid.make_uuid ()))
~uuid:(Uuid.to_string (Uuid.make ()))
~live:false ~memory_total:0L ~memory_free:0L ~last_updated:Date.never
~other_config:[]
in
Expand Down Expand Up @@ -1952,7 +1952,7 @@ let apply_edition_internal ~__context ~host ~edition ~additional =
in
let create_feature fname fenabled =
Db.Feature.create ~__context
~uuid:(Uuid.to_string (Uuid.make_uuid ()))
~uuid:(Uuid.to_string (Uuid.make ()))
~ref:(Ref.make ()) ~name_label:fname ~name_description:""
~enabled:fenabled ~experimental:true ~version:"1.0" ~host
in
Expand Down
2 changes: 1 addition & 1 deletion ocaml/xapi/xapi_host_crashdump.ml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ let resynchronise ~__context ~host =
(Unix.stat (Filename.concat crash_dir filename)).Unix.st_ctime
in
let timestamp = Date.of_float timestamp in
let r = Ref.make () and uuid = Uuid.to_string (Uuid.make_uuid ()) in
let r = Ref.make () and uuid = Uuid.to_string (Uuid.make ()) in
Db.Host_crashdump.create ~__context ~ref:r ~uuid ~other_config:[] ~host
~timestamp ~size ~filename
)
Expand Down
2 changes: 1 addition & 1 deletion ocaml/xapi/xapi_message.ml
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ let create ~__context ~name ~priority ~cls ~obj_uuid ~body =
(Api_errors.uuid_invalid, [Record_util.class_to_string cls; obj_uuid])
) ;
let _ref = Ref.make () in
let uuid = Uuid.to_string (Uuid.make_uuid ()) in
let uuid = Uuid.to_string (Uuid.make ()) in
let timestamp = Mutex.execute event_mutex (fun () -> Unix.gettimeofday ()) in
(* During rolling upgrade, upgraded master might have a alerts grading
system different from the not yet upgraded slaves, during that process we
Expand Down
4 changes: 2 additions & 2 deletions ocaml/xapi/xapi_network.ml
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ let stem = "xapi"

let pool_introduce ~__context ~name_label ~name_description ~mTU ~other_config
~bridge ~managed ~purpose =
let r = Ref.make () and uuid = Uuid.make_uuid () in
let r = Ref.make () and uuid = Uuid.make () in
Db.Network.create ~__context ~ref:r ~uuid:(Uuid.to_string uuid)
~current_operations:[] ~allowed_operations:[] ~purpose ~name_label
~name_description ~mTU ~bridge ~managed ~other_config ~blobs:[] ~tags:[]
Expand Down Expand Up @@ -265,7 +265,7 @@ let create ~__context ~name_label ~name_description ~mTU ~other_config ~bridge
bridge
)
in
let r = Ref.make () and uuid = Uuid.make_uuid () in
let r = Ref.make () and uuid = Uuid.make () in
Db.Network.create ~__context ~ref:r ~uuid:(Uuid.to_string uuid)
~current_operations:[] ~allowed_operations:[] ~name_label
~name_description ~mTU ~bridge ~managed ~other_config ~blobs:[] ~tags
Expand Down
4 changes: 2 additions & 2 deletions ocaml/xapi/xapi_network_sriov.ml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ let network_sriov_mac = "fe:ff:ff:ff:ff:ff"

let create_internal ~__context ~physical_PIF ~physical_rec ~network =
let sriov = Ref.make () in
let sriov_uuid = Uuid.to_string (Uuid.make_uuid ()) in
let sriov_uuid = Uuid.to_string (Uuid.make ()) in
let logical_PIF = Ref.make () in
let mTU = physical_rec.API.pIF_MTU in
let metrics = physical_rec.API.pIF_metrics in
let device = physical_rec.API.pIF_device in
let host = physical_rec.API.pIF_host in
let primary_address_type = physical_rec.API.pIF_primary_address_type in
Db.PIF.create ~__context ~ref:logical_PIF
~uuid:(Uuid.to_string (Uuid.make_uuid ()))
~uuid:(Uuid.to_string (Uuid.make ()))
~device ~device_name:device ~network ~host ~mAC:network_sriov_mac ~mTU
~vLAN:(-1L) ~metrics ~physical:false ~currently_attached:false
~igmp_snooping_status:`unknown ~ip_configuration_mode:`None ~iP:""
Expand Down
Loading

0 comments on commit c7e38b8

Please sign in to comment.