X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=daemon%2Fstubs.c;h=ee27997729ebb6da0aad2b29b38fe1d8dbfda07f;hp=937913f3e1105007666cf66ddc44a34dcefa1707;hb=e118c14b9552de311cbc1734e03a3226b484c1e8;hpb=b55bf8158f0b7f6b1760b7b3b5f7c1274a149127 diff --git a/daemon/stubs.c b/daemon/stubs.c index 937913f..ee27997 100644 --- a/daemon/stubs.c +++ b/daemon/stubs.c @@ -2127,6 +2127,32 @@ done: xdr_free ((xdrproc_t) xdr_guestfs_zero_args, (char *) &args); } +static void grub_install_stub (XDR *xdr_in) +{ + int r; + struct guestfs_grub_install_args args; + const char *root; + const char *device; + + memset (&args, 0, sizeof args); + + if (!xdr_guestfs_grub_install_args (xdr_in, &args)) { + reply_with_error ("%s: daemon failed to decode procedure arguments", "grub_install"); + return; + } + root = args.root; + device = args.device; + + r = do_grub_install (root, device); + if (r == -1) + /* do_grub_install has already called reply_with_error */ + goto done; + + reply (NULL, NULL); +done: + xdr_free ((xdrproc_t) xdr_guestfs_grub_install_args, (char *) &args); +} + void dispatch_incoming_message (XDR *xdr_in) { switch (proc_nr) { @@ -2385,6 +2411,9 @@ void dispatch_incoming_message (XDR *xdr_in) case GUESTFS_PROC_ZERO: zero_stub (xdr_in); break; + case GUESTFS_PROC_GRUB_INSTALL: + grub_install_stub (xdr_in); + break; default: reply_with_error ("dispatch_incoming_message: unknown procedure number %d", proc_nr); }