]> xenbits.xensource.com Git - xcp/xen-api.git/commitdiff
CA-10471: Map attached file VDIs to raw physical, not loopback nodes.
authorDaniel Stodden <daniel.stodden@citrix.com>
Wed, 26 Jan 2011 17:39:04 +0000 (17:39 +0000)
committerDaniel Stodden <daniel.stodden@citrix.com>
Wed, 26 Jan 2011 17:39:04 +0000 (17:39 +0000)
Thereby obsoleting the loopback code.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
ocaml/xenops/device.ml

index 1a2d1ee00d64169c9a615103e312fa7a53b94669..a66783a2bece682deff26ad08e65decdf147935f 100644 (file)
@@ -475,8 +475,7 @@ let is_paused ~xs (x: device) =
        let request_path = backend_pause_request_path_of_device ~xs x in
        try ignore(xs.Xs.read request_path); true with Xb.Noent -> false
 
-(* Add the VBD to the domain, taking care of allocating any resources (specifically
-   loopback mounts). When this command returns, the device is ready. (This isn't as
+(* Add the VBD to the domain, When this command returns, the device is ready. (This isn't as
    concurrent as xend-- xend allocates loopdevices via hotplug in parallel and then
    performs a 'waitForDevices') *)
 let add ~xs ~hvm ~mode ~virtpath ~phystype ~physpath ~dev_type ~unpluggable
@@ -494,8 +493,7 @@ let add ~xs ~hvm ~mode ~virtpath ~phystype ~physpath ~dev_type ~unpluggable
           1. qemu accesses devices images itself and so needs the path of the original
               file (in params)
            2. when windows PV drivers initialise, the new blockfront connects to the
-              up-til-now idle blockback and this requires the loop-device, in the file
-             case
+              up-til-now idle blockback.
            3. when the VM is fully PV, Ioemu devices do not work; all devices must be PV
           4. in the future an HVM guest might support a mixture of both
        *)
@@ -505,16 +503,6 @@ let add ~xs ~hvm ~mode ~virtpath ~phystype ~physpath ~dev_type ~unpluggable
             List.iter (fun (k, v) -> Hashtbl.add back_tbl k v) keys
         | None -> ());
 
-       begin match phystype with
-         | File ->
-             if not(hvm) then begin
-               let loopdev = Hotplug.mount_loopdev ~xs device physpath (mode = ReadOnly) in
-               Hashtbl.add back_tbl "physical-device" (string_of_major_minor loopdev);
-               Hashtbl.add back_tbl "loop-device" loopdev
-             end
-         | Phys | Qcow | Vhd | Aio ->
-             Hashtbl.add back_tbl "physical-device" (string_of_major_minor physpath)
-          end;
 
        Hashtbl.add_list front_tbl [
                "backend-id", string_of_int backend_domid;
@@ -523,6 +511,7 @@ let add ~xs ~hvm ~mode ~virtpath ~phystype ~physpath ~dev_type ~unpluggable
                "device-type", if dev_type = CDROM then "cdrom" else "disk";
        ];
        Hashtbl.add_list back_tbl [
+               "physical-device", (string_of_major_minor physpath);
                "frontend-id", sprintf "%u" domid;
                (* Prevents the backend hotplug scripts from running if the frontend disconnects.
                   This allows the xenbus connection to re-establish itself *)