Re: [libvirt PATCH 2/4] Adding Public Get and Set APIs for Network Metadata

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

 




On 19/07/23 14:48, Michal Prívozník wrote:
On 7/11/23 08:47, K Shiva Kiran wrote:
This patch introduces public Get and Set APIs for modifying <title>,
<description> and <metadata> elements of the Network object.

- Added enum to select one of the above elements to operate on.
- Added error code and messages for missing metadata.
- Added public API implementation.
- Added driver support.
- Defined wire protocol format.

Signed-off-by: K Shiva Kiran <shiva_kr@xxxxxxxxxx>
---
  include/libvirt/libvirt-network.h |  29 ++++++
  include/libvirt/virterror.h       |   1 +
  src/driver-network.h              |  16 +++
  src/libvirt-network.c             | 167 ++++++++++++++++++++++++++++++
  src/libvirt_public.syms           |   6 ++
  src/remote/remote_driver.c        |   2 +
  src/remote/remote_protocol.x      |  36 ++++++-
  src/remote_protocol-structs       |  19 ++++
  src/util/virerror.c               |   3 +
  9 files changed, 278 insertions(+), 1 deletion(-)

We usually introduce public APIs in one patch and implement remote
driver in another. But I guess I can live with this.

diff --git a/src/remote_protocol-structs b/src/remote_protocol-structs
index 3c6c230a16..14898a0bc7 100644
--- a/src/remote_protocol-structs
+++ b/src/remote_protocol-structs
@@ -3130,6 +3130,23 @@ struct remote_network_port_delete_args {
          remote_nonnull_network_port port;
          u_int                      flags;
  };
+struct remote_network_set_metadata_args {
+        remote_nonnull_network     network;
+        int                        type;
+        remote_string              metadata;
+        remote_string              key;
+        remote_string              uri;
+        u_int                      flags;
+};
+struct remote_network_get_metadata_args {
+        remote_nonnull_network     network;
+        int                        type;
+        remote_string              uri;
+        u_int                      flags;
+};
+struct remote_network_get_metadata_ret {
+        remote_nonnull_string      metadata;
+};
This is misplaced.

  struct remote_domain_checkpoint_create_xml_args {
          remote_nonnull_domain      dom;
          remote_nonnull_string      xml_desc;
@@ -3717,4 +3734,6 @@ enum remote_procedure {
          REMOTE_PROC_DOMAIN_RESTORE_PARAMS = 441,
          REMOTE_PROC_DOMAIN_ABORT_JOB_FLAGS = 442,
          REMOTE_PROC_DOMAIN_FD_ASSOCIATE = 443,
+        REMOTE_PROC_NETWORK_SET_METADATA = 444,
+        REMOTE_PROC_NETWORK_GET_METADATA = 445
Here we want the trailing comma.

  };
Squash in the following:

diff --git a/src/remote_protocol-structs b/src/remote_protocol-structs
index 14898a0bc7..c07e0af1e6 100644
--- a/src/remote_protocol-structs
+++ b/src/remote_protocol-structs
@@ -2687,6 +2687,23 @@ struct remote_network_event_lifecycle_msg {
          int                        event;
          int                        detail;
  };
+struct remote_network_set_metadata_args {
+        remote_nonnull_network     network;
+        int                        type;
+        remote_string              metadata;
+        remote_string              key;
+        remote_string              uri;
+        u_int                      flags;
+};
+struct remote_network_get_metadata_args {
+        remote_nonnull_network     network;
+        int                        type;
+        remote_string              uri;
+        u_int                      flags;
+};
+struct remote_network_get_metadata_ret {
+        remote_nonnull_string      metadata;
+};
  struct remote_connect_storage_pool_event_register_any_args {
          int                        eventID;
          remote_storage_pool        pool;
@@ -3130,23 +3147,6 @@ struct remote_network_port_delete_args {
          remote_nonnull_network_port port;
          u_int                      flags;
  };
-struct remote_network_set_metadata_args {
-        remote_nonnull_network     network;
-        int                        type;
-        remote_string              metadata;
-        remote_string              key;
-        remote_string              uri;
-        u_int                      flags;
-};
-struct remote_network_get_metadata_args {
-        remote_nonnull_network     network;
-        int                        type;
-        remote_string              uri;
-        u_int                      flags;
-};
-struct remote_network_get_metadata_ret {
-        remote_nonnull_string      metadata;
-};
  struct remote_domain_checkpoint_create_xml_args {
          remote_nonnull_domain      dom;
          remote_nonnull_string      xml_desc;
@@ -3735,5 +3735,5 @@ enum remote_procedure {
          REMOTE_PROC_DOMAIN_ABORT_JOB_FLAGS = 442,
          REMOTE_PROC_DOMAIN_FD_ASSOCIATE = 443,
          REMOTE_PROC_NETWORK_SET_METADATA = 444,
-        REMOTE_PROC_NETWORK_GET_METADATA = 445
+        REMOTE_PROC_NETWORK_GET_METADATA = 445,
  };


Michal

Squashed in v2:
https://listman.redhat.com/archives/libvir-list/2023-July/240830.html
I realize it's a mistake to send a v2 patch as a reply to the same thread and
won't be repeating it.

Shiva





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux