WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

[Xen-API] [PATCH 3 of 5] CA-36384: [experimental PCI passthrough]: add a

To: xen-api@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-API] [PATCH 3 of 5] CA-36384: [experimental PCI passthrough]: add a Device.PCI.bind before calling Device.PCI.plug, just like we do with Device.PCI.add (coldplug). Call Vmops.plug_pcidevs on the reboot path
From: David Scott <dave.scott@xxxxxxxxxxxxx>
Date: Tue, 12 Jan 2010 22:57:03 +0000
Delivery-date: Tue, 12 Jan 2010 15:04:06 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1263337020@xxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User David Scott <dave.scott@xxxxxxxxxxxxx>
# Date 1263336662 0
# Node ID 59cc9bf262f2d433fb86941546c138c66184b510
# Parent  eb25907b24f6e386beea49d6160e1c2381694b6d
CA-36384: [experimental PCI passthrough]: add a Device.PCI.bind before calling 
Device.PCI.plug, just like we do with Device.PCI.add (coldplug). Call 
Vmops.plug_pcidevs on the reboot path.

Signed-off-by: David Scott <dave.scott@xxxxxxxxxxxxx>

diff -r eb25907b24f6 -r 59cc9bf262f2 ocaml/xapi/vmops.ml
--- a/ocaml/xapi/vmops.ml       Tue Jan 12 22:51:01 2010 +0000
+++ b/ocaml/xapi/vmops.ml       Tue Jan 12 22:51:02 2010 +0000
@@ -498,6 +498,7 @@
              if (Xc.domain_getinfo xc domid).Xc.hvm_guest then begin
                        List.iter 
                                (fun (devid, devices) ->
+                                        Device.PCI.bind devices;
                                         List.iter
                                                 (fun ((a, b, c, d) as device) 
->
                                                          debug "hotplugging 
PCI device %04x:%02x:%02x.%01x into domid: %d" a b c d domid;
@@ -1014,6 +1015,7 @@
                             progress_cb 0.80;
                             debug "creating device emulator";
                             let vncport = create_device_emulator ~__context 
~xc ~xs ~self:vm domid vifs snapshot in
+                                if hvm then plug_pcidevs ~__context ~vm domid;
                             create_console ~__context ~vM:vm ~vncport ();
                             debug "writing memory policy";
                             write_memory_policy ~xs snapshot domid;
diff -r eb25907b24f6 -r 59cc9bf262f2 ocaml/xapi/xapi_vm.ml
--- a/ocaml/xapi/xapi_vm.ml     Tue Jan 12 22:51:01 2010 +0000
+++ b/ocaml/xapi/xapi_vm.ml     Tue Jan 12 22:51:02 2010 +0000
@@ -264,7 +264,6 @@
                  (fun xc xs -> 
                     Domain.unpause ~xc domid;
                  );
-               Vmops.plug_pcidevs ~__context ~vm domid;
 (*
                (* hack to get xmtest to work *)
                if Pool_role.is_master () then
@@ -447,6 +446,7 @@
                          );
           Db.VM.set_resident_on ~__context ~self:vm ~value:localhost;
            Db.VM.set_power_state ~__context ~self:vm ~value:`Running;
+
         with exn ->
           error "Caught exception during %s: %s" api_call_name 
(ExnHelper.string_of_exn exn);
           with_xc_and_xs (fun xc xs -> Vmops.destroy ~__context ~xc ~xs 
~self:vm domid `Halted);
@@ -807,6 +807,8 @@
                                                        Vmops.restore 
~__context ~xc ~xs ~self:vm domid;
                                                        Db.VM.set_domid 
~__context ~self:vm
                                                                
~value:(Int64.of_int domid);
+                                                       Vmops.plug_pcidevs 
~__context ~vm domid;
+
                                                        debug "resume phase 
3/3: %s unpausing domain"
                                                                (if 
start_paused then "not" else "");
                                                        if not start_paused 
then begin
@@ -820,7 +822,7 @@
                                                                localhost
                                                        );
                                                        Db.VM.set_power_state 
~__context ~self:vm
-                                                               ~value:(if 
start_paused then `Paused else `Running)
+                                                               ~value:(if 
start_paused then `Paused else `Running);
 (*
                                                )
 *)
2 files changed, 6 insertions(+), 2 deletions(-)
ocaml/xapi/vmops.ml   |    2 ++
ocaml/xapi/xapi_vm.ml |    6 ++++--


Attachment: xen-api.hg-5.patch
Description: Text Data

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api