Skip to content

Commit

Permalink
Merge commit '366f084c3c3e531c2d13c0ee7af0f421164a1ce0'
Browse files Browse the repository at this point in the history
  • Loading branch information
xen-git committed Jul 12, 2012
2 parents ad54f33 + 366f084 commit 73b557d
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions ocaml/xapi/xapi_guest_agent.ml
Expand Up @@ -234,12 +234,14 @@ let all (lookup: string -> string option) (list: string -> string list) ~__conte
if(List.mem_assoc Xapi_globs.device_id_key_name device_id) then begin
let value = List.assoc Xapi_globs.device_id_key_name device_id in
let platform = Db.VM.get_platform ~__context ~self in
if not(List.mem_assoc Xapi_globs.device_id_key_name platform) then begin
info "Setting VM %s platform:%s <- %s" (Ref.string_of self) Xapi_globs.device_id_key_name value;
try
Db.VM.add_to_platform ~__context ~self ~key:Xapi_globs.device_id_key_name ~value:value;
with _ -> ()
end
info "Updating VM %s platform:%s <- %s" (Ref.string_of self) Xapi_globs.device_id_key_name value;
if List.mem_assoc Xapi_globs.device_id_key_name platform then
(try
Db.VM.remove_from_platform ~__context ~self ~key:Xapi_globs.device_id_key_name
with _ -> ());
try
Db.VM.add_to_platform ~__context ~self ~key:Xapi_globs.device_id_key_name ~value:value;
with _ -> ()
end
end;

Expand Down

0 comments on commit 73b557d

Please sign in to comment.