remote driver implementation of new APIs. * src/remote/remote_driver.c: new fields for remote_driver * src/remote/remote_protocol.x: remote protocol definition * src/rpc/gendispatch.pl: special case priv_name for (SavedImage|CoreDump) Signed-off-by: Hong Xiang <hxiang@xxxxxxxxxxxxxxxxxx> --- src/remote/remote_driver.c | 8 +++++ src/remote/remote_protocol.x | 61 +++++++++++++++++++++++++++++++++++++++++- src/rpc/gendispatch.pl | 1 + 3 files changed, 69 insertions(+), 1 deletions(-) diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 1dea327..b432154 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -4438,6 +4438,14 @@ static virDriver remote_driver = { .domainGetBlockJobInfo = remoteDomainGetBlockJobInfo, /* 0.9.4 */ .domainBlockJobSetSpeed = remoteDomainBlockJobSetSpeed, /* 0.9.4 */ .domainBlockPull = remoteDomainBlockPull, /* 0.9.4 */ + .numOfSavedImages = remoteNumOfSavedImages, /* 0.9.8 */ + .listSavedImages = remoteListSavedImages, /* 0.9.8 */ + .savedImageRemove = remoteSavedImageRemove, /* 0.9.8 */ + .savedImageDownload = remoteSavedImageDownload, /* 0.9.8 */ + .numOfCoreDumps = remoteNumOfCoreDumps, /* 0.9.8 */ + .listCoreDumps = remoteListCoreDumps, /* 0.9.8 */ + .coreDumpRemove = remoteCoreDumpRemove, /* 0.9.8 */ + .coreDumpDownload = remoteCoreDumpDownload, /* 0.9.8 */ }; static virNetworkDriver network_driver = { diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x index f95253e..ae7049e 100644 --- a/src/remote/remote_protocol.x +++ b/src/remote/remote_protocol.x @@ -196,6 +196,16 @@ const REMOTE_CPU_BASELINE_MAX = 256; */ const REMOTE_DOMAIN_SEND_KEY_MAX = 16; +/* + * Max number of save images. + */ +const REMOTE_DOMAIN_SAVED_IMAGE_MAX = 1024; + +/* + * Max number of core dumps. + */ +const REMOTE_DOMAIN_CORE_DUMP_MAX = 1024; + /* UUID. VIR_UUID_BUFLEN definition comes from libvirt.h */ typedef opaque remote_uuid[VIR_UUID_BUFLEN]; @@ -2253,6 +2263,46 @@ struct remote_domain_get_control_info_ret { /* insert@1 */ unsigned hyper stateTime; }; +struct remote_num_of_saved_images_ret { + int num; +}; + +struct remote_list_saved_images_args { + int maxfiles; +}; + +struct remote_list_saved_images_ret { + remote_nonnull_string files<REMOTE_DOMAIN_SAVED_IMAGE_MAX>; /* insert@1 */ +}; + +struct remote_saved_image_remove_args { + remote_nonnull_string file; +}; + +struct remote_saved_image_download_args { + remote_nonnull_string file; +}; + +struct remote_num_of_core_dumps_ret { + int num; +}; + +struct remote_list_core_dumps_args { + int maxfiles; +}; + +struct remote_list_core_dumps_ret { + remote_nonnull_string files<REMOTE_DOMAIN_CORE_DUMP_MAX>; /* insert@1 */ +}; + +struct remote_core_dump_remove_args { + remote_nonnull_string file; +}; + +struct remote_core_dump_download_args { + remote_nonnull_string file; +}; + /*----- Protocol. -----*/ /* Define the program number, protocol version and procedure numbers here. */ @@ -2546,7 +2596,16 @@ enum remote_procedure { REMOTE_PROC_DOMAIN_SNAPSHOT_GET_PARENT = 244, /* autogen autogen priority:high */ REMOTE_PROC_DOMAIN_RESET = 245, /* autogen autogen */ REMOTE_PROC_DOMAIN_SNAPSHOT_NUM_CHILDREN = 246, /* autogen autogen priority:high */ - REMOTE_PROC_DOMAIN_SNAPSHOT_LIST_CHILDREN_NAMES = 247 /* autogen autogen priority:high */ + REMOTE_PROC_DOMAIN_SNAPSHOT_LIST_CHILDREN_NAMES = 247, /* autogen autogen priority:high */ + REMOTE_PROC_NUM_OF_SAVED_IMAGES = 248, /* autogen autogen */ + REMOTE_PROC_LIST_SAVED_IMAGES = 249, /* autogen autogen */ + REMOTE_PROC_SAVED_IMAGE_REMOVE = 250, /* autogen autogen */ + + REMOTE_PROC_SAVED_IMAGE_DOWNLOAD = 251, /* autogen autogen | readstream@1 */ + REMOTE_PROC_NUM_OF_CORE_DUMPS = 252, /* autogen autogen */ + REMOTE_PROC_LIST_CORE_DUMPS = 253, /* autogen autogen */ + REMOTE_PROC_CORE_DUMP_REMOVE = 254, /* autogen autogen */ + REMOTE_PROC_CORE_DUMP_DOWNLOAD = 255 /* autogen autogen | readstream@1 */ /* * Notice how the entries are grouped in sets of 10 ? diff --git a/src/rpc/gendispatch.pl b/src/rpc/gendispatch.pl index b7ac3c8..234b751 100755 --- a/src/rpc/gendispatch.pl +++ b/src/rpc/gendispatch.pl @@ -1174,6 +1174,7 @@ elsif ($opt_k) { # fix priv_name for the NumOf* functions if ($priv_name eq "privateData" and !($call->{ProcName} =~ m/(Domains|DomainSnapshot)/) and + !($call->{ProcName} =~ m/(SavedImage|CoreDump)/) and ($call->{ProcName} =~ m/NumOf(Defined|Domain)*(\S+)s/ or $call->{ProcName} =~ m/List(Defined|Domain)*(\S+)s/)) { my $prefix = lc $2; -- 1.7.1 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list