[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[win-pv-devel] [PATCH 1/8] Remove use of 'Addresses' subkey



XENVIF writes the permanent address of each vif into a subkey under its
service key. This is done to allow XENNET's co-installer to copy network
settings from any emulated device that currently has that address.

As of Windows 10, this functionality cannot be provided by a co-installer
and so this subkey has become useless. Hence this patch removes its use.

Signed-off-by: Paul Durrant <paul.durrant@xxxxxxxxxx>
---
 src/xenvif/driver.c | 50 +-------------------------------------------------
 src/xenvif/driver.h |  5 -----
 src/xenvif/pdo.c    | 24 +++---------------------
 3 files changed, 4 insertions(+), 75 deletions(-)

diff --git a/src/xenvif/driver.c b/src/xenvif/driver.c
index b9e6d2f..46fe7f1 100644
--- a/src/xenvif/driver.c
+++ b/src/xenvif/driver.c
@@ -47,7 +47,6 @@ extern PULONG       InitSafeBootMode;
 typedef struct _XENVIF_DRIVER {
     PDRIVER_OBJECT      DriverObject;
     HANDLE              ParametersKey;
-    HANDLE              AddressesKey;
     HANDLE              StatusKey;
 } XENVIF_DRIVER, *PXENVIF_DRIVER;
 
@@ -102,30 +101,6 @@ DriverGetParametersKey(
 }
 
 static FORCEINLINE VOID
-__DriverSetAddressesKey(
-    IN  HANDLE  Key
-    )
-{
-    Driver.AddressesKey = Key;
-}
-
-static FORCEINLINE HANDLE
-__DriverGetAddressesKey(
-    VOID
-    )
-{
-    return Driver.AddressesKey;
-}
-
-HANDLE
-DriverGetAddressesKey(
-    VOID
-    )
-{
-    return __DriverGetAddressesKey();
-}
-
-static FORCEINLINE VOID
 __DriverSetStatusKey(
     IN  HANDLE  Key
     )
@@ -156,7 +131,6 @@ DriverUnload(
     IN  PDRIVER_OBJECT  DriverObject
     )
 {
-    HANDLE              AddressesKey;
     HANDLE              ParametersKey;
     HANDLE              StatusKey;
 
@@ -172,11 +146,6 @@ DriverUnload(
 
     RegistryCloseKey(StatusKey);
 
-    AddressesKey = __DriverGetAddressesKey();
-    __DriverSetAddressesKey(NULL);
-
-    RegistryCloseKey(AddressesKey);
-
     ParametersKey = __DriverGetParametersKey();
     __DriverSetParametersKey(NULL);
 
@@ -284,7 +253,6 @@ DriverEntry(
 {
     HANDLE              ServiceKey;
     HANDLE              ParametersKey;
-    HANDLE              AddressesKey;
     HANDLE              StatusKey;
     ULONG               Index;
     NTSTATUS            status;
@@ -331,21 +299,12 @@ DriverEntry(
 
     __DriverSetParametersKey(ParametersKey);
 
-    status = RegistryCreateSubKey(ServiceKey, 
-                                  "Addresses", 
-                                  REG_OPTION_VOLATILE, 
-                                  &AddressesKey);
-    if (!NT_SUCCESS(status))
-        goto fail4;
-
-    __DriverSetAddressesKey(AddressesKey);
-
     status = RegistryCreateSubKey(ServiceKey,
                                   "Status",
                                   REG_OPTION_VOLATILE,
                                   &StatusKey);
     if (!NT_SUCCESS(status))
-        goto fail5;
+        goto fail4;
 
     __DriverSetStatusKey(StatusKey);
 
@@ -364,13 +323,6 @@ done:
 
     return STATUS_SUCCESS;
 
-fail5:
-    Error("fail5\n");
-
-    __DriverSetAddressesKey(NULL);
-
-    RegistryCloseKey(AddressesKey);
-
 fail4:
     Error("fail4\n");
 
diff --git a/src/xenvif/driver.h b/src/xenvif/driver.h
index 17ed726..cecefd0 100644
--- a/src/xenvif/driver.h
+++ b/src/xenvif/driver.h
@@ -43,11 +43,6 @@ DriverGetParametersKey(
     );
 
 extern HANDLE
-DriverGetAddressesKey(
-    VOID
-    );
-
-extern HANDLE
 DriverGetStatusKey(
     VOID
     );
diff --git a/src/xenvif/pdo.c b/src/xenvif/pdo.c
index 61ab4ca..f2e6a8f 100644
--- a/src/xenvif/pdo.c
+++ b/src/xenvif/pdo.c
@@ -808,36 +808,16 @@ __PdoSetPermanentAddress(
     IN  PCHAR       Buffer
     )
 {
-    HANDLE          AddressesKey;
-    ANSI_STRING     Ansi;
-    ULONG           Index;
     NTSTATUS        status;
 
     status = __PdoParseAddress(Buffer, &Pdo->PermanentAddress);
     if (!NT_SUCCESS(status))
         goto fail1;
 
-    AddressesKey = DriverGetAddressesKey();
-
-    RtlInitAnsiString(&Ansi, Buffer);
-
-    for (Index = 0; Index < Ansi.Length; Index++)
-        Ansi.Buffer[Index] = (CHAR)toupper(Ansi.Buffer[Index]);
-
-    Info("%s %Z\n", __PdoGetName(Pdo), &Ansi);
-
-    status = RegistryUpdateSzValue(AddressesKey,
-                                   __PdoGetName(Pdo),
-                                   REG_SZ,
-                                   &Ansi);
-    if (!NT_SUCCESS(status))
-        goto fail2;
+    Info("%s: %s\n", __PdoGetName(Pdo), Buffer);
 
     return STATUS_SUCCESS;
 
-fail2:
-    Error("fail2\n");
-
 fail1:
     Error("fail1 (%08x)\n", status);
 
@@ -879,6 +859,8 @@ __PdoSetCurrentAddress(
     if (!NT_SUCCESS(status))
         goto fail2;
 
+    Info("%s: %Z\n", __PdoGetName(Pdo), &Ansi[0]);
+
     RegistryFreeSzValue(Ansi);
 
 done:
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.