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

Re: [Libvir] [PATCH] change a Disk/Nic of inactive domain



On Tue, Jan 08, 2008 at 02:04:00PM +0900, S.Sakamoto wrote:
> Hi
> 
> The libvirt on Xen-3.03 does not have the function
> that add/change/delete a Disk/NIC of inactive domain.
> 
> So, I made a patch which enabled add/change/delete of Disk/NIC of inactive domain.
> This patch will be able to change "disk" or "vif" parameter in configuration file
> with "attach-disk","attach-interface", "attach-device",
> "detach-disk", "detach-interface" and "detach-device" command, like "setmem" or "setvcpus".

The general principle of the patch is fine, but this change is not:

> Index: src/conf.h
> ===================================================================
> RCS file: /data/cvs/libvirt/src/conf.h,v
> retrieving revision 1.4
> diff -u -p -r1.4 conf.h
> --- src/conf.h  30 Nov 2007 15:43:42 -0000      1.4
> +++ src/conf.h  8 Jan 2008 01:10:52 -0000
> @@ -59,12 +59,31 @@ struct _virConfValue {
>  };
> 
>  /**
> + * virConfEntryPtr:
> + * used by configuration data
> + */
> +typedef struct _virConfEntry virConfEntry;
> +typedef virConfEntry *virConfEntryPtr;
> +
> +struct _virConfEntry {
> +    virConfEntryPtr next;
> +    char* name;
> +    char* comment;
> +    virConfValuePtr value;
> +};
> +
> +/**
>   * virConfPtr:
>   * a pointer to a parsed configuration file
>   */
>  typedef struct _virConf virConf;
>  typedef virConf *virConfPtr;
> 
> +struct _virConf {
> +    const char* filename;
> +    virConfEntryPtr entries;
> +};
> +
>  virConfPtr      __virConfNew             (void);
>  virConfPtr     __virConfReadFile       (const char *filename);
>  virConfPtr     __virConfReadMem                (const char *memory,

These struct definitions *intentionally* private. There are explicit
APIs to access data within them. AFAICT, the 'virConfGetValue' API
should be sufficient for the needs of your patch without accessing the
struct data directly.

Dan.
-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 


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